<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Dan&apos;s Blog</title><description>Research · Engineering · Notes</description><link>https://danarnoux.com/</link><language>en-us</language><item><title>Cloudflare Pages Redirects Working but GSC Not Recognizing? Migration Fix &amp; Bulk Redirects Solution</title><link>https://danarnoux.com/blog/cloudflare-pages-gsc-migration-redirect-fix-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/cloudflare-pages-gsc-migration-redirect-fix-en/</guid><description>A detailed analysis of why Google Search Console fails to recognize 301 redirects when migrating from *.pages.dev to a custom domain on Cloudflare Pages, with a reliable solution using Bulk Redirects.</description><pubDate>Fri, 20 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When I migrated my site to a new domain using GSC, I ran into a frustrating issue. I had already set up 301 redirects, but GSC just wouldn’t recognize them. I kept seeing the old pages.dev domain still stealing my traffic. Then I found a solution from a blog called Codemzy—and it actually worked.&lt;/p&gt;
&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;
&lt;p&gt;When moving a site from &lt;code&gt;*.pages.dev&lt;/code&gt; to a custom domain, passing SEO ranking is the key concern. According to the official docs, the ideal approach is using 301 permanent redirects, so Google knows the original URL has permanently moved to the new address and passes the ranking authority over.&lt;/p&gt;
&lt;p&gt;Here’s the scenario:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Source: &lt;code&gt;https://dansblog.pages.dev&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Target: &lt;code&gt;https://danarnoux.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Expected: Both browser and search engines receive 301 status code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-problem&quot;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;After configuring redirects, testing revealed:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Browser works fine&lt;/strong&gt; - Visiting &lt;code&gt;dansblog.pages.dev/any-path&lt;/code&gt; automatically redirects to &lt;code&gt;danarnoux.com/any-path&lt;/code&gt;, seamless for users&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GSC error&lt;/strong&gt; - Google Search Console reports many URLs returning non-301 status codes, migration verification fails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cURL test oddities&lt;/strong&gt; - Some tools detect status codes that don’t match expectations&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Very strange: user access works perfectly, but Google just won’t acknowledge it.&lt;/p&gt;
&lt;h2 id=&quot;failed-solutions&quot;&gt;Failed Solutions&lt;/h2&gt;
&lt;h3 id=&quot;solution-1-_redirects-file&quot;&gt;Solution 1: _redirects File&lt;/h3&gt;
&lt;p&gt;Tried configuring in &lt;code&gt;public/_redirects&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;https://dansblog.pages.dev/* https://danarnoux.com/:splat 301&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: Browser redirect works, but GSC still doesn’t recognize it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Root cause analysis&lt;/strong&gt; (inference based on Cloudflare official documentation):&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;11-official-documentation-references&quot;&gt;1.1 Official Documentation References&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Bulk Redirects Docs&lt;/strong&gt;:
&lt;a href=&quot;https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/&quot;&gt;https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Bulk Redirects allow you to define URL redirects at the account level and have them executed at the edge.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Redirect Rules Docs&lt;/strong&gt;:
&lt;a href=&quot;https://developers.cloudflare.com/rules/url-forwarding/&quot;&gt;https://developers.cloudflare.com/rules/url-forwarding/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pages _redirects Docs&lt;/strong&gt;:
&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/redirects/&quot;&gt;https://developers.cloudflare.com/pages/platform/redirects/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“You can define redirects by adding a &lt;code&gt;_redirects&lt;/code&gt; file to your project.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;How Pages Works&lt;/strong&gt;:
&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/how-pages-works/&quot;&gt;https://developers.cloudflare.com/pages/platform/how-pages-works/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Cloudflare Pages serves your site through Cloudflare’s global network.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h4 id=&quot;12-technical-interpretation&quot;&gt;1.2 Technical Interpretation&lt;/h4&gt;
&lt;p&gt;According to the documentation, the two redirect mechanisms are fundamentally different:&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mechanism&lt;/th&gt;&lt;th&gt;Processing Level&lt;/th&gt;&lt;th&gt;Execution Location&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pages _redirects&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Project-level (injected at build)&lt;/td&gt;&lt;td&gt;Pages Platform&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Bulk Redirects&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Account-level&lt;/td&gt;&lt;td&gt;Edge Network&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_redirects&lt;/code&gt; is part of your project, defined via &lt;code&gt;public/_redirects&lt;/code&gt; file, processed by the Pages platform at build time&lt;/li&gt;
&lt;li&gt;Bulk Redirects are a separate Rules system, executed at edge nodes globally, with higher priority than Pages-level config&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4 id=&quot;13-inference&quot;&gt;1.3 Inference&lt;/h4&gt;
&lt;p&gt;Based on Cloudflare’s official documentation, we can confirm:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_redirects&lt;/code&gt; belongs to Pages project-level redirect configuration&lt;/li&gt;
&lt;li&gt;Bulk Redirects belong to the Rules system, executed directly on Cloudflare’s Edge network&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With that context, here’s a somewhat conservative inference:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;GSC, when performing site migration detection, may more readily recognize 301 redirects returned directly from the Edge layer. For redirects implemented at the Pages layer, it may not consistently recognize them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Important to note:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Neither Cloudflare nor Google has explicitly explained GSC’s judgment logic&lt;/li&gt;
&lt;li&gt;The above conclusions are based solely on documentation structure and actual test results&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 In practice, Bulk Redirects can reliably pass GSC migration verification.&lt;/p&gt;
&lt;h3 id=&quot;solution-2-worker-approach&quot;&gt;Solution 2: Worker Approach&lt;/h3&gt;
&lt;p&gt;Tried writing a Cloudflare Worker to handle redirects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: Works, but has instability risks—Workers can fail due to limits, config changes, or other issues.&lt;/p&gt;
&lt;h2 id=&quot;the-fix-bulk-redirects&quot;&gt;The Fix: Bulk Redirects&lt;/h2&gt;
&lt;p&gt;The final solution uses &lt;strong&gt;Cloudflare Bulk Redirects&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Important: Bulk Redirects has a &lt;strong&gt;two-step structure&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First create a Redirect List (rule data)&lt;/li&gt;
&lt;li&gt;Then create a Redirect Rule (activates the rules)&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-1-access-bulk-redirects&quot;&gt;Step 1: Access Bulk Redirects&lt;/h3&gt;
&lt;p&gt;Go to Cloudflare Dashboard:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select your domain (e.g., &lt;code&gt;danarnoux.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;On the left sidebar: &lt;strong&gt;Rules → Redirect Rules&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Switch to &lt;strong&gt;Bulk Redirects&lt;/strong&gt; tab&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-2-create-bulk-redirect-list-do-this-first&quot;&gt;Step 2: Create Bulk Redirect List (Do This First)&lt;/h3&gt;
&lt;p&gt;Click:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Create Bulk Redirect List&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Fill in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;List name: e.g., &lt;code&gt;pages-dev-redirect&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-3-add-rules-to-the-list&quot;&gt;Step 3: Add Rules to the List&lt;/h3&gt;
&lt;p&gt;Add one rule:&lt;/p&gt;

































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Source URL&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://dansblog.pages.dev/*&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Target URL&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://danarnoux.com/$1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Status&lt;/td&gt;&lt;td&gt;301 (or use 302 for testing first)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Preserve query string&lt;/td&gt;&lt;td&gt;Optional&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Subpath matching&lt;/td&gt;&lt;td&gt;ON&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Preserve path suffix&lt;/td&gt;&lt;td&gt;ON&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Key points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;*&lt;/code&gt; to match all paths&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;$1&lt;/code&gt; to preserve the original path&lt;/li&gt;
&lt;li&gt;Recommend using &lt;strong&gt;302&lt;/strong&gt; first to test, then switch to &lt;strong&gt;301&lt;/strong&gt; when confirmed&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-note&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;note&lt;/p&gt;
&lt;p&gt;In “Add URLs”, click “Or, Manually add URL redirects”, then remember to click “Edit parameters”.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;About the options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Subpath matching / Preserve path suffix&lt;/strong&gt;: Recommend turning these on, otherwise paths may not pass correctly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preserve query string&lt;/strong&gt;: Whether to enable depends on your needs (e.g., if you need to keep URL parameters). Disabling it still allows migration to complete normally.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-4-create-bulk-redirect-rule-activate-the-rules&quot;&gt;Step 4: Create Bulk Redirect Rule (Activate the Rules)&lt;/h3&gt;
&lt;p&gt;Go back to Bulk Redirects page:&lt;/p&gt;
&lt;p&gt;Click:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Create Bulk Redirect Rule&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Configure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rule name: e.g., &lt;code&gt;pages.dev redirect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Redirect using list: Select the List you just created&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-5-enable-the-rule&quot;&gt;Step 5: Enable the Rule&lt;/h3&gt;
&lt;p&gt;After saving, make sure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rule status is ✅ Enabled (green)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 Note:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you only create a List without a Rule, it won’t take effect&lt;/p&gt;
&lt;p&gt;For reference, check the example in step 1—note that Status shows “Active”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-6-wait-for-activation&quot;&gt;Step 6: Wait for Activation&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Click Save / Deploy&lt;/li&gt;
&lt;li&gt;Usually takes effect within 1-2 minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;/h3&gt;
&lt;p&gt;The correct flow for Bulk Redirects:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;List (define rules) → Rule (enable rules) → Edge execution&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;key-difference&quot;&gt;Key Difference&lt;/h3&gt;
&lt;p&gt;Essential difference between Bulk Redirects and _redirects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bulk Redirects are processed directly at Cloudflare’s network edge (Edge), without going through the Pages layer&lt;/li&gt;
&lt;li&gt;Higher priority, more stable rules&lt;/li&gt;
&lt;li&gt;More reliable status code returns&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;p&gt;After configuration, verify using these methods:&lt;/p&gt;
&lt;h3 id=&quot;1-browser-test&quot;&gt;1. Browser Test&lt;/h3&gt;
&lt;p&gt;Visit the original URL directly to confirm redirect works.&lt;/p&gt;
&lt;h3 id=&quot;2-curl-test&quot;&gt;2. cURL Test&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -I&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://dansblog.pages.dev/blog/test&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Should return 301 + Location: https://danarnoux.com/blog/test&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;3-gsc-verification&quot;&gt;3. GSC Verification&lt;/h3&gt;
&lt;p&gt;In Google Search Console, re-verify the migration. After success, you should see a prompt: &lt;strong&gt;This site is currently being migrated to [danarnoux.com]&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;When migrating from &lt;code&gt;*.pages.dev&lt;/code&gt; to a custom domain, the _redirects method works fine in browsers, but GSC may not recognize it. According to the documentation, &lt;strong&gt;Bulk Redirects execute at the Edge layer&lt;/strong&gt;, making status code returns more stable and reliable—recommended for direct use.&lt;/p&gt;
&lt;p&gt;As for why _redirects isn’t recognized by GSC, neither Cloudflare nor Google has explicitly explained GSC’s specific judgment logic. The above is merely an inference based on documentation structure—no absolute conclusion can be drawn. If you value stability, Bulk Redirects is the safer choice.&lt;/p&gt;
&lt;p&gt;Original article from Codemzy: &lt;strong&gt;&lt;a href=&quot;https://www.codemzy.com/blog/cloudflare-pages-dev-redirect&quot;&gt;https://www.codemzy.com/blog/cloudflare-pages-dev-redirect&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</content:encoded><category>Cloudflare</category><category>SEO</category><category>GSC</category><category>guide</category><category>EN</category></item><item><title>Cloudflare Pages 重定向正常但 GSC 不识别？网站迁移失败与 Bulk Redirects 解决方案</title><link>https://danarnoux.com/blog/cloudflare-pages-gsc-migration-redirect-fix-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/cloudflare-pages-gsc-migration-redirect-fix-cn/</guid><description>详细分析在 Cloudflare Pages 中将 *.pages.dev 重定向到自定义域名后，Google Search Console 无法识别 301 重定向、导致网站迁移失败的问题，并提供使用 Bulk Redirects 的可靠解决方案。</description><pubDate>Fri, 20 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;1-前言&quot;&gt;1. 前言&lt;/h2&gt;
&lt;p&gt;我买了一个新域名后，使用GSC迁移网站的时候很是头疼，明明自己已经做好了重定向301的工作，但是为什么GSC就是不认呢？我还得天天看着旧的pages.dev域名在分我流量，不过，我找到一个叫Codemzy的博客提出了解决方案，参考一下竟然真的有效。&lt;/p&gt;
&lt;h2 id=&quot;2-背景&quot;&gt;2. 背景&lt;/h2&gt;
&lt;p&gt;将网站从 &lt;code&gt;*.pages.dev&lt;/code&gt; 迁移到自定义域名时，SEO 权重传递是关键问题。按照官方文档，最理想的方式是使用 301 永久重定向，让 Google 知道原 URL 已永久迁移到新地址，从而将排名权重传递给新域名。&lt;/p&gt;
&lt;p&gt;本次场景：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;源站：&lt;code&gt;https://dansblog.pages.dev&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;目标：&lt;code&gt;https://danarnoux.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;期望：浏览器和搜索引擎均返回 301 状态码&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;3-问题现象&quot;&gt;3. 问题现象&lt;/h2&gt;
&lt;p&gt;配置重定向后，实际测试发现：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;浏览器访问正常&lt;/strong&gt; - 输入 &lt;code&gt;dansblog.pages.dev/any-path&lt;/code&gt; 会自动跳转到 &lt;code&gt;danarnoux.com/any-path&lt;/code&gt;，跳转过程无感知&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GSC 报错&lt;/strong&gt; - Google Search Console 提示大量 URL 返回非 301 状态码，无法完成迁移验证&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cURL 测试异常&lt;/strong&gt; - 部分工具检测到的状态码与预期不符&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这就很奇怪了：用户访问完全正常，但 Google 就是不认。&lt;/p&gt;
&lt;h2 id=&quot;4-错误方案&quot;&gt;4. 错误方案&lt;/h2&gt;
&lt;h3 id=&quot;41-_redirects-方案&quot;&gt;4.1 _redirects 方案&lt;/h3&gt;
&lt;p&gt;尝试在 &lt;code&gt;public/_redirects&lt;/code&gt; 中配置：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;https://dansblog.pages.dev/* https://danarnoux.com/:splat 301&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;结果&lt;/strong&gt;：浏览器跳转正常，但 GSC 仍无法识别。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;原因分析&lt;/strong&gt;（基于 Cloudflare 官方文档的推论）：&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;411-官方文档引用&quot;&gt;4.1.1 官方文档引用&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Bulk Redirects 文档&lt;/strong&gt;：
&lt;a href=&quot;https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/&quot;&gt;https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Bulk Redirects allow you to define URL redirects at the account level and have them executed at the edge.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Redirect Rules 文档&lt;/strong&gt;：
&lt;a href=&quot;https://developers.cloudflare.com/rules/url-forwarding/&quot;&gt;https://developers.cloudflare.com/rules/url-forwarding/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pages _redirects 文档&lt;/strong&gt;：
&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/redirects/&quot;&gt;https://developers.cloudflare.com/pages/platform/redirects/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“You can define redirects by adding a &lt;code&gt;_redirects&lt;/code&gt; file to your project.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pages 工作原理&lt;/strong&gt;：
&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/how-pages-works/&quot;&gt;https://developers.cloudflare.com/pages/platform/how-pages-works/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Cloudflare Pages serves your site through Cloudflare’s global network.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h4 id=&quot;412-技术解读&quot;&gt;4.1.2 技术解读&lt;/h4&gt;
&lt;p&gt;根据文档，两种重定向机制存在本质区别：&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;机制&lt;/th&gt;&lt;th&gt;处理层级&lt;/th&gt;&lt;th&gt;执行位置&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pages _redirects&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;项目内部（构建时注入）&lt;/td&gt;&lt;td&gt;Pages 平台&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Bulk Redirects&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;账户级别&lt;/td&gt;&lt;td&gt;边缘网络（Edge）&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_redirects&lt;/code&gt; 是项目的一部分，通过 &lt;code&gt;public/_redirects&lt;/code&gt; 文件定义，由 Pages 平台在构建时处理&lt;/li&gt;
&lt;li&gt;Bulk Redirects 是独立的 Rules 系统，在全球边缘节点执行，优先级高于 Pages 层面&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4 id=&quot;413-推论&quot;&gt;4.1.3 推论&lt;/h4&gt;
&lt;p&gt;基于 Cloudflare 官方文档可以确认：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_redirects&lt;/code&gt; 属于 Pages 项目内部的重定向配置&lt;/li&gt;
&lt;li&gt;Bulk Redirects 属于 Rules 系统，在 Cloudflare 边缘网络（Edge）直接执行&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;在此基础上，可以做一个相对保守的推测：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;GSC 在进行网站迁移检测时，可能更容易识别由 Edge 层直接返回的 301 重定向，
而对于 Pages 层内部实现的重定向，不一定能够稳定识别。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;需要说明的是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cloudflare 和 Google 官方均未明确说明 GSC 的判定逻辑&lt;/li&gt;
&lt;li&gt;以上结论仅基于文档结构和实际测试结果&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 实际效果上，Bulk Redirects 可以稳定通过 GSC 迁移验证。&lt;/p&gt;
&lt;h3 id=&quot;42-worker-方案&quot;&gt;4.2 Worker 方案&lt;/h3&gt;
&lt;p&gt;尝试编写 Cloudflare Worker 实现重定向。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;结果&lt;/strong&gt;：可以工作，但存在不稳定性风险——Worker 可能因为超限、配置变更等原因失效。&lt;/p&gt;
&lt;h2 id=&quot;5-正确解决方案bulk-redirects&quot;&gt;5. 正确解决方案：Bulk Redirects&lt;/h2&gt;
&lt;p&gt;最终采用 &lt;strong&gt;Cloudflare Bulk Redirects&lt;/strong&gt;（批量重定向）。&lt;/p&gt;
&lt;p&gt;需要注意：Bulk Redirects 的配置是 &lt;strong&gt;两步结构&lt;/strong&gt;：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先创建 Redirect List（规则数据）&lt;/li&gt;
&lt;li&gt;再创建 Redirect Rule（让规则生效）&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3 id=&quot;51-进入-bulk-redirects&quot;&gt;5.1 进入 Bulk Redirects&lt;/h3&gt;
&lt;p&gt;进入 Cloudflare Dashboard：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;选择你的域名（如 &lt;code&gt;danarnoux.com&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;左侧进入：&lt;strong&gt;Rules → Redirect Rules&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;切换到 &lt;strong&gt;Bulk Redirects&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/cloudflare-pages-gsc-migration-redirect-fix/step1.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;52-创建-bulk-redirect-list先做这一步&quot;&gt;5.2 创建 Bulk Redirect List（先做这一步）&lt;/h3&gt;
&lt;p&gt;点击：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Create Bulk Redirect List&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;填写：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;List 名称：如 &lt;code&gt;pages-dev-redirect&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/cloudflare-pages-gsc-migration-redirect-fix/step2.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;53-在-list-中添加规则&quot;&gt;5.3 在 List 中添加规则&lt;/h3&gt;
&lt;p&gt;添加一条规则：&lt;/p&gt;

































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;字段&lt;/th&gt;&lt;th&gt;值&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Source URL&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://dansblog.pages.dev/*&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Target URL&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://danarnoux.com/$1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Status&lt;/td&gt;&lt;td&gt;301（或先用 302 测试）&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Preserve query string&lt;/td&gt;&lt;td&gt;可选&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Subpath matching&lt;/td&gt;&lt;td&gt;ON&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Preserve path suffix&lt;/td&gt;&lt;td&gt;ON&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;关键点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;*&lt;/code&gt; 用于匹配所有路径&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$1&lt;/code&gt; 用于保留原始路径&lt;/li&gt;
&lt;li&gt;建议先使用 &lt;strong&gt;302&lt;/strong&gt; 测试，确认无误后再改为 &lt;strong&gt;301&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-note&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;note&lt;/p&gt;
&lt;p&gt;在Add URLs，点击 Or,Manually and URL redirects即可，然后记得点击Edit parameters。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;关于选项说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Subpath matching / Preserve path suffix&lt;/strong&gt;：建议开启，否则路径可能无法正确传递&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preserve query string&lt;/strong&gt;：是否开启取决于你的需求（例如是否需要保留 URL 参数），关闭同样可以正常完成迁移&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/cloudflare-pages-gsc-migration-redirect-fix/step3.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/cloudflare-pages-gsc-migration-redirect-fix/step3_2.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;54-创建-bulk-redirect-rule让规则生效&quot;&gt;5.4 创建 Bulk Redirect Rule（让规则生效）&lt;/h3&gt;
&lt;p&gt;回到 Bulk Redirects 页面：&lt;/p&gt;
&lt;p&gt;点击：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Create Bulk Redirect Rule&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;配置：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rule 名称：如 &lt;code&gt;pages.dev redirect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Redirect using list：选择刚刚创建的 List&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/cloudflare-pages-gsc-migration-redirect-fix/step4.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;55-启用规则&quot;&gt;5.5 启用规则&lt;/h3&gt;
&lt;p&gt;保存后，确保：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rule 状态为 ✅ Enabled（绿色）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 注意：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;如果没有创建 Rule，仅有 List 是不会生效的&lt;/p&gt;
&lt;p&gt;生效例图参考step1，注意Status为Active&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;56-等待生效&quot;&gt;5.6 等待生效&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;点击 Save / Deploy&lt;/li&gt;
&lt;li&gt;通常 1~2 分钟内生效&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;57-小结&quot;&gt;5.7 小结&lt;/h3&gt;
&lt;p&gt;Bulk Redirects 的正确流程是：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;List（定义规则） → Rule（启用规则） → Edge 执行&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;58-关键区别&quot;&gt;5.8 关键区别&lt;/h3&gt;
&lt;p&gt;Bulk Redirects 与 _redirects 的本质区别：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bulk Redirects 在 Cloudflare 网络边缘（Edge）直接处理，不经过 Pages 层面&lt;/li&gt;
&lt;li&gt;优先级更高，规则更稳定&lt;/li&gt;
&lt;li&gt;状态码返回更可靠&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;6-验证方式&quot;&gt;6. 验证方式&lt;/h2&gt;
&lt;p&gt;配置完成后，通过以下方式验证：&lt;/p&gt;
&lt;h3 id=&quot;61-浏览器测试&quot;&gt;6.1 浏览器测试&lt;/h3&gt;
&lt;p&gt;直接访问原 URL，确认跳转正常。&lt;/p&gt;
&lt;h3 id=&quot;62-curl-测试&quot;&gt;6.2 cURL 测试&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -I&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://dansblog.pages.dev/blog/test&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 应返回 301 + Location: https://danarnoux.com/blog/test&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;63-gsc-验证&quot;&gt;6.3 GSC 验证&lt;/h3&gt;
&lt;p&gt;在 Google Search Console 中重新验证迁移，成功后应该会出现一个提示 &lt;strong&gt;此网站目前正在迁移到 &lt;a href=&quot;https://search.google.com/search-console?resource_id=sc-domain%3Adanarnoux.com&quot;&gt;danarnoux.com&lt;/a&gt;&lt;/strong&gt;。&lt;/p&gt;
&lt;h2 id=&quot;7-总结&quot;&gt;7. 总结&lt;/h2&gt;
&lt;p&gt;网站从 &lt;code&gt;*.pages.dev&lt;/code&gt; 迁移到自定义域名时，_redirects 方法在浏览器端工作正常，但 GSC 可能无法识别。根据官方文档，&lt;strong&gt;Bulk Redirects 在 Edge 层执行&lt;/strong&gt;，状态码返回更稳定可靠，建议直接使用。&lt;/p&gt;
&lt;p&gt;至于为什么 _redirects 不被 GSC 识别，官方文档没有明确说明 GSC 的具体判定逻辑，以上仅为基于文档结构的推测，无法给出绝对结论。如果追求稳定性，Bulk Redirects 是更稳妥的选择。&lt;/p&gt;
&lt;p&gt;Codemzy的博客原文网址：&lt;strong&gt;&lt;a href=&quot;https://www.codemzy.com/blog/cloudflare-pages-dev-redirect&quot;&gt;https://www.codemzy.com/blog/cloudflare-pages-dev-redirect&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</content:encoded><category>Cloudflare</category><category>SEO</category><category>GSC</category><category>guide</category><category>CN</category></item><item><title>OpenClaw Windows 卸载教程</title><link>https://danarnoux.com/blog/openclaw-windows-uninstall-guide-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/openclaw-windows-uninstall-guide-cn/</guid><description>简单几步教你如何在 Windows 上完全卸载 OpenClaw，包括删除配置目录和验证卸载成功。</description><pubDate>Mon, 16 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;如果你不再需要 OpenClaw，可以按照以下步骤将其彻底卸载。虽然很好笑，因为我前几天刚出过部署的教程。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-卸载-openclaw&quot;&gt;1. 卸载 OpenClaw&lt;/h2&gt;
&lt;p&gt;OpenClaw 通过 npm 全局安装，卸载非常简单。打开 PowerShell，运行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm uninstall &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-删除配置文件&quot;&gt;2. 删除配置文件&lt;/h2&gt;
&lt;p&gt;OpenClaw 会在用户目录下创建配置文件，可以手动删除。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;：打开 CMD 或 PowerShell，运行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;rmdir /s /q &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;USERPROFILE&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;\.openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Linux / macOS&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -rf&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; ~/.openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-验证卸载成功&quot;&gt;3. 验证卸载成功&lt;/h2&gt;
&lt;p&gt;运行以下命令：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果提示 &lt;code&gt;command not found&lt;/code&gt; 或找不到命令，说明卸载成功。&lt;/p&gt;</content:encoded><category>OpenClaw</category><category>Uninstall</category><category>Tutorial</category></item><item><title>OpenClaw Windows Uninstall Guide</title><link>https://danarnoux.com/blog/openclaw-windows-uninstall-guide-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/openclaw-windows-uninstall-guide-en/</guid><description>A simple guide on how to completely uninstall OpenClaw on Windows, including removing config directories and verifying the uninstallation.</description><pubDate>Mon, 16 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;If you no longer need OpenClaw, you can follow these steps to completely uninstall it. It’s kind of funny—I just made a deployment guide a few days ago!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-uninstall-openclaw&quot;&gt;1. Uninstall OpenClaw&lt;/h2&gt;
&lt;p&gt;OpenClaw is installed globally via npm, so uninstalling is simple. Open PowerShell and run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm uninstall &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-delete-configuration-files&quot;&gt;2. Delete Configuration Files&lt;/h2&gt;
&lt;p&gt;OpenClaw creates a config directory in your user folder. You can delete it manually.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Open CMD or PowerShell and run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;rmdir /s /q &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;USERPROFILE&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;\.openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Linux / macOS&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -rf&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; ~/.openclaw&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-verify-uninstallation&quot;&gt;3. Verify Uninstallation&lt;/h2&gt;
&lt;p&gt;Run the following command:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you see &lt;code&gt;command not found&lt;/code&gt; or an error saying the command doesn’t exist, the uninstallation was successful.&lt;/p&gt;</content:encoded><category>OpenClaw</category><category>Uninstall</category><category>Tutorial</category></item><item><title>OpenClaw Windows 安装与配置教程（MiniMax / Qwen / Ollama）</title><link>https://danarnoux.com/blog/openclaw-windows-setup-guide-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/openclaw-windows-setup-guide-cn/</guid><description>详细介绍如何在 Windows 上安装和配置 OpenClaw，并接入 MiniMax、Qwen 等云端大模型，或通过 Ollama 运行本地模型。</description><pubDate>Tue, 10 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;我一直都在思考我到底要不要做一个Openclaw的部署教程，因为Openclaw中文站的内容已经很详细了，但是我意识到大家可能并不知道有这个中文站的存在另外就是跟着这个教程做还是看不懂。最近Openclaw真是在国内的热度简直过热，有点过誉了，一代人有一代人的气功热。但是我还是坚持做一个比较详细的教程你自己部署体验一下，因为一个产品到底怎么样，你自己用体验后才知道、说实话有个自己的贾维斯这种概念还是很吸引人的。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-什么是-openclaw&quot;&gt;1. 什么是 OpenClaw？&lt;/h2&gt;
&lt;p&gt;先简单介绍一下，&lt;strong&gt;OpenClaw&lt;/strong&gt;（以前叫 Clawdbot，现在改名前还挺有意思的）是一个开源的 AI Agent 框架。简单来说，你可以把它理解成一个「AI 操作系统」—— 它本身不提供 AI 能力，但它能帮你调用各种大模型，帮你完成各种任务。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step2.webp&quot; alt=&quot;Openclaw官网&quot;&gt;&lt;/p&gt;
&lt;p&gt;和普通的聊天机器人不一样，OpenClaw 能做的事情更多：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;操作文件系统&lt;/li&gt;
&lt;li&gt;执行命令。&lt;/li&gt;
&lt;li&gt;编写和调试代码&lt;/li&gt;
&lt;li&gt;搜索信息&lt;/li&gt;
&lt;li&gt;接入飞书、Telegram 等通讯工具&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;你只需要给它配上合适的模型，它就能帮你干活。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-openclaw-工作原理&quot;&gt;2. OpenClaw 工作原理&lt;/h2&gt;
&lt;p&gt;先理清一个概念：&lt;strong&gt;OpenClaw 只是一个「壳」，模型得你自己接入&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;工作流程大概是这样的：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;你（输入） → OpenClaw → AI 模型 → 返回结果&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你可以选择接入：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;云端模型&lt;/strong&gt;：MiniMax、Qwen（阿里云百炼）、OpenAI、Claude 等&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;本地模型&lt;/strong&gt;：通过 Ollama 在本地运行的模型&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;两种方案各有优劣，后面会详细说。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：本文档包含专门章节讲解如何配置 Ollama 本地模型，请参见第 5.8 节。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-部署方式与模型方案&quot;&gt;3. 部署方式与模型方案&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;官方文档&lt;/strong&gt;：如果想了解更多高级配置，可以参考 &lt;a href=&quot;https://docs.openclaw.ai/zh-CN&quot;&gt;OpenClaw 中文文档&lt;/a&gt;。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;在开始安装之前，先了解两种部署方式和模型方案的选择。&lt;/p&gt;
&lt;h3 id=&quot;31-部署方式说明&quot;&gt;3.1 部署方式说明&lt;/h3&gt;
&lt;p&gt;OpenClaw 有两种部署方式：&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;部署方式&lt;/th&gt;&lt;th&gt;说明&lt;/th&gt;&lt;th&gt;适用场景&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;本地部署&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;在自己的 Windows 电脑上运行&lt;/td&gt;&lt;td&gt;个人使用、隐私优先、低成本&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;远程服务器&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;在云服务器上运行（如 Linux 服务器）&lt;/td&gt;&lt;td&gt;多用户共享、7×24 小时运行&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;本教程聚焦本地部署&lt;/strong&gt;——在你自己 的 Windows 电脑上运行 OpenClaw。因为存在一个问题，虽然远程服务器部署很方便，厂商都帮你一件配置好了，但是你可能其实想要的是私人电脑管家贾维斯，虽然这会有更多的风险，但你自己会权衡承担的。&lt;/p&gt;
&lt;h3 id=&quot;32-选哪种模型方案&quot;&gt;3.2 选哪种模型方案？&lt;/h3&gt;
&lt;p&gt;在开始安装之前，先决定你要用哪种模型方案。这会影响后面的配置步骤。&lt;/p&gt;
&lt;h3 id=&quot;云端-api推荐新手&quot;&gt;云端 API（推荐新手）&lt;/h3&gt;
&lt;p&gt;调用云端模型的 API，按调用量付费（一般都有免费额度）。&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;模型商&lt;/th&gt;&lt;th&gt;推荐模型&lt;/th&gt;&lt;th&gt;特点&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;MiniMax&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;M2.5&lt;/td&gt;&lt;td&gt;性价比高，中文优化好&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Qwen&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;qwen/qwen3-coder / qwen/qwen3-vl&lt;/td&gt;&lt;td&gt;编程能力强，阿里云免费额度够用&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;qwen3-coder 是阿里推出的编程优化模型。
| &lt;strong&gt;OpenAI&lt;/strong&gt; | GPT-5 系列模型 | 综合能力强 |&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;优点&lt;/strong&gt;：不需要显卡，响应快，能力有保障
&lt;strong&gt;缺点&lt;/strong&gt;：需要付费（但通常有免费额度）&lt;/p&gt;
&lt;h3 id=&quot;本地模型ollama&quot;&gt;本地模型（Ollama）&lt;/h3&gt;
&lt;p&gt;在自己电脑上运行模型，完全免费，但需要硬件配置。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;优点&lt;/strong&gt;：零成本，隐私好
&lt;strong&gt;缺点&lt;/strong&gt;：对显卡有要求，响应速度取决于硬件&lt;/p&gt;
&lt;p&gt;说实话大部分情况你的电脑是运行不了的，你可以查看一下你电脑的GPU是什么配置，我给实验室的工作站都没有选择Ollama方案，首先的问题就是你不能因为显存够能跑而忽略速度，其次是你想我这配置已经相当的强大了，但我也没选择Ollama方案。选择API方案蛮好的，就是花点钱。&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step1.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;我的建议&lt;/strong&gt;：新手直接用远程 API，MiniMax 或 Qwen 都不错，配好了 5 分钟就能用上。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;33-如何选择合适的大模型&quot;&gt;3.3 如何选择合适的大模型？&lt;/h3&gt;
&lt;p&gt;选择大模型主要看以下几个因素：&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;因素&lt;/th&gt;&lt;th&gt;说明&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;价格&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;云端 API 按调用量付费，不同模型价格差异大&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;速度&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;响应速度取决于模型大小和网络&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;上下文长度&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;能处理多长的文本，越长越贵&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;编程能力&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;某些模型专门针对编程优化&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;推理能力&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;复杂问题的解决能力&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;使用-openrouter-排行榜&quot;&gt;使用 OpenRouter 排行榜&lt;/h4&gt;
&lt;p&gt;OpenRouter 提供了便捷的 &lt;a href=&quot;https://openrouter.ai/rankings&quot;&gt;模型排行榜&lt;/a&gt;，你可以根据以下维度筛选：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;性能（Performance）&lt;/strong&gt;：模型的综合 benchmark 分数&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;价格（Price）&lt;/strong&gt;：按输入/输出价格排序&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;上下文长度（Context Length）&lt;/strong&gt;：支持的最大 token 数&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;延迟（Latency）&lt;/strong&gt;：响应速度&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step3.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在 OpenRouter 网站上搜索具体模型，可以查看：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Benchmarks&lt;/strong&gt;：各项能力评分&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pricing&lt;/strong&gt;：输入和输出价格&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Context Length&lt;/strong&gt;：支持的上下文长度&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step4.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意&lt;/strong&gt;：不同排行榜的评估方式可能不同。例如，一些排行榜更强调编程 benchmark，而忽略了多模态能力或长上下文能力。因此排名只能作为参考。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;以及存在一个问题，你不能因为模型能力而忽视了价格，到时候看看账单人傻了&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step5.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;综合表现优秀的模型推荐&lt;/strong&gt;：&lt;/p&gt;

































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;模型&lt;/th&gt;&lt;th&gt;特点&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;GPT-5系列&lt;/td&gt;&lt;td&gt;综合能力强，适合各种场景&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude 4 Sonnet系列&lt;/td&gt;&lt;td&gt;长上下文能力强，适合处理长文本&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;qwen/qwen3-coder&lt;/td&gt;&lt;td&gt;编程能力强，免费额度充足&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek V3 / V3.2&lt;/td&gt;&lt;td&gt;综合能力强，性价比好&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gemini 3 Flash系列&lt;/td&gt;&lt;td&gt;速度快，价格便宜&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gemini 系列&lt;/td&gt;&lt;td&gt;综合能力强，多模态任务表现优秀&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;编程模型推荐&quot;&gt;编程模型推荐&lt;/h4&gt;
&lt;p&gt;如果你主要用 OpenClaw 来&lt;strong&gt;辅助编程&lt;/strong&gt;，以下是各模型的表现：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;能力最强的编程模型&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude Opus&lt;/strong&gt;（包括 Claude 4 Opus系列）在编程任务中通常表现非常优秀&lt;/li&gt;
&lt;li&gt;但有以下限制：
&lt;ul&gt;
&lt;li&gt;价格较高&lt;/li&gt;
&lt;li&gt;国内访问可能不稳定&lt;/li&gt;
&lt;li&gt;中文优化不如国内模型&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;如果你感兴趣，可以查看 &lt;a href=&quot;https://docs.openclaw.ai/zh-CN/providers/anthropic&quot;&gt;OpenClaw 官方 Anthropic 配置文档&lt;/a&gt;。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;对国内用户更实用的选择&lt;/strong&gt;：&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;模型&lt;/th&gt;&lt;th&gt;特点&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;MiniMax M2.5&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;中文理解好，性价比高&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;qwen/qwen3-coder&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;阿里云编程专用模型，免费额度充足&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;DeepSeek V3 / V3.2&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;综合能力强，性价比好&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;DeepSeek V3 / V3.2 是目前 DeepSeek 系列的主力模型，综合能力优秀。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;总结&lt;/strong&gt;：如果你的网络条件允许且预算充足，Claude Opus 是最强的选择。否则，MiniMax M2.5、qwen/qwen3-coder 或 DeepSeek V3/V3.2 是更实用的方案。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Google Gemini 系列&lt;/strong&gt;在综合能力和多模态任务方面也非常强。例如 Gemini 生态中的 &lt;strong&gt;Nano Banana&lt;/strong&gt; 图像模型，在图形生成和视觉内容创作领域表现非常优秀。如果你的需求涉及图像生成或多模态理解，可以考虑 Gemini 系列。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：新手推荐从 MiniMax 或 Qwen 开始，配好 5 分钟就能用上。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;4-windows-安装步骤&quot;&gt;4. Windows 安装步骤&lt;/h2&gt;
&lt;h3 id=&quot;新手快速安装推荐&quot;&gt;新手快速安装（推荐）&lt;/h3&gt;
&lt;p&gt;如果你只是想&lt;strong&gt;快速体验 OpenClaw&lt;/strong&gt;，可以直接使用官方提供的快速安装方式。两步就能搞定！&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;步骤 1：安装 OpenClaw&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;步骤 2：运行新手引导&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;install-daemon&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个命令会自动完成以下操作：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;初始化 OpenClaw 配置&lt;/li&gt;
&lt;li&gt;安装 Gateway 服务&lt;/li&gt;
&lt;li&gt;创建默认配置文件&lt;/li&gt;
&lt;li&gt;启动 OpenClaw 服务&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;是的，你没看错，只需要这两条命令，就可以完成基础安装！&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;安装完成后，你可以：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;运行交互式对话&lt;/strong&gt;：&lt;code&gt;openclaw&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;打开 Web 界面&lt;/strong&gt;：&lt;code&gt;openclaw dashboard&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;配置模型&lt;/strong&gt;：按第 5 章的说明，给 OpenClaw 配上你喜欢的模型&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;官方文档&lt;/strong&gt;：如果你想了解更多详细内容，可以参考 &lt;a href=&quot;https://docs.openclaw.ai/zh-CN&quot;&gt;OpenClaw 官方中文文档&lt;/a&gt;，特别是其中的 &lt;strong&gt;快速开始（Quick Start）&lt;/strong&gt; 部分。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;如果你想了解 OpenClaw 的完整安装过程和每一步的作用&lt;/strong&gt;，可以继续阅读下面的进阶安装教程。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;下面正式开始安装，按顺序来就行。&lt;/p&gt;
&lt;h3 id=&quot;41-准备环境&quot;&gt;4.1 准备环境&lt;/h3&gt;
&lt;p&gt;你需要先装好 &lt;strong&gt;Node.js&lt;/strong&gt;（推荐 LTS 版本，22 及以上）。&lt;/p&gt;
&lt;h4 id=&quot;安装-nodejs&quot;&gt;安装 Node.js&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;方法一：直接安装&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://nodejs.org/zh-cn/download&quot;&gt;Node.js 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;下载 Windows Installer (.msi)&lt;/li&gt;
&lt;li&gt;一路 Next 就行&lt;/li&gt;
&lt;li&gt;如果出现了网络问题之类的，参考我的另一篇文章的教程内容 &lt;a href=&quot;https://danarnoux.com/blog/how-to-build-a-personal-blog-cn/#%E5%AE%89%E8%A3%85&quot;&gt;node.js的详细安装步骤&lt;/a&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;方法二：nvm（推荐，方便管理多版本）&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 安装 nvm for Windows&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 访问 https://github.com/coreybutler/nvm-windows/releases 下载&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 安装后，在 PowerShell 中运行：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;nvm install &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;22&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;nvm use &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;22&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;验证一下：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;node &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 应该显示 v22.x.x&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 应该显示 8.x.x&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;切换-npm-镜像国内用户建议&quot;&gt;切换 npm 镜像（国内用户建议）&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm config set registry https:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;registry.npmmirror.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;安装-git可选但建议&quot;&gt;安装 Git（可选但建议）&lt;/h4&gt;
&lt;p&gt;有些技能依赖 Git，建议安装一个：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://git-scm.com/download/win&quot;&gt;Git 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;如果有配置问题，可以参考我这篇文章的内容 &lt;a href=&quot;https://danarnoux.com/blog/how-to-get-started-with-programming-cn/#42-git-%E5%AE%89%E8%A3%85%E4%B8%8E%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AEwindows-%E4%B8%BB%E7%BA%BF--mac-%E6%94%AF%E7%BA%BF&quot;&gt;Git配置&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;下载安装，一路 Next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;42-修改执行策略&quot;&gt;4.2 修改执行策略&lt;/h3&gt;
&lt;p&gt;Windows 默认不让跑脚本，得先改一下设置。以&lt;strong&gt;管理员身份&lt;/strong&gt;打开 PowerShell，运行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ExecutionPolicy RemoteSigned &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Scope CurrentUser&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;输入 &lt;code&gt;Y&lt;/code&gt; 确认。&lt;/p&gt;
&lt;h3 id=&quot;43-运行安装脚本&quot;&gt;4.3 运行安装脚本&lt;/h3&gt;
&lt;p&gt;现在可以装 OpenClaw 了。在 PowerShell 中执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;iwr &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;useb https:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw.ai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;install.ps1 &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; iex&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;等一会儿，脚本会自动：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;检测 Node.js 环境&lt;/li&gt;
&lt;li&gt;下载安装 OpenClaw&lt;/li&gt;
&lt;li&gt;配置路径&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;出现 &lt;strong&gt;「OpenClaw installed successfully」&lt;/strong&gt; 就说明装好了。&lt;/p&gt;
&lt;h3 id=&quot;44-初始化向导&quot;&gt;4.4 初始化向导&lt;/h3&gt;
&lt;p&gt;第一次运行会进入向导：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;流程大概是这样的：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;风险提示 → 输入 &lt;code&gt;yes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;配置模式 → 选择 &lt;code&gt;QuickStart&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;模型选择 → 先跳过，后面手动配&lt;/li&gt;
&lt;li&gt;渠道选择 → 先跳过&lt;/li&gt;
&lt;li&gt;技能包 → 选择 &lt;code&gt;No&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;45-验证安装&quot;&gt;4.5 验证安装&lt;/h3&gt;
&lt;p&gt;装好了可以验证一下：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 查看版本&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 检查状态&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw status&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 体检&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw doctor&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 打开 Web 面板&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw dashboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;openclaw dashboard&lt;/code&gt; 会启动一个本地网页，默认 &lt;code&gt;http://localhost:8080&lt;/code&gt;，可以在浏览器里可视化配置。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;5-配置-ai-模型&quot;&gt;5. 配置 AI 模型&lt;/h2&gt;
&lt;p&gt;装好了不代表能用，你得给它接个模型。下面分别说几种主流方案。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;官方文档&lt;/strong&gt;：如果你想了解更多配置细节，可以参考 &lt;a href=&quot;https://docs.openclaw.ai/zh-CN&quot;&gt;OpenClaw 官方中文文档&lt;/a&gt;，里面有更详细的 provider 配置指南和故障排查说明。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;51-配置前必看api-概念解释&quot;&gt;5.1 配置前必看：API 概念解释&lt;/h3&gt;
&lt;p&gt;在配置模型之前，先解释几个关键概念：&lt;/p&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;概念&lt;/th&gt;&lt;th&gt;说明&lt;/th&gt;&lt;th&gt;示例&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Provider（服务商）&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;提供 AI 模型服务的公司或平台&lt;/td&gt;&lt;td&gt;MiniMax、阿里云、OpenRouter&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;API 服务器的地址&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://api.minimaxi.com/v1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;访问 API 的密钥，相当于”密码”&lt;/td&gt;&lt;td&gt;&lt;code&gt;sk-xxxxxx&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Model ID&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;具体模型的名字&lt;/td&gt;&lt;td&gt;&lt;code&gt;MiniMax-M2.5&lt;/code&gt;、&lt;code&gt;qwen-plus&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Config JSON&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;配置信息的 JSON 格式&lt;/td&gt;&lt;td&gt;包含上述字段的结构化配置&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;为什么要配置这些？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;OpenClaw 需要知道：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;去哪里找模型（Base URL）&lt;/li&gt;
&lt;li&gt;用什么凭证访问（API Key）&lt;/li&gt;
&lt;li&gt;使用哪个具体模型（Model ID）&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;推荐使用-cc-switch-管理多个-provider&quot;&gt;推荐：使用 cc-switch 管理多个 Provider&lt;/h4&gt;
&lt;p&gt;如果你计划配置多个模型服务商，推荐使用 &lt;strong&gt;cc-switch&lt;/strong&gt; 来管理：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;多 Provider 管理&lt;/strong&gt;：一个界面管理所有 API 配置&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;一键切换&lt;/strong&gt;：随时切换不同模型，无需手动改配置&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;环境变量自动配置&lt;/strong&gt;：OpenClaw 会自动读取 cc-switch 设置的环境变量&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：cc-switch 的详细介绍见第 6 章。如果你不想手动配置，可以先跳过本章的 provider 配置，直接阅读 cc-switch 部分。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;配置方式总览&quot;&gt;配置方式总览&lt;/h4&gt;
&lt;p&gt;配置模型有三种方式：&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;方式&lt;/th&gt;&lt;th&gt;难度&lt;/th&gt;&lt;th&gt;适用人群&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;方法一：CLI 命令&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;熟悉命令行的用户&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;方法二：修改配置文件&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;较难&lt;/td&gt;&lt;td&gt;需要批量配置的用户&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;方法三：Web 页面配置（推荐）&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;简单&lt;/td&gt;&lt;td&gt;新手用户&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;如果你不熟悉命令行，&lt;strong&gt;推荐使用 Web 页面配置&lt;/strong&gt;（方法三），可视化界面更容易上手。内容在5.8下面可以细节查阅。&lt;/p&gt;
&lt;h3 id=&quot;52-配置-minimax&quot;&gt;5.2 配置 MiniMax&lt;/h3&gt;
&lt;p&gt;MiniMax 的 M2.5 挺好用的，性价比高。&lt;/p&gt;
&lt;h4 id=&quot;获取-api-key&quot;&gt;获取 API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://platform.minimaxi.com/&quot;&gt;MiniMax 开放平台&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;注册账号 → 实名认证&lt;/li&gt;
&lt;li&gt;进入「API Keys」→ 创建 Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;复制保存&lt;/strong&gt;，只看一次&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;配置命令&quot;&gt;配置命令&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 配置 MiniMax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5-highspeed&quot;, &quot;name&quot;: &quot;MiniMax M2.5 高速版&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认模型&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;更安全的做法环境变量&quot;&gt;更安全的做法：环境变量&lt;/h4&gt;
&lt;p&gt;把 Key 存环境变量里，避免写在配置里：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 临时设置（当前终端有效）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$env.MINIMAX_API_KEY &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;你的Key&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 或者永久设置&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;System.Environment&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]::SetEnvironmentVariable(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MINIMAX_API_KEY&quot;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;你的Key&quot;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;User&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;配置时用 &lt;code&gt;$MINIMAX_API_KEY&lt;/code&gt; 代替实际 Key。&lt;/p&gt;
&lt;h4 id=&quot;minimax-coding-plan推荐编程用户&quot;&gt;MiniMax Coding Plan（推荐编程用户）&lt;/h4&gt;
&lt;p&gt;如果你主要用于编程，MiniMax 提供了专门的 &lt;strong&gt;Coding Plan&lt;/strong&gt;，性价比更高。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;获取 API Key 并开通 Coding Plan&lt;/strong&gt;：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://platform.minimaxi.com/&quot;&gt;MiniMax 开放平台&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;注册账号 → 实名认证&lt;/li&gt;
&lt;li&gt;进入「API Keys」→ 创建 Key&lt;/li&gt;
&lt;li&gt;进入「Coding Plan」页面，开通 Coding Plan&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;复制保存&lt;/strong&gt; API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;配置命令&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 配置 MiniMax Coding Plan&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5-highspeed&quot;, &quot;name&quot;: &quot;MiniMax M2.5 高速版&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认模型&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：Coding Plan 通常有更低的调用价格，适合高频使用的用户。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;53-配置阿里云-model-studio&quot;&gt;5.3 配置阿里云 Model Studio&lt;/h3&gt;
&lt;p&gt;阿里云 Model Studio 是阿里云提供的大模型服务平台，通过它可以使用 Qwen 等模型。除了标准版，还有专门的 &lt;strong&gt;Coding Plan&lt;/strong&gt; 适合编程用户。&lt;/p&gt;
&lt;h4 id=&quot;获取-api-key-1&quot;&gt;获取 API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://modelscope.cn/&quot;&gt;阿里云 Model Studio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;注册账号 → 实名认证&lt;/li&gt;
&lt;li&gt;进入「API Keys」→ 创建 Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;复制保存&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;开通-coding-plan推荐编程用户&quot;&gt;开通 Coding Plan（推荐编程用户）&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://bailian.aliyun.com/&quot;&gt;阿里云百炼&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;进入「Coding Plan」页面&lt;/li&gt;
&lt;li&gt;开通 Coding Plan&lt;/li&gt;
&lt;li&gt;获取专门的 Coding Plan API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;配置命令-1&quot;&gt;配置命令&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;标准版&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 配置阿里云 Model Studio&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.qwen&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://dashscope.aliyuncs.com/compatible-mode/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的阿里云API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen/qwen3-coder&quot;, &quot;name&quot;: &quot;Qwen Coder Model&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-portal/vision-model&quot;, &quot;name&quot;: &quot;Qwen Vision Model&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-plus&quot;, &quot;name&quot;: &quot;Qwen Plus&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-max&quot;, &quot;name&quot;: &quot;Qwen Max&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen3&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Coding Plan 版&lt;/strong&gt;（如果用的是阿里云 Coding Plan）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.qwen&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://coding.dashscope.aliyuncs.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的Coding_Plan_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen3-max-2026-01-23&quot;, &quot;name&quot;: &quot;Qwen3 Max&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：Coding Plan 通常有更低的调用价格或免费额度，适合高频编程的用户。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;54-配置-openrouter&quot;&gt;5.4 配置 OpenRouter&lt;/h3&gt;
&lt;p&gt;OpenRouter 是一个聚合了上百种 AI 模型的平台，通过它可以用一个 API Key 访问 GPT、Claude、DeepSeek 等多种模型。&lt;/p&gt;
&lt;h4 id=&quot;获取-api-key-2&quot;&gt;获取 API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://openrouter.ai/&quot;&gt;OpenRouter 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;注册账号&lt;/li&gt;
&lt;li&gt;进入「API Keys」→ 创建 Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;复制保存&lt;/strong&gt;，只看一次&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;配置命令-2&quot;&gt;配置命令&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.openrouter&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://openrouter.ai/api/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的OpenRouter_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;openai/gpt-5&quot;, &quot;name&quot;: &quot;GPT-5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;anthropic/claude-4-sonnet&quot;, &quot;name&quot;: &quot;Claude 4 Sonnet&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;deepseek/deepseek-v3&quot;, &quot;name&quot;: &quot;DeepSeek V3&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;google/gemini-3-flash&quot;, &quot;name&quot;: &quot;Gemini 3 Flash&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set openrouter&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gpt&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意&lt;/strong&gt;：OpenRouter 上的模型 ID 格式和直接调用时不太一样，格式是 &lt;code&gt;提供商/模型名&lt;/code&gt;，如 &lt;code&gt;openai/gpt-5&lt;/code&gt;、&lt;code&gt;anthropic/claude-4-sonnet&lt;/code&gt;。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;参考&lt;/strong&gt;：你可以访问 &lt;a href=&quot;https://openrouter.ai/rankings&quot;&gt;OpenRouter 排行榜&lt;/a&gt; 查看各模型的评分和价格排名，作为选择参考。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;55-配置-siliconflow&quot;&gt;5.5 配置 SiliconFlow&lt;/h3&gt;
&lt;p&gt;SiliconFlow（硅基流动）是国内的一个 AI 模型聚合平台，提供多种模型接口，对国内用户比较友好。&lt;/p&gt;
&lt;h4 id=&quot;特点&quot;&gt;特点&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;国内访问速度快&lt;/strong&gt;：服务器在国内，延迟低&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;模型种类多&lt;/strong&gt;：支持 Qwen、DeepSeek、Llama 等多种模型&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;价格实惠&lt;/strong&gt;：按量计费，有免费额度&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;配置参考&quot;&gt;配置参考&lt;/h4&gt;
&lt;p&gt;详细配置教程请参考官方文档：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-OpenClaw&quot;&gt;SiliconFlow 官方配置指南&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;基本步骤：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://www.siliconflow.cn/&quot;&gt;SiliconFlow 官网&lt;/a&gt; 注册账号&lt;/li&gt;
&lt;li&gt;获取 API Key&lt;/li&gt;
&lt;li&gt;参考官方文档配置 provider&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;56-配置-openai&quot;&gt;5.6 配置 OpenAI&lt;/h3&gt;
&lt;p&gt;如果你有 OpenAI 的 API Key，可以直接配置。&lt;/p&gt;
&lt;h4 id=&quot;获取-api-key-3&quot;&gt;获取 API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://platform.openai.com/&quot;&gt;OpenAI 平台&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;进入「API Keys」→ 创建 Key&lt;/li&gt;
&lt;li&gt;复制保存&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意&lt;/strong&gt;：国内用户可能需要科学上网才能访问 OpenAI。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;配置命令-3&quot;&gt;配置命令&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.openai&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的OpenAI_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-5&quot;, &quot;name&quot;: &quot;OpenAI GPT-5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-4o&quot;, &quot;name&quot;: &quot;GPT-4o&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-4o-mini&quot;, &quot;name&quot;: &quot;GPT-4o Mini&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set openai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gpt&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;57-配置-qwen-oauth推荐&quot;&gt;5.7 配置 Qwen OAuth（推荐）&lt;/h3&gt;
&lt;p&gt;Qwen OAuth 是最推荐的配置方式，因为它有&lt;strong&gt;免费额度&lt;/strong&gt;，而且不需要手动获取 API Key，直接用阿里云账号授权就行。&lt;/p&gt;
&lt;h4 id=&quot;配置步骤&quot;&gt;配置步骤&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;运行配置向导：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;选择模型服务商时，选择 &lt;strong&gt;Qwen&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;选择 &lt;strong&gt;Qwen OAuth&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;会弹出一个浏览器窗口，让你用阿里云账号登录授权&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;授权成功后，选择想用的模型：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;qwen/qwen3-coder&lt;/code&gt;：编程专用&lt;/li&gt;
&lt;li&gt;&lt;code&gt;qwen-portal/vision-model&lt;/code&gt;：视觉理解&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;手动配置如果向导失败&quot;&gt;手动配置（如果向导失败）&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 运行 OAuth 授权&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set oauth qwen&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这会打开浏览器让你完成授权流程。授权完成后，配置会自动保存。&lt;/p&gt;
&lt;h3 id=&quot;58-配置-ollama-本地模型&quot;&gt;5.8 配置 Ollama 本地模型&lt;/h3&gt;
&lt;p&gt;如果你有显卡，想在本地跑模型（零 API 费用），可以使用 Ollama。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;重要概念&lt;/strong&gt;：Ollama 负责在本地运行模型，而 OpenClaw 需要通过 &lt;strong&gt;Gateway&lt;/strong&gt; 来连接 Ollama。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;581-安装-ollama&quot;&gt;5.8.1 安装 Ollama&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://ollama.com/&quot;&gt;Ollama 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;下载 Windows 版本&lt;/li&gt;
&lt;li&gt;运行安装包，自动启动&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;如果访问 Ollama 官网异常&lt;/strong&gt;，可以尝试以下国内镜像源：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.newbe.pro/Mirrors/Mirrors-ollama&quot;&gt;https://www.newbe.pro/Mirrors/Mirrors-ollama&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ollama.ruanmao.net/&quot;&gt;https://ollama.ruanmao.net/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ollama 默认监听 &lt;code&gt;http://localhost:11434&lt;/code&gt;。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;中国用户推荐&lt;/strong&gt;：如果你在中国大陆使用，下载模型时可能会遇到速度慢或连接不稳定的问题。建议配置国内镜像源（见下文），可以大幅提升下载速度。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5 id=&quot;配置国内镜像源可选中国用户推荐&quot;&gt;配置国内镜像源（可选，中国用户推荐）&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;国内镜像源列表&lt;/strong&gt;：&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;镜像站&lt;/th&gt;&lt;th&gt;地址&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;魔搭社区&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.modelscope.cn&quot;&gt;https://ollama.modelscope.cn&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.deepseek.com&quot;&gt;https://ollama.deepseek.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;浙江大学&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.zju.edu.cn&quot;&gt;https://ollama.zju.edu.cn&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;国内整理站&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://www.newbe.pro/Mirrors/Mirrors-ollama&quot;&gt;https://www.newbe.pro/Mirrors/Mirrors-ollama&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;配置方法（Windows）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;# 临时生效&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;OLLAMA_HOST&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;# 永久生效&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;setx OLLAMA_HOST https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Linux / macOS：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; OLLAMA_HOST&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;配置完成后，可以使用 &lt;code&gt;ollama pull qwen3&lt;/code&gt; 等命令下载模型。如果下载成功，说明镜像源已生效。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;小提示&lt;/strong&gt;：如果某个镜像下载失败，可以尝试更换其他镜像源。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;582-下载模型&quot;&gt;5.8.2 下载模型&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;显存说明&lt;/strong&gt;：模型越大，需要的显存越多。3B 模型约需 4-6GB 显存，8B 模型约需 8-12GB 显存。根据你的显卡选择合适的模型。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;根据你的电脑配置选择&lt;/strong&gt;：&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;电脑配置&lt;/th&gt;&lt;th&gt;推荐模型&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;入门级（无独显或显存 &amp;#x3C; 4GB）&lt;/td&gt;&lt;td&gt;phi3:mini、qwen2.5:1.8b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;主流配置（4-6GB 显存）&lt;/td&gt;&lt;td&gt;qwen2.5:3b、qwen2.5-coder:3b、qwen3:4b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;中高端配置（8GB+ 显存）&lt;/td&gt;&lt;td&gt;qwen3:8b、qwen3:14b&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：如果 Ollama 尚未支持 Qwen3，Qwen2.5 仍然是很好的替代选择。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 查看有哪些模型&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 入门级模型（CPU 也能跑）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull phi3:mini&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 主流配置 - 对话模型（推荐）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:3b&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 主流配置 - 编程模型&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder:3b&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 中高端配置 - 更强能力&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen3:8b&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：如果显存不够，Ollama 会自动使用量化版本，或者你可以手动拉取量化版本，如 &lt;code&gt;qwen2.5:3b-q4_K_M&lt;/code&gt;，占用更少显存。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;583-配置-openclaw-连接-ollama&quot;&gt;5.8.3 配置 OpenClaw 连接 Ollama&lt;/h4&gt;
&lt;p&gt;配置 OpenClaw 通过 Gateway 连接本地 Ollama：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.ollama&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;http://localhost:18789/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;ollama-local&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen2.5:3b&quot;, &quot;name&quot;: &quot;Qwen 2.5 3B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen2.5-coder:3b&quot;, &quot;name&quot;: &quot;Qwen 2.5 Coder 3B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen3:8b&quot;, &quot;name&quot;: &quot;Qwen 3 8B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;phi3:mini&quot;, &quot;name&quot;: &quot;Phi-3 Mini&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 设为默认（推荐 3B 模型，8GB+ 显存可用 qwen3:8b）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set ollama&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:3b&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意&lt;/strong&gt;：这里 Gateway 的地址是 &lt;code&gt;http://localhost:18789&lt;/code&gt;（你启动 Gateway 时指定的端口），而不是直接连接 Ollama 的 &lt;code&gt;11434&lt;/code&gt; 端口。这样 OpenClaw 可以统一管理所有模型连接。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;584-什么是-gateway&quot;&gt;5.8.4 什么是 Gateway？&lt;/h4&gt;
&lt;p&gt;Gateway（网关）是 OpenClaw 的&lt;strong&gt;后台服务&lt;/strong&gt;，你可以把它理解成一个”翻译官”——OpenClaw 通过它和各类模型对话。&lt;/p&gt;
&lt;p&gt;简单来说：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gateway 负责&lt;strong&gt;统一管理&lt;/strong&gt;各种模型的连接&lt;/li&gt;
&lt;li&gt;Gateway 负责&lt;strong&gt;处理身份验证&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Gateway 负责&lt;strong&gt;转发请求&lt;/strong&gt;到不同的模型供应商&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;工作架构图&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;你&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;OpenClaw CLI（你输入命令的地方）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Gateway（网关，负责连接管理）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;模型供应商&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(MiniMax / Qwen / OpenRouter / Ollama)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;为什么需要 Gateway？&lt;/strong&gt; OpenClaw 通过 Gateway 这个统一的入口，可以方便地连接各种不同的模型供应商，不需要为每个模型单独配置连接方式。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;585-安装-gateway&quot;&gt;5.8.5 安装 Gateway&lt;/h4&gt;
&lt;p&gt;OpenClaw 安装时通常会自动包含 Gateway。如果需要单独安装：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g @openclaw&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gateway&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;586-启动-gateway&quot;&gt;5.8.6 启动 Gateway&lt;/h4&gt;
&lt;p&gt;Gateway 是 OpenClaw 的核心运行进程，负责：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;管理模型连接&lt;/li&gt;
&lt;li&gt;提供 HTTP / WebSocket API&lt;/li&gt;
&lt;li&gt;提供 Web 控制界面&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;启动 Gateway（推荐）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;最简单的方式是运行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个命令会启动 Gateway 服务。启动后，默认是：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;http监听地址://127.0.0.1:18789&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你可以在浏览器中打开这个地址，访问 Web 控制界面来配置模型。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;常用参数&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;如果需要自定义，可以使用以下参数：&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;参数&lt;/th&gt;&lt;th&gt;作用&lt;/th&gt;&lt;th&gt;示例&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--port&lt;/code&gt;&lt;/td&gt;&lt;td&gt;指定端口号&lt;/td&gt;&lt;td&gt;&lt;code&gt;--port 8080&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--verbose&lt;/code&gt;&lt;/td&gt;&lt;td&gt;显示详细日志，方便排查问题&lt;/td&gt;&lt;td&gt;&lt;code&gt;--verbose&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;&lt;td&gt;强制占用端口&lt;/td&gt;&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;示例&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 指定端口启动&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 显示详细日志&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;verbose&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 端口冲突时强制占用&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;force&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;587-高级配置可选&quot;&gt;5.8.7 高级配置（可选）&lt;/h4&gt;
&lt;p&gt;如果你想进一步自定义 Gateway：&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;选项&lt;/th&gt;&lt;th&gt;说明&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--hot-reload&lt;/code&gt;&lt;/td&gt;&lt;td&gt;启用热重载，修改配置无需重启&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;SIGUSR1&lt;/code&gt;&lt;/td&gt;&lt;td&gt;发送信号重启 Gateway（Linux/macOS）&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--config&lt;/code&gt;&lt;/td&gt;&lt;td&gt;指定配置文件路径&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;示例：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 热重载模式&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;18789&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;hot&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;reload&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;方法一cli-命令配置&quot;&gt;方法一：CLI 命令配置&lt;/h3&gt;
&lt;p&gt;使用 &lt;code&gt;openclaw config set&lt;/code&gt; 命令直接配置模型参数。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 语法&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.提供者名称&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.example.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;模型ID&quot;, &quot;name&quot;: &quot;显示名称&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;示例&lt;/strong&gt;（配置 MiniMax）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;你的MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;优点&lt;/strong&gt;：快速、适合自动化脚本
&lt;strong&gt;缺点&lt;/strong&gt;：需要记忆命令语法&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;方法二修改配置文件&quot;&gt;方法二：修改配置文件&lt;/h3&gt;
&lt;p&gt;直接编辑 OpenClaw 的配置文件 &lt;code&gt;claude.json&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;配置文件位置：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows: &lt;code&gt;%USERPROFILE%\.openclaw\claude.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;macOS/Linux: &lt;code&gt;~/.openclaw/claude.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;示例配置&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;models&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;providers&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;minimax&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;baseUrl&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;https://api.minimaxi.com/v1&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;apiKey&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;你的MiniMax_API_Key&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;api&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;openai-completions&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;models&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          { &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MiniMax-M2.5&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MiniMax M2.5&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;优点&lt;/strong&gt;：可批量配置、易于备份
&lt;strong&gt;缺点&lt;/strong&gt;：需要手动编辑 JSON 格式&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;方法三通过-web-页面配置推荐新手&quot;&gt;方法三：通过 Web 页面配置（推荐新手）&lt;/h3&gt;
&lt;p&gt;除了命令行和配置文件，你还可以通过 &lt;strong&gt;Web 界面&lt;/strong&gt; 来配置模型。这种方式更直观，适合新手用户。&lt;/p&gt;
&lt;h4 id=&quot;第一步启动-gateway&quot;&gt;第一步：启动 Gateway&lt;/h4&gt;
&lt;p&gt;Gateway 不仅提供 API 服务，还自带 Web 控制界面。在终端运行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个命令会启动 Gateway 服务，并在后台运行。&lt;/p&gt;
&lt;h4 id=&quot;第二步打开浏览器访问&quot;&gt;第二步：打开浏览器访问&lt;/h4&gt;
&lt;p&gt;Gateway 的 Web 界面默认地址是：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;http://127.0.0.1:18789&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在浏览器中打开这个地址，你会看到 Gateway 的管理界面。&lt;/p&gt;
&lt;h4 id=&quot;第三步进入配置页面&quot;&gt;第三步：进入配置页面&lt;/h4&gt;
&lt;p&gt;在界面中找到并点击：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Config → Models&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这里可以管理所有的模型配置。&lt;/p&gt;
&lt;h4 id=&quot;第四步添加-provider-配置&quot;&gt;第四步：添加 Provider 配置&lt;/h4&gt;
&lt;p&gt;以添加 MiniMax 为例：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;点击 &lt;strong&gt;Add Provider&lt;/strong&gt; 或类似按钮&lt;/li&gt;
&lt;li&gt;选择或填写 Provider 类型&lt;/li&gt;
&lt;li&gt;填写以下信息：&lt;/li&gt;
&lt;/ol&gt;

















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;字段&lt;/th&gt;&lt;th&gt;值&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://api.minimaxi.com/v1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;你的 MiniMax API Key&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;打开 &lt;strong&gt;Auth Header&lt;/strong&gt; 选项（如果需要）&lt;/li&gt;
&lt;li&gt;填写 API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;第五步保存配置&quot;&gt;第五步：保存配置&lt;/h4&gt;
&lt;p&gt;点击 &lt;strong&gt;Save&lt;/strong&gt; 或 &lt;strong&gt;Update&lt;/strong&gt; 按钮保存配置。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示&lt;/strong&gt;：保存后，Gateway 会自动刷新配置，你可能需要重启 OpenClaw 才能生效。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;这种方式的好处是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;可视化操作，不需要记命令&lt;/li&gt;
&lt;li&gt;实时看到配置状态&lt;/li&gt;
&lt;li&gt;适合不熟悉命令行的用户&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;6-使用-cc-switch-管理-api推荐&quot;&gt;6. 使用 cc-switch 管理 API（推荐）&lt;/h2&gt;
&lt;p&gt;如果你配置了多个模型 provider，每次手动改配置会比较麻烦。&lt;strong&gt;cc-switch&lt;/strong&gt; 是一个跨平台桌面工具，可以帮你一键切换不同的 AI API 配置，支持 Claude Code、OpenClaw、Gemini 等。&lt;/p&gt;
&lt;h3 id=&quot;61-为什么用-cc-switch&quot;&gt;6.1 为什么用 cc-switch？&lt;/h3&gt;
&lt;p&gt;手动管理 API Key 的问题：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;每个 provider 都要单独配置环境变量&lt;/li&gt;
&lt;li&gt;切换模型需要修改 JSON 配置&lt;/li&gt;
&lt;li&gt;多个账号/供应商时容易混乱&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;cc-switch 的优势：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;可视化界面，不用改命令行配置&lt;/li&gt;
&lt;li&gt;一键切换 provider&lt;/li&gt;
&lt;li&gt;支持 MCP 服务器管理&lt;/li&gt;
&lt;li&gt;支持 Skills/Prompts 预设&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;62-cc-switch-的工作原理&quot;&gt;6.2 cc-switch 的工作原理&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;重要&lt;/strong&gt;：cc-switch 会把当前启用的 provider 配置信息写入&lt;strong&gt;环境变量&lt;/strong&gt;。OpenClaw 启动时会自动读取这些环境变量，因此你&lt;strong&gt;不需要手动编辑 OpenClaw 的配置文件&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;这就是 cc-switch 的便捷之处：你只需要在 cc-switch 中切换 provider，然后启动 OpenClaw，它就会自动使用当前配置。&lt;/p&gt;
&lt;h3 id=&quot;63-安装-cc-switch&quot;&gt;6.3 安装 cc-switch&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;访问 &lt;a href=&quot;https://github.com/farion1231/cc-switch/releases&quot;&gt;cc-switch GitHub Releases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;下载 &lt;code&gt;CC-Switch-v{version}-Windows.msi&lt;/code&gt; 或便携版&lt;/li&gt;
&lt;li&gt;运行安装&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;macOS&lt;/strong&gt;：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;brew&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; tap&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; farion1231/ccswitch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;brew&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --cask&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; cc-switch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;：&lt;/p&gt;
&lt;p&gt;支持 .deb、.rpm、.AppImage 等多种格式。&lt;/p&gt;
&lt;h3 id=&quot;64-添加-provider&quot;&gt;6.4 添加 Provider&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step6.webp&quot; alt=&quot;&quot;&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;启动 cc-switch&lt;/li&gt;
&lt;li&gt;点击右上角 &lt;strong&gt;「+」&lt;/strong&gt; 或「Add Provider」&lt;/li&gt;
&lt;li&gt;选择预设的 provider（MiniMax、Qwen 等）&lt;/li&gt;
&lt;li&gt;填写你的 API Key&lt;/li&gt;
&lt;li&gt;点击「添加」&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;65-切换-provider&quot;&gt;6.5 切换 Provider&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;在主界面选择你想用的 provider&lt;/li&gt;
&lt;li&gt;点击「启用」&lt;/li&gt;
&lt;li&gt;重启 OpenClaw（如果正在运行）&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;66-openclaw-自动使用当前配置&quot;&gt;6.6 OpenClaw 自动使用当前配置&lt;/h3&gt;
&lt;p&gt;cc-switch 会把当前启用的 provider 配置写入环境变量。OpenClaw 启动时会自动读取这些环境变量，所以你只需要：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 切换 provider 后，重启 OpenClaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw restart&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 或者&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OpenClaw 会自动使用 cc-switch 中当前启用的 API 配置。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;7-启动和使用&quot;&gt;7. 启动和使用&lt;/h2&gt;
&lt;p&gt;配好模型后，就可以用了。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 交互式对话&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 启动 Web 服务&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw serve &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3000&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 启动 Gateway（如未自动启动）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Web 面板&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw dashboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;直接输入文字就能对话。如果配好了工具，它还能帮你操作文件、搜东西之类的。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;8-推荐配置&quot;&gt;8. 推荐配置&lt;/h2&gt;
&lt;p&gt;根据不同场景，给个参考：&lt;/p&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;场景&lt;/th&gt;&lt;th&gt;推荐模型&lt;/th&gt;&lt;th&gt;理由&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;编程&lt;/td&gt;&lt;td&gt;qwen/qwen3-coder&lt;/td&gt;&lt;td&gt;专为编程优化，GitHub 集成好&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;视觉理解&lt;/td&gt;&lt;td&gt;qwen-portal/vision-model&lt;/td&gt;&lt;td&gt;支持图像理解&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;日常对话&lt;/td&gt;&lt;td&gt;MiniMax-M2.5&lt;/td&gt;&lt;td&gt;中文理解好，性价比高&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;深度推理&lt;/td&gt;&lt;td&gt;Qwen3-Max&lt;/td&gt;&lt;td&gt;能力强&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;本地离线&lt;/td&gt;&lt;td&gt;Ollama qwen2.5:3b&lt;/td&gt;&lt;td&gt;主流配置可用，完全免费&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;我的常用搭配&lt;/strong&gt;：日常用 MiniMax，编程切到 qwen/qwen3-coder。&lt;/p&gt;
&lt;p&gt;切换模型很方便：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 切到 MiniMax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 切到 Qwen 编程&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen3&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 切到 Qwen 视觉&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;portal&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;vision&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;model&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;9-常见问题&quot;&gt;9. 常见问题&lt;/h2&gt;
&lt;h3 id=&quot;命令找不到&quot;&gt;命令找不到&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 检查是否装上了&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm list &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 重启 PowerShell 再试&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 不行就重装&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;api-key-报错&quot;&gt;API Key 报错&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;检查 Key 对不对，有没有多余空格&lt;/li&gt;
&lt;li&gt;看看还有没有余额&lt;/li&gt;
&lt;li&gt;建议用环境变量方式配置&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;ollama-连不上&quot;&gt;Ollama 连不上&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 确认 Ollama 启动了&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 试试能不能访问&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;curl http:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;localhost:&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;11434&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;gateway-连不上&quot;&gt;Gateway 连不上&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 确认 Gateway 启动了&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 如果端口被占用，加 --force 强制启动&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;force&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 或者指定其他端口&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;响应太慢&quot;&gt;响应太慢&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;远程 API：检查网络，或者换个模型&lt;/li&gt;
&lt;li&gt;Ollama：考虑用更小的模型，如 &lt;code&gt;qwen2.5:3b&lt;/code&gt; 或量化版本 &lt;code&gt;qwen2.5:3b-q4_K_M&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;安装脚本报错&quot;&gt;安装脚本报错&lt;/h3&gt;
&lt;p&gt;确认执行策略改过了：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ExecutionPolicy RemoteSigned &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Scope CurrentUser&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;10-替代方案腾讯工作流-aiworkbuddy&quot;&gt;10. 替代方案：腾讯工作流 AI（WorkBuddy）&lt;/h2&gt;
&lt;p&gt;如果你觉得 OpenClaw 部署太复杂，不妨考虑一下 &lt;strong&gt;&lt;a href=&quot;https://copilot.tencent.com/work/&quot;&gt;腾讯工作流 AI&lt;/a&gt;&lt;/strong&gt;（又称 &lt;strong&gt;WorkBuddy&lt;/strong&gt; ）。&lt;/p&gt;
&lt;h3 id=&quot;什么是-workbuddy&quot;&gt;什么是 WorkBuddy？&lt;/h3&gt;
&lt;p&gt;WorkBuddy 是腾讯推出的 AI 编程助手，类似于 Cursor、Windsurf 的产品。它&lt;strong&gt;不需要本地部署&lt;/strong&gt;，直接通过 VS Code 或 JetBrains 插件即可使用。&lt;/p&gt;
&lt;h3 id=&quot;特点-1&quot;&gt;特点&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;无需部署&lt;/strong&gt;：安装插件即可使用&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;免费额度充足&lt;/strong&gt;：腾讯提供免费使用额度&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;中文优化好&lt;/strong&gt;：对中文开发者友好&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;集成腾讯生态&lt;/strong&gt;：可接入微信、腾讯云等服务&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;适用人群&quot;&gt;适用人群&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;编程新手，不想折腾环境配置&lt;/li&gt;
&lt;li&gt;追求开箱即用的体验&lt;/li&gt;
&lt;li&gt;只想简单体验 AI 编程辅助&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;与-openclaw-的对比&quot;&gt;与 OpenClaw 的对比&lt;/h3&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;特性&lt;/th&gt;&lt;th&gt;OpenClaw&lt;/th&gt;&lt;th&gt;WorkBuddy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;部署方式&lt;/td&gt;&lt;td&gt;本地部署&lt;/td&gt;&lt;td&gt;无需部署&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;定制性&lt;/td&gt;&lt;td&gt;高&lt;/td&gt;&lt;td&gt;中&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;学习成本&lt;/td&gt;&lt;td&gt;较高&lt;/td&gt;&lt;td&gt;低&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;费用&lt;/td&gt;&lt;td&gt;免费/付费&lt;/td&gt;&lt;td&gt;有免费额度&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;总结&lt;/strong&gt;：如果你只是想体验 AI 编程辅助，WorkBuddy 是个更简单的选择。如果你想要更高的定制性和可扩展性，OpenClaw 仍然是更好的选择。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;结语&quot;&gt;结语&lt;/h2&gt;
&lt;p&gt;这篇教程可能还是不够详细，但是我已经写入了很基础的详细配置教程，后续我会更新大模型参数详解之类的教程，后续我可能会更新openclaw接入飞书的详细教程等。&lt;/p&gt;</content:encoded><category>OpenClaw</category><category>AI</category><category>MiniMax</category><category>Qwen</category><category>Ollama</category><category>OpenRouter</category><category>OpenAI</category><category>教程</category></item><item><title>OpenClaw Windows Installation &amp; Configuration Guide (MiniMax / Qwen / Ollama)</title><link>https://danarnoux.com/blog/openclaw-windows-setup-guide-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/openclaw-windows-setup-guide-en/</guid><description>A detailed guide on how to install and configure OpenClaw on Windows, connecting to cloud-based large language models like MiniMax and Qwen, or running local models via Ollama.</description><pubDate>Tue, 10 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I’ve been thinking about whether to make an OpenClaw deployment tutorial, because the OpenClaw Chinese documentation is already quite detailed. However, I realized that many people might not know that Chinese documentation exists, or still find it confusing even when following the tutorial. Recently, OpenClaw has become extremely popular in China—it’s almost overhyped, like a modern-day “qigong fever.” But I still think it’s worth making a detailed tutorial so you can try deploying it yourself. After all, you won’t know if a product is right for you until you’ve tried it. The idea of having your own Jarvis-like personal AI assistant is quite appealing.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-what-is-openclaw&quot;&gt;1. What is OpenClaw?&lt;/h2&gt;
&lt;p&gt;Let me give you a quick overview. &lt;strong&gt;OpenClaw&lt;/strong&gt; (formerly known as Clawdbot—pretty interesting name change, right?) is an open-source AI Agent framework. Simply put, you can think of it as an “AI operating system”—it doesn’t provide AI capabilities itself, but it helps you connect to various large language models to accomplish tasks.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step2.webp&quot; alt=&quot;Openclaw Official Website&quot;&gt;&lt;/p&gt;
&lt;p&gt;Unlike regular chatbots, OpenClaw can do much more:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Operate on file systems&lt;/li&gt;
&lt;li&gt;Execute commands&lt;/li&gt;
&lt;li&gt;Write and debug code&lt;/li&gt;
&lt;li&gt;Search for information&lt;/li&gt;
&lt;li&gt;Integrate with communication tools like Feishu and Telegram&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You just need to pair it with the right model, and it can help you get things done.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-how-openclaw-works&quot;&gt;2. How OpenClaw Works&lt;/h2&gt;
&lt;p&gt;Let’s clarify an important concept: &lt;strong&gt;OpenClaw is just a “shell”—you need to provide your own model.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The workflow looks like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;You (input) → OpenClaw → AI Model → Return result&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can choose to connect to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cloud Models&lt;/strong&gt;: MiniMax, Qwen (Alibaba Cloud Bailian), OpenAI, Claude, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local Models&lt;/strong&gt;: Models running locally via Ollama&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each approach has its pros and cons, which I’ll explain in detail later.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: This guide includes a dedicated section on configuring Ollama local models—see Section 5.8.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-deployment-options-and-model-choices&quot;&gt;3. Deployment Options and Model Choices&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Official Documentation&lt;/strong&gt;: For more advanced configuration options, check out the &lt;a href=&quot;https://docs.openclaw.ai/en-US&quot;&gt;OpenClaw English Documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Before we start installing, let’s understand the two deployment options and how to choose a model.&lt;/p&gt;
&lt;h3 id=&quot;31-deployment-options-explained&quot;&gt;3.1 Deployment Options Explained&lt;/h3&gt;
&lt;p&gt;OpenClaw has two deployment options:&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Deployment&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Best For&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Local Deployment&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Run on your own Windows PC&lt;/td&gt;&lt;td&gt;Personal use, privacy-first, low cost&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Remote Server&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Run on a cloud server (e.g., Linux server)&lt;/td&gt;&lt;td&gt;Multi-user sharing, 24/7 operation&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;This guide focuses on local deployment&lt;/strong&gt;—running OpenClaw on your own Windows PC. While remote server deployment is convenient (vendors handle everything for you), you might actually want your own personal Jarvis on your private computer. While this comes with more risks, you’ll weigh and accept them yourself.&lt;/p&gt;
&lt;h3 id=&quot;32-which-model-should-you-choose&quot;&gt;3.2 Which Model Should You Choose?&lt;/h3&gt;
&lt;p&gt;Before starting installation, decide which model option you’ll use. This affects the configuration steps.&lt;/p&gt;
&lt;h3 id=&quot;cloud-apis-recommended-for-beginners&quot;&gt;Cloud APIs (Recommended for Beginners)&lt;/h3&gt;
&lt;p&gt;Call cloud model APIs with pay-as-you-go pricing (most have free tiers).&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Provider&lt;/th&gt;&lt;th&gt;Recommended Model&lt;/th&gt;&lt;th&gt;Features&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;MiniMax&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;M2.5&lt;/td&gt;&lt;td&gt;Great cost-performance, well-optimized for Chinese&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Qwen&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;qwen/qwen3-coder / qwen/qwen3-vl&lt;/td&gt;&lt;td&gt;Strong coding abilities, generous free tier from Alibaba Cloud&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;qwen3-coder is a coding-optimized model released by Alibaba.
| &lt;strong&gt;OpenAI&lt;/strong&gt; | GPT-5 series | Strong all-around capabilities |&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: No GPU needed, fast responses, reliable capabilities
&lt;strong&gt;Cons&lt;/strong&gt;: Requires payment (but usually has free credits)&lt;/p&gt;
&lt;h3 id=&quot;local-models-ollama&quot;&gt;Local Models (Ollama)&lt;/h3&gt;
&lt;p&gt;Run models on your own computer, completely free, but requires specific hardware.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Zero cost, better privacy
&lt;strong&gt;Cons&lt;/strong&gt;: Requires a capable GPU, response speed depends on hardware&lt;/p&gt;
&lt;p&gt;Honestly, most computers can’t really handle this. You can check your GPU configuration. Even the workstation in our lab didn’t go with the Ollama solution—the main issue isn’t just VRAM being enough to run, you also can’t ignore speed. Plus, my setup is already pretty powerful, but I still didn’t choose Ollama. The API solution is pretty good—you just pay a little.&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step1.webp&quot; alt=&quot;OpenRouter pricing&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My Suggestion&lt;/strong&gt;: Beginners should just use a remote API—MiniMax or Qwen works great. Once configured, you can start using it in 5 minutes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;33-how-to-choose-the-right-llm&quot;&gt;3.3 How to Choose the Right LLM&lt;/h3&gt;
&lt;p&gt;Choosing an LLM mainly depends on these factors:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Factor&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Price&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Cloud APIs charge per usage; different models vary greatly in price&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Speed&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Response speed depends on model size and network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Context Length&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;How much text it can process; longer = more expensive&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Coding Ability&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Some models are specifically optimized for programming&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Reasoning Ability&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Ability to solve complex problems&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;using-the-openrouter-rankings&quot;&gt;Using the OpenRouter Rankings&lt;/h4&gt;
&lt;p&gt;OpenRouter provides a convenient &lt;a href=&quot;https://openrouter.ai/rankings&quot;&gt;Model Rankings&lt;/a&gt; page where you can filter by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Overall benchmark scores&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Price&lt;/strong&gt;: Sorting by input/output prices&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context Length&lt;/strong&gt;: Maximum supported tokens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Latency&lt;/strong&gt;: Response speed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step3.webp&quot; alt=&quot;OpenRouter rankings&quot;&gt;&lt;/p&gt;
&lt;p&gt;When searching for a specific model on OpenRouter, you can view:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Benchmarks&lt;/strong&gt;: Capability scores in various areas&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pricing&lt;/strong&gt;: Input and output prices&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Context Length&lt;/strong&gt;: Supported context length&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step4.webp&quot; alt=&quot;Model details&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Different ranking systems may use different evaluation methods. For example, some rankings emphasize coding benchmarks while ignoring multimodal capabilities or long context abilities. Rankings should only be used as a reference.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Also, there’s the issue—you can’t ignore pricing just because of model capability. Check your bill later and you’ll be shocked! &lt;img src=&quot;https://img.danarnoux.com/posts/openclaw-windows-setup-guide/step5.webp&quot; alt=&quot;Pricing shock&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Recommended Models with Excellent Overall Performance&lt;/strong&gt;:&lt;/p&gt;

































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Features&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;GPT-5 series&lt;/td&gt;&lt;td&gt;Strong all-around, suitable for various scenarios&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude 4 Sonnet series&lt;/td&gt;&lt;td&gt;Strong long context, great for handling long texts&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;qwen/qwen3-coder&lt;/td&gt;&lt;td&gt;Strong coding ability, generous free tier&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek V3 / V3.2&lt;/td&gt;&lt;td&gt;Strong overall capability, great cost-performance&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gemini 3 Flash series&lt;/td&gt;&lt;td&gt;Fast speed, affordable price&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gemini series&lt;/td&gt;&lt;td&gt;Strong all-around, excellent at multimodal tasks&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;coding-model-recommendations&quot;&gt;Coding Model Recommendations&lt;/h4&gt;
&lt;p&gt;If you’re mainly using OpenClaw &lt;strong&gt;for programming assistance&lt;/strong&gt;, here’s how each model performs:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Most capable coding models&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude Opus&lt;/strong&gt; (including Claude 4 Opus series) usually performs exceptionally well on coding tasks&lt;/li&gt;
&lt;li&gt;However, there are limitations:
&lt;ul&gt;
&lt;li&gt;Higher price&lt;/li&gt;
&lt;li&gt;May be unstable to access in China&lt;/li&gt;
&lt;li&gt;Not as well-optimized for Chinese as domestic models&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;If you’re interested, check out the &lt;a href=&quot;https://docs.openclaw.ai/en-US/providers/anthropic&quot;&gt;OpenClaw Official Anthropic Configuration Documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;More practical choices for Chinese users&lt;/strong&gt;:&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Features&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;MiniMax M2.5&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Good Chinese understanding, great cost-performance&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;qwen/qwen3-coder&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Alibaba’s coding-specific model, generous free tier&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;DeepSeek V3 / V3.2&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Strong overall capability, great cost-performance&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;DeepSeek V3 / V3.2 is the current flagship model in the DeepSeek series with excellent overall capabilities.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;: If your network conditions allow and budget is sufficient, Claude Opus is the strongest choice. Otherwise, MiniMax M2.5, qwen/qwen3-coder, or DeepSeek V3/V3.2 are more practical options.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Google Gemini series&lt;/strong&gt; is also very strong in overall capabilities and multimodal tasks. For example, &lt;strong&gt;Nano Banana&lt;/strong&gt; in the Gemini ecosystem performs exceptionally well in image generation and visual content creation. If your needs involve image generation or multimodal understanding, consider the Gemini series.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Beginners are recommended to start with MiniMax or Qwen—once configured, you can use it in 5 minutes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;4-windows-installation-steps&quot;&gt;4. Windows Installation Steps&lt;/h2&gt;
&lt;h3 id=&quot;quick-installation-recommended&quot;&gt;Quick Installation (Recommended)&lt;/h3&gt;
&lt;p&gt;If you just want to &lt;strong&gt;try OpenClaw quickly&lt;/strong&gt;, you can use the official quick install method. Only two steps!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Install OpenClaw&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Run the Setup Wizard&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;install-daemon&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will automatically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initialize OpenClaw configuration&lt;/li&gt;
&lt;li&gt;Install the Gateway service&lt;/li&gt;
&lt;li&gt;Create default config files&lt;/li&gt;
&lt;li&gt;Start the OpenClaw service&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Yes, you read that right—just these two commands complete the basic installation!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After installation, you can:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Run interactive chat&lt;/strong&gt;: &lt;code&gt;openclaw&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open the web interface&lt;/strong&gt;: &lt;code&gt;openclaw dashboard&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure models&lt;/strong&gt;: Follow Chapter 5 to configure your preferred models for OpenClaw&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Official Documentation&lt;/strong&gt;: For more details, check out the &lt;a href=&quot;https://docs.openclaw.ai/en-US&quot;&gt;OpenClaw Official Documentation&lt;/a&gt;, especially the &lt;strong&gt;Quick Start&lt;/strong&gt; section.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;If you want to understand the complete OpenClaw installation process and what each step does&lt;/strong&gt;, continue reading the advanced installation tutorial below.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Now let’s start the installation. Just follow the steps in order.&lt;/p&gt;
&lt;h3 id=&quot;41-environment-preparation&quot;&gt;4.1 Environment Preparation&lt;/h3&gt;
&lt;p&gt;You need to have &lt;strong&gt;Node.js&lt;/strong&gt; installed first (LTS version recommended, 22 or higher).&lt;/p&gt;
&lt;h4 id=&quot;installing-nodejs&quot;&gt;Installing Node.js&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Method 1: Direct Installation&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://nodejs.org/en/download/&quot;&gt;Node.js Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download Windows Installer (.msi)&lt;/li&gt;
&lt;li&gt;Click Next through the wizard&lt;/li&gt;
&lt;li&gt;If you encounter network issues, refer to my other article: &lt;a href=&quot;https://danarnoux.com/blog/how-to-build-a-personal-blog-en/#nodejs-installation&quot;&gt;Node.js detailed installation steps&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Method 2: nvm (Recommended for managing multiple versions)&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Install nvm for Windows&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Visit https://github.com/coreybutler/nvm-windows/releases to download&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# After installation, run in PowerShell:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;nvm install &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;22&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;nvm use &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;22&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Verify:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;node &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Should show v22.x.x&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Should show 8.x.x&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;switch-npm-registry-recommended-for-china-users&quot;&gt;Switch npm Registry (Recommended for China Users)&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm config set registry https:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;registry.npmmirror.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;install-git-optional-but-recommended&quot;&gt;Install Git (Optional but Recommended)&lt;/h4&gt;
&lt;p&gt;Some skills depend on Git—it’s recommended to install:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://git-scm.com/download/win&quot;&gt;Git Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For configuration issues, refer to my article: &lt;a href=&quot;https://danarnoux.com/blog/how-to-get-started-with-programming-en/#git-basics&quot;&gt;Git Configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download and install, click Next through the wizard&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;42-modify-execution-policy&quot;&gt;4.2 Modify Execution Policy&lt;/h3&gt;
&lt;p&gt;Windows doesn’t allow running scripts by default—you need to change this setting. Open PowerShell as &lt;strong&gt;Administrator&lt;/strong&gt; and run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ExecutionPolicy RemoteSigned &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Scope CurrentUser&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Type &lt;code&gt;Y&lt;/code&gt; to confirm.&lt;/p&gt;
&lt;h3 id=&quot;43-run-the-installation-script&quot;&gt;4.3 Run the Installation Script&lt;/h3&gt;
&lt;p&gt;Now you can install OpenClaw. Execute in PowerShell:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;iwr &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;useb https:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw.ai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;install.ps1 &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; iex&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Wait a moment—the script will automatically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Detect Node.js environment&lt;/li&gt;
&lt;li&gt;Download and install OpenClaw&lt;/li&gt;
&lt;li&gt;Configure PATH&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you see &lt;strong&gt;“OpenClaw installed successfully”&lt;/strong&gt;, it’s done.&lt;/p&gt;
&lt;h3 id=&quot;44-setup-wizard&quot;&gt;4.4 Setup Wizard&lt;/h3&gt;
&lt;p&gt;The first run will enter the wizard:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The process goes like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Risk warning → Type &lt;code&gt;yes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Configuration mode → Select &lt;code&gt;QuickStart&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Model selection → Skip for now, configure manually later&lt;/li&gt;
&lt;li&gt;Channel selection → Skip for now&lt;/li&gt;
&lt;li&gt;Skills package → Select &lt;code&gt;No&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;45-verify-installation&quot;&gt;4.5 Verify Installation&lt;/h3&gt;
&lt;p&gt;You can verify the installation:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Check version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Check status&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw status&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Run diagnostics&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw doctor&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Open web panel&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw dashboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;openclaw dashboard&lt;/code&gt; will start a local web page, default at &lt;code&gt;http://localhost:8080&lt;/code&gt;. You can visually configure it in your browser.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;5-configuring-ai-models&quot;&gt;5. Configuring AI Models&lt;/h2&gt;
&lt;p&gt;Just installing doesn’t mean it’s ready to use—you need to connect it to a model. Below are instructions for several popular options.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Official Documentation&lt;/strong&gt;: For more configuration details, check out the &lt;a href=&quot;https://docs.openclaw.ai/en-US&quot;&gt;OpenClaw Official Documentation&lt;/a&gt;, which has more detailed provider configuration guides and troubleshooting tips.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;51-must-read-before-configuration-api-concept-explanation&quot;&gt;5.1 Must-Read Before Configuration: API Concept Explanation&lt;/h3&gt;
&lt;p&gt;Before configuring models, let me explain some key concepts:&lt;/p&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Concept&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Provider&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Company or platform providing AI model services&lt;/td&gt;&lt;td&gt;MiniMax, Alibaba Cloud, OpenRouter&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Address of the API server&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://api.minimaxi.com/v1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Key to access the API, like a “password”&lt;/td&gt;&lt;td&gt;&lt;code&gt;sk-xxxxxx&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Model ID&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Name of the specific model&lt;/td&gt;&lt;td&gt;&lt;code&gt;MiniMax-M2.5&lt;/code&gt;, &lt;code&gt;qwen-plus&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Config JSON&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;JSON format for configuration info&lt;/td&gt;&lt;td&gt;Structured config containing the above fields&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Why do you need to configure these?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;OpenClaw needs to know:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Where to find the model (Base URL)&lt;/li&gt;
&lt;li&gt;What credentials to use (API Key)&lt;/li&gt;
&lt;li&gt;Which specific model to use (Model ID)&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;recommended-using-cc-switch-to-manage-multiple-providers&quot;&gt;Recommended: Using cc-switch to Manage Multiple Providers&lt;/h4&gt;
&lt;p&gt;If you plan to configure multiple model providers, it’s recommended to use &lt;strong&gt;cc-switch&lt;/strong&gt; to manage them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multi-Provider Management&lt;/strong&gt;: One interface to manage all API configurations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One-click Switching&lt;/strong&gt;: Switch between different models anytime without manually changing config&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto Environment Variables&lt;/strong&gt;: OpenClaw automatically reads environment variables set by cc-switch&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: See Chapter 6 for a detailed introduction to cc-switch. If you don’t want manual configuration, you can skip this chapter’s provider configuration and directly read the cc-switch section.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;configuration-method-overview&quot;&gt;Configuration Method Overview&lt;/h4&gt;
&lt;p&gt;There are three ways to configure models:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Difficulty&lt;/th&gt;&lt;th&gt;Best For&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Method 1: CLI Commands&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Users familiar with command line&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Method 2: Edit Config File&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Harder&lt;/td&gt;&lt;td&gt;Users needing batch configuration&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Method 3: Web Page Config (Recommended)&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Easy&lt;/td&gt;&lt;td&gt;Beginner users&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;If you’re not familiar with the command line, &lt;strong&gt;Web Page Configuration (Method 3)&lt;/strong&gt; is recommended—visual interface is easier to get started. See details below in section 5.8.&lt;/p&gt;
&lt;h3 id=&quot;52-configure-minimax&quot;&gt;5.2 Configure MiniMax&lt;/h3&gt;
&lt;p&gt;MiniMax’s M2.5 is quite good—great cost-performance.&lt;/p&gt;
&lt;h4 id=&quot;get-api-key&quot;&gt;Get API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://platform.minimaxi.com/&quot;&gt;MiniMax Open Platform&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Register → Real-name authentication&lt;/li&gt;
&lt;li&gt;Go to “API Keys” → Create Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy and save&lt;/strong&gt;—you can only see it once&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;configuration-command&quot;&gt;Configuration Command&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Configure MiniMax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5-highspeed&quot;, &quot;name&quot;: &quot;MiniMax M2.5 High Speed&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default model&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;safer-approach-environment-variables&quot;&gt;Safer Approach: Environment Variables&lt;/h4&gt;
&lt;p&gt;Store the key in environment variables instead of writing it in config:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Temporary (only valid for current terminal)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$env.MINIMAX_API_KEY &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;your_Key&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Or permanent&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;System.Environment&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]::SetEnvironmentVariable(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MINIMAX_API_KEY&quot;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;your_Key&quot;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;User&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When configuring, use &lt;code&gt;$MINIMAX_API_KEY&lt;/code&gt; instead of the actual key.&lt;/p&gt;
&lt;h4 id=&quot;minimax-coding-plan-recommended-for-programmers&quot;&gt;MiniMax Coding Plan (Recommended for Programmers)&lt;/h4&gt;
&lt;p&gt;If you mainly use it for programming, MiniMax offers a dedicated &lt;strong&gt;Coding Plan&lt;/strong&gt; with better cost-performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Get API Key and Activate Coding Plan&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://platform.minimaxi.com/&quot;&gt;MiniMax Open Platform&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Register → Real-name authentication&lt;/li&gt;
&lt;li&gt;Go to “API Keys” → Create Key&lt;/li&gt;
&lt;li&gt;Go to “Coding Plan” page, activate Coding Plan&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy and save&lt;/strong&gt; the API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Configuration Command&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Configure MiniMax Coding Plan&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5-highspeed&quot;, &quot;name&quot;: &quot;MiniMax M2.5 High Speed&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default model&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Coding Plan usually has lower calling prices, suitable for high-frequency users.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;53-configure-alibaba-cloud-model-studio&quot;&gt;5.3 Configure Alibaba Cloud Model Studio&lt;/h3&gt;
&lt;p&gt;Alibaba Cloud Model Studio is a large model service platform provided by Alibaba Cloud, which you can use to access Qwen models and more. Besides the standard version, there’s also a dedicated &lt;strong&gt;Coding Plan&lt;/strong&gt; for programming users.&lt;/p&gt;
&lt;h4 id=&quot;get-api-key-1&quot;&gt;Get API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://modelscope.cn/&quot;&gt;Alibaba Cloud Model Studio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Register → Real-name authentication&lt;/li&gt;
&lt;li&gt;Go to “API Keys” → Create Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy and save&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;activate-coding-plan-recommended-for-programmers&quot;&gt;Activate Coding Plan (Recommended for Programmers)&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://bailian.aliyun.com/&quot;&gt;Alibaba Cloud Bailian&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Go to “Coding Plan” page&lt;/li&gt;
&lt;li&gt;Activate Coding Plan&lt;/li&gt;
&lt;li&gt;Get the dedicated Coding Plan API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;configuration-command-1&quot;&gt;Configuration Command&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Standard Version&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Configure Alibaba Cloud Model Studio&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.qwen&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://dashscope.aliyuncs.com/compatible-mode/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_Alibaba_Cloud_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen/qwen3-coder&quot;, &quot;name&quot;: &quot;Qwen Coder Model&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-portal/vision-model&quot;, &quot;name&quot;: &quot;Qwen Vision Model&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-plus&quot;, &quot;name&quot;: &quot;Qwen Plus&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen-max&quot;, &quot;name&quot;: &quot;Qwen Max&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen3&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Coding Plan Version&lt;/strong&gt; (if using Alibaba Cloud Coding Plan):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.qwen&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://coding.dashscope.aliyuncs.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_Coding_Plan_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen3-max-2026-01-23&quot;, &quot;name&quot;: &quot;Qwen3 Max&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Coding Plan usually has lower calling prices or free credits, suitable for high-frequency programming users.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;54-configure-openrouter&quot;&gt;5.4 Configure OpenRouter&lt;/h3&gt;
&lt;p&gt;OpenRouter is a platform that aggregates hundreds of AI models. Through it, you can use a single API Key to access GPT, Claude, DeepSeek, and many other models.&lt;/p&gt;
&lt;h4 id=&quot;get-api-key-2&quot;&gt;Get API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://openrouter.ai/&quot;&gt;OpenRouter Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Register account&lt;/li&gt;
&lt;li&gt;Go to “API Keys” → Create Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy and save&lt;/strong&gt;—you can only see it once&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;configuration-command-2&quot;&gt;Configuration Command&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.openrouter&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://openrouter.ai/api/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_OpenRouter_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;openai/gpt-5&quot;, &quot;name&quot;: &quot;GPT-5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;anthropic/claude-4-sonnet&quot;, &quot;name&quot;: &quot;Claude 4 Sonnet&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;deepseek/deepseek-v3&quot;, &quot;name&quot;: &quot;DeepSeek V3&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;google/gemini-3-flash&quot;, &quot;name&quot;: &quot;Gemini 3 Flash&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set openrouter&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gpt&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Model IDs on OpenRouter are formatted differently than direct calls—the format is &lt;code&gt;provider/modelname&lt;/code&gt;, like &lt;code&gt;openai/gpt-5&lt;/code&gt;, &lt;code&gt;anthropic/claude-4-sonnet&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: Check the &lt;a href=&quot;https://openrouter.ai/rankings&quot;&gt;OpenRouter Rankings&lt;/a&gt; to see model ratings and price rankings as a reference for selection.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;55-configure-siliconflow&quot;&gt;5.5 Configure SiliconFlow&lt;/h3&gt;
&lt;p&gt;SiliconFlow is a domestic AI model aggregation platform in China, offering various model interfaces and is quite friendly for China users.&lt;/p&gt;
&lt;h4 id=&quot;features&quot;&gt;Features&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast domestic access&lt;/strong&gt;: Servers in China, low latency&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Many model options&lt;/strong&gt;: Supports Qwen, DeepSeek, Llama, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Affordable pricing&lt;/strong&gt;: Pay-per-use with free credits&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;configuration-reference&quot;&gt;Configuration Reference&lt;/h4&gt;
&lt;p&gt;For detailed configuration tutorials, refer to the official documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-OpenClaw&quot;&gt;SiliconFlow Official Configuration Guide&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Basic steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://www.siliconflow.cn/&quot;&gt;SiliconFlow Official Website&lt;/a&gt; to register&lt;/li&gt;
&lt;li&gt;Get API Key&lt;/li&gt;
&lt;li&gt;Configure provider by referring to official docs&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;56-configure-openai&quot;&gt;5.6 Configure OpenAI&lt;/h3&gt;
&lt;p&gt;If you have an OpenAI API Key, you can configure it directly.&lt;/p&gt;
&lt;h4 id=&quot;get-api-key-3&quot;&gt;Get API Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://platform.openai.com/&quot;&gt;OpenAI Platform&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Go to “API Keys” → Create Key&lt;/li&gt;
&lt;li&gt;Copy and save&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: China users may need to use a VPN to access OpenAI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;configuration-command-3&quot;&gt;Configuration Command&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.openai&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_OpenAI_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-5&quot;, &quot;name&quot;: &quot;OpenAI GPT-5&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-4o&quot;, &quot;name&quot;: &quot;GPT-4o&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;gpt-4o-mini&quot;, &quot;name&quot;: &quot;GPT-4o Mini&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set openai&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gpt&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;57-configure-qwen-oauth-recommended&quot;&gt;5.7 Configure Qwen OAuth (Recommended)&lt;/h3&gt;
&lt;p&gt;Qwen OAuth is the most recommended configuration method because it has &lt;strong&gt;free credits&lt;/strong&gt; and doesn’t require manually getting an API Key—just authorize with your Alibaba Cloud account.&lt;/p&gt;
&lt;h4 id=&quot;configuration-steps&quot;&gt;Configuration Steps&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the configuration wizard:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw onboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When selecting model provider, choose &lt;strong&gt;Qwen&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Qwen OAuth&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A browser window will pop up for you to log in with your Alibaba Cloud account for authorization&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After successful authorization, select the model you want to use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;qwen/qwen3-coder&lt;/code&gt;: Coding-specific&lt;/li&gt;
&lt;li&gt;&lt;code&gt;qwen-portal/vision-model&lt;/code&gt;: Vision understanding&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;manual-configuration-if-wizard-fails&quot;&gt;Manual Configuration (if wizard fails)&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Run OAuth authorization&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set oauth qwen&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open a browser for you to complete the authorization process. After authorization completes, the configuration is saved automatically.&lt;/p&gt;
&lt;h3 id=&quot;58-configure-ollama-local-models&quot;&gt;5.8 Configure Ollama Local Models&lt;/h3&gt;
&lt;p&gt;If you have a GPU and want to run models locally (zero API fees), you can use Ollama.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important Concept&lt;/strong&gt;: Ollama is responsible for running models locally, while OpenClaw needs to connect to Ollama through the &lt;strong&gt;Gateway&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;581-install-ollama&quot;&gt;5.8.1 Install Ollama&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://ollama.com/&quot;&gt;Ollama Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download the Windows version&lt;/li&gt;
&lt;li&gt;Run the installer—it will start automatically&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If Ollama website is inaccessible&lt;/strong&gt;, try these domestic mirror sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.newbe.pro/Mirrors/Mirrors-ollama&quot;&gt;https://www.newbe.pro/Mirrors/Mirrors-ollama&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ollama.ruanmao.net/&quot;&gt;https://ollama.ruanmao.net/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ollama defaults to listening at &lt;code&gt;http://localhost:11434&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;For China Users&lt;/strong&gt;: If you’re in Mainland China, you may encounter slow download speeds or unstable connections when downloading models. It’s recommended to configure a domestic mirror source (see below), which can significantly improve download speed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5 id=&quot;configure-domestic-mirror-sources-optional-recommended-for-china&quot;&gt;Configure Domestic Mirror Sources (Optional, Recommended for China)&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Domestic Mirror List&lt;/strong&gt;:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mirror Site&lt;/th&gt;&lt;th&gt;Address&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;ModelScope&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.modelscope.cn&quot;&gt;https://ollama.modelscope.cn&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.deepseek.com&quot;&gt;https://ollama.deepseek.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Zhejiang University&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://ollama.zju.edu.cn&quot;&gt;https://ollama.zju.edu.cn&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Domestic Collection&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;https://www.newbe.pro/Mirrors/Mirrors-ollama&quot;&gt;https://www.newbe.pro/Mirrors/Mirrors-ollama&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Configuration method (Windows):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;# Temporary effect&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;OLLAMA_HOST&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;# Permanent effect&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;setx OLLAMA_HOST https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Linux / macOS:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; OLLAMA_HOST&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;https://ollama.modelscope.cn&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After configuration, you can use commands like &lt;code&gt;ollama pull qwen3&lt;/code&gt; to download models. If download succeeds, the mirror is working.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Quick Tip&lt;/strong&gt;: If a mirror download fails, try switching to another mirror source.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;582-download-models&quot;&gt;5.8.2 Download Models&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;VRAM Note&lt;/strong&gt;: Larger models require more VRAM. 3B models need about 4-6GB VRAM, 8B models need about 8-12GB VRAM. Choose a suitable model based on your GPU.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Choose based on your PC configuration&lt;/strong&gt;:&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;PC Configuration&lt;/th&gt;&lt;th&gt;Recommended Model&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Entry-level (no discrete GPU or VRAM &amp;#x3C; 4GB)&lt;/td&gt;&lt;td&gt;phi3:mini, qwen2.5:1.8b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Mainstream (4-6GB VRAM)&lt;/td&gt;&lt;td&gt;qwen2.5:3b, qwen2.5-coder:3b, qwen3:4b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Mid-to-high end (8GB+ VRAM)&lt;/td&gt;&lt;td&gt;qwen3:8b, qwen3:14b&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: If Ollama doesn’t support Qwen3 yet, Qwen2.5 is still a great alternative.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Check available models&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Entry-level model (can run on CPU)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull phi3:mini&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Mainstream config - Chat model (recommended)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:3b&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Mainstream config - Coding model&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder:3b&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Mid-to-high end - Stronger capability&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama pull qwen3:8b&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: If VRAM isn’t enough, Ollama will automatically use a quantized version, or you can manually pull a quantized version like &lt;code&gt;qwen2.5:3b-q4_K_M&lt;/code&gt;, which uses less VRAM.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;583-configure-openclaw-to-connect-to-ollama&quot;&gt;5.8.3 Configure OpenClaw to Connect to Ollama&lt;/h4&gt;
&lt;p&gt;Configure OpenClaw to connect to local Ollama through Gateway:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.ollama&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;http://localhost:18789/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;ollama-local&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen2.5:3b&quot;, &quot;name&quot;: &quot;Qwen 2.5 3B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen2.5-coder:3b&quot;, &quot;name&quot;: &quot;Qwen 2.5 Coder 3B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;qwen3:8b&quot;, &quot;name&quot;: &quot;Qwen 3 8B&quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;phi3:mini&quot;, &quot;name&quot;: &quot;Phi-3 Mini&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Set as default (3B model recommended; use qwen3:8b if you have 8GB+ VRAM)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set ollama&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:3b&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The Gateway address here is &lt;code&gt;http://localhost:18789&lt;/code&gt; (the port you specified when starting Gateway), not Ollama’s direct port &lt;code&gt;11434&lt;/code&gt;. This allows OpenClaw to centrally manage all model connections.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;584-what-is-gateway&quot;&gt;5.8.4 What is Gateway?&lt;/h4&gt;
&lt;p&gt;Gateway is OpenClaw’s &lt;strong&gt;backend service&lt;/strong&gt;. You can think of it as a “translator”—OpenClaw talks to various models through it.&lt;/p&gt;
&lt;p&gt;Simply put:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gateway is responsible for &lt;strong&gt;centrally managing&lt;/strong&gt; connections to various models&lt;/li&gt;
&lt;li&gt;Gateway is responsible for &lt;strong&gt;handling authentication&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Gateway is responsible for &lt;strong&gt;forwarding requests&lt;/strong&gt; to different model providers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Architecture Diagram&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;You&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;OpenClaw CLI (where you enter commands)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Gateway (manages connections)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Model Providers&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(MiniMax / Qwen / OpenRouter / Ollama)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why is Gateway needed?&lt;/strong&gt; Through Gateway as a unified entry point, OpenClaw can conveniently connect to various different model providers without configuring separate connection methods for each model.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;585-install-gateway&quot;&gt;5.8.5 Install Gateway&lt;/h4&gt;
&lt;p&gt;Gateway is usually automatically included when you install OpenClaw. If you need to install separately:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g @openclaw&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;gateway&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;586-start-gateway&quot;&gt;5.8.6 Start Gateway&lt;/h4&gt;
&lt;p&gt;Gateway is OpenClaw’s core running process, responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Managing model connections&lt;/li&gt;
&lt;li&gt;Providing HTTP / WebSocket API&lt;/li&gt;
&lt;li&gt;Providing web control interface&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Start Gateway (Recommended)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The simplest way is to run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command starts the Gateway service. After starting, the default is:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;http listener: //127.0.0.1:18789&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can open this address in your browser to access the web control interface for model configuration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Parameters&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you need customization, you can use these parameters:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Parameter&lt;/th&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--port&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Specify port number&lt;/td&gt;&lt;td&gt;&lt;code&gt;--port 8080&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--verbose&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Show detailed logs for troubleshooting&lt;/td&gt;&lt;td&gt;&lt;code&gt;--verbose&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Force occupy the port&lt;/td&gt;&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Start with specified port&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Show detailed logs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;verbose&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Force occupy when port is in use&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;force&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;587-advanced-configuration-optional&quot;&gt;5.8.7 Advanced Configuration (Optional)&lt;/h4&gt;
&lt;p&gt;If you want to further customize Gateway:&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Option&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--hot-reload&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Enable hot-reload, no restart needed for config changes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;SIGUSR1&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Send signal to restart Gateway (Linux/macOS)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--config&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Specify config file path&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Hot-reload mode&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;18789&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;hot&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;reload&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;method-1-cli-command-configuration&quot;&gt;Method 1: CLI Command Configuration&lt;/h3&gt;
&lt;p&gt;Use &lt;code&gt;openclaw config set&lt;/code&gt; command to directly configure model parameters.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Syntax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.provider_name&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.example.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;model_id&quot;, &quot;name&quot;: &quot;display_name&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; (Configuring MiniMax):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw config set &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;models.providers.minimax&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;json &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;baseUrl&quot;: &quot;https://api.minimaxi.com/v1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;apiKey&quot;: &quot;your_MiniMax_API_Key&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;api&quot;: &quot;openai-completions&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &quot;models&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    { &quot;id&quot;: &quot;MiniMax-M2.5&quot;, &quot;name&quot;: &quot;MiniMax M2.5&quot; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Fast, good for automation scripts
&lt;strong&gt;Cons&lt;/strong&gt;: Need to remember command syntax&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;method-2-edit-config-file&quot;&gt;Method 2: Edit Config File&lt;/h3&gt;
&lt;p&gt;Directly edit OpenClaw’s config file &lt;code&gt;claude.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Config file location:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows: &lt;code&gt;%USERPROFILE%\.openclaw\claude.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;macOS/Linux: &lt;code&gt;~/.openclaw/claude.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example Config&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;models&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;providers&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;minimax&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;baseUrl&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;https://api.minimaxi.com/v1&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;apiKey&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;your_MiniMax_API_Key&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;api&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;openai-completions&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;models&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          { &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MiniMax-M2.5&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;MiniMax M2.5&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Batch configuration easy, easy to backup
&lt;strong&gt;Cons&lt;/strong&gt;: Need to manually edit JSON format&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;method-3-web-page-configuration-recommended-for-beginners&quot;&gt;Method 3: Web Page Configuration (Recommended for Beginners)&lt;/h3&gt;
&lt;p&gt;Besides command line and config files, you can also configure models through the &lt;strong&gt;Web Interface&lt;/strong&gt;. This method is more intuitive and suitable for beginners.&lt;/p&gt;
&lt;h4 id=&quot;step-1-start-gateway&quot;&gt;Step 1: Start Gateway&lt;/h4&gt;
&lt;p&gt;Gateway not only provides API services but also has a built-in web control interface. Run in terminal:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command starts the Gateway service and runs in the background.&lt;/p&gt;
&lt;h4 id=&quot;step-2-open-browser-to-access&quot;&gt;Step 2: Open Browser to Access&lt;/h4&gt;
&lt;p&gt;Gateway’s web interface default address is:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;http://127.0.0.1:18789&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Open this address in your browser—you’ll see the Gateway management interface.&lt;/p&gt;
&lt;h4 id=&quot;step-3-enter-configuration-page&quot;&gt;Step 3: Enter Configuration Page&lt;/h4&gt;
&lt;p&gt;Find and click in the interface:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Config → Models&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Here you can manage all model configurations.&lt;/p&gt;
&lt;h4 id=&quot;step-4-add-provider-configuration&quot;&gt;Step 4: Add Provider Configuration&lt;/h4&gt;
&lt;p&gt;Taking adding MiniMax as an example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Add Provider&lt;/strong&gt; or similar button&lt;/li&gt;
&lt;li&gt;Select or fill in Provider type&lt;/li&gt;
&lt;li&gt;Fill in the following information:&lt;/li&gt;
&lt;/ol&gt;

















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Base URL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;https://api.minimaxi.com/v1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Key&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Your MiniMax API Key&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Enable &lt;strong&gt;Auth Header&lt;/strong&gt; option (if needed)&lt;/li&gt;
&lt;li&gt;Fill in API Key&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;step-5-save-configuration&quot;&gt;Step 5: Save Configuration&lt;/h4&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt; or &lt;strong&gt;Update&lt;/strong&gt; button to save the configuration.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: After saving, Gateway will automatically refresh the config. You may need to restart OpenClaw for changes to take effect.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The benefits of this method:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visual operation, no need to remember commands&lt;/li&gt;
&lt;li&gt;See configuration status in real-time&lt;/li&gt;
&lt;li&gt;Suitable for users unfamiliar with command line&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;6-using-cc-switch-to-manage-apis-recommended&quot;&gt;6. Using cc-switch to Manage APIs (Recommended)&lt;/h2&gt;
&lt;p&gt;If you’ve configured multiple model providers, manually changing config each time can be tedious. &lt;strong&gt;cc-switch&lt;/strong&gt; is a cross-platform desktop tool that helps you switch between different AI API configurations with one click. It supports Claude Code, OpenClaw, Gemini, and more.&lt;/p&gt;
&lt;h3 id=&quot;61-why-use-cc-switch&quot;&gt;6.1 Why Use cc-switch?&lt;/h3&gt;
&lt;p&gt;Problems with manually managing API Keys:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Need to separately configure environment variables for each provider&lt;/li&gt;
&lt;li&gt;Switching models requires modifying JSON config&lt;/li&gt;
&lt;li&gt;Easy to get confused with multiple accounts/providers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;cc-switch advantages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visual interface, no need to edit command line configs&lt;/li&gt;
&lt;li&gt;One-click provider switching&lt;/li&gt;
&lt;li&gt;Supports MCP server management&lt;/li&gt;
&lt;li&gt;Supports Skills/Prompts presets&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;62-how-cc-switch-works&quot;&gt;6.2 How cc-switch Works&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: cc-switch writes the currently enabled provider configuration to &lt;strong&gt;environment variables&lt;/strong&gt;. When OpenClaw starts, it automatically reads these environment variables, so you &lt;strong&gt;don’t need to manually edit OpenClaw’s config file&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is the convenience of cc-switch: you just switch the provider in cc-switch, then start OpenClaw, and it will automatically use the current configuration.&lt;/p&gt;
&lt;h3 id=&quot;63-install-cc-switch&quot;&gt;6.3 Install cc-switch&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://github.com/farion1231/cc-switch/releases&quot;&gt;cc-switch GitHub Releases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download &lt;code&gt;CC-Switch-v{version}-Windows.msi&lt;/code&gt; or portable version&lt;/li&gt;
&lt;li&gt;Run the installer&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;macOS&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;brew&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; tap&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; farion1231/ccswitch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;brew&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --cask&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; cc-switch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;Supports .deb, .rpm, .AppImage and other formats.&lt;/p&gt;
&lt;h3 id=&quot;64-add-provider&quot;&gt;6.4 Add Provider&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Start cc-switch&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;”+”&lt;/strong&gt; in the top right or “Add Provider”&lt;/li&gt;
&lt;li&gt;Select preset provider (MiniMax, Qwen, etc.)&lt;/li&gt;
&lt;li&gt;Fill in your API Key&lt;/li&gt;
&lt;li&gt;Click “Add”&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;65-switch-provider&quot;&gt;6.5 Switch Provider&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;In the main interface, select the provider you want to use&lt;/li&gt;
&lt;li&gt;Click “Enable”&lt;/li&gt;
&lt;li&gt;Restart OpenClaw (if it’s running)&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;66-openclaw-automatically-uses-current-config&quot;&gt;6.6 OpenClaw Automatically Uses Current Config&lt;/h3&gt;
&lt;p&gt;cc-switch writes the currently enabled provider configuration to environment variables. When OpenClaw starts, it automatically reads these environment variables, so you only need to:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# After switching provider, restart OpenClaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw restart&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# or&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OpenClaw will automatically use the API configuration currently enabled in cc-switch.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;7-starting-and-using&quot;&gt;7. Starting and Using&lt;/h2&gt;
&lt;p&gt;After configuring the model, you’re ready to use it.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Interactive chat&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Start web service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw serve &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3000&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Start Gateway (if not auto-started)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Web panel&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw dashboard&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just type text to chat. If tools are configured, it can also help you operate files, search for information, and more.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;8-recommended-configurations&quot;&gt;8. Recommended Configurations&lt;/h2&gt;
&lt;p&gt;For different scenarios, here’s a reference:&lt;/p&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Scenario&lt;/th&gt;&lt;th&gt;Recommended Model&lt;/th&gt;&lt;th&gt;Reason&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Programming&lt;/td&gt;&lt;td&gt;qwen/qwen3-coder&lt;/td&gt;&lt;td&gt;Specifically optimized for coding, good GitHub integration&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vision Understanding&lt;/td&gt;&lt;td&gt;qwen-portal/vision-model&lt;/td&gt;&lt;td&gt;Supports image understanding&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Daily Chat&lt;/td&gt;&lt;td&gt;MiniMax-M2.5&lt;/td&gt;&lt;td&gt;Good Chinese understanding, great cost-performance&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Deep Reasoning&lt;/td&gt;&lt;td&gt;Qwen3-Max&lt;/td&gt;&lt;td&gt;Strong capability&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Local Offline&lt;/td&gt;&lt;td&gt;Ollama qwen2.5:3b&lt;/td&gt;&lt;td&gt;Mainstream config usable, completely free&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;My usual combo&lt;/strong&gt;: Use MiniMax for daily use, switch to qwen/qwen3-coder for programming.&lt;/p&gt;
&lt;p&gt;Switching models is easy:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Switch to MiniMax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set minimax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;MiniMax&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;M2.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Switch to Qwen for programming&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen3&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;coder&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Switch to Qwen Vision&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw models set qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;qwen&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;portal&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;vision&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;model&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;9-common-issues&quot;&gt;9. Common Issues&lt;/h2&gt;
&lt;h3 id=&quot;command-not-found&quot;&gt;Command Not Found&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Check if installed&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm list &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Restart PowerShell and try again&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# If still not working, reinstall&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm install &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;g openclaw@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;api-key-error&quot;&gt;API Key Error&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Check if Key is correct, no extra spaces&lt;/li&gt;
&lt;li&gt;Check if there’s still balance&lt;/li&gt;
&lt;li&gt;Recommended to use environment variable method&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;ollama-connection-failed&quot;&gt;Ollama Connection Failed&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Confirm Ollama is running&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ollama list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Try accessing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;curl http:&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;localhost:&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;11434&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;gateway-connection-failed&quot;&gt;Gateway Connection Failed&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Confirm Gateway is running&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# If port is occupied, add --force to force start&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;force&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Or specify another port&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;openclaw gateway run &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;response-too-slow&quot;&gt;Response Too Slow&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Remote API: Check network, or try another model&lt;/li&gt;
&lt;li&gt;Ollama: Consider using smaller models like &lt;code&gt;qwen2.5:3b&lt;/code&gt; or quantized version &lt;code&gt;qwen2.5:3b-q4_K_M&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;installation-script-error&quot;&gt;Installation Script Error&lt;/h3&gt;
&lt;p&gt;Confirm execution policy is changed:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ExecutionPolicy RemoteSigned &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Scope CurrentUser&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;10-alternative-tencent-workflow-ai-workbuddy&quot;&gt;10. Alternative: Tencent Workflow AI (WorkBuddy)&lt;/h2&gt;
&lt;p&gt;If you find OpenClaw deployment too complicated, consider &lt;strong&gt;&lt;a href=&quot;https://copilot.tencent.com/work/&quot;&gt;Tencent Workflow AI&lt;/a&gt;&lt;/strong&gt; (also known as &lt;strong&gt;WorkBuddy&lt;/strong&gt;).&lt;/p&gt;
&lt;h3 id=&quot;what-is-workbuddy&quot;&gt;What is WorkBuddy?&lt;/h3&gt;
&lt;p&gt;WorkBuddy is an AI programming assistant released by Tencent, similar to Cursor and Windsurf products. It &lt;strong&gt;doesn’t require local deployment&lt;/strong&gt;—just use VS Code or JetBrains plugins directly.&lt;/p&gt;
&lt;h3 id=&quot;features-1&quot;&gt;Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No deployment needed&lt;/strong&gt;: Install plugin and use immediately&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generous free credits&lt;/strong&gt;: Tencent provides free usage quotas&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Well-optimized for Chinese&lt;/strong&gt;: Friendly for Chinese developers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integrates Tencent ecosystem&lt;/strong&gt;: Can connect to WeChat, Tencent Cloud, and other services&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;who-its-for&quot;&gt;Who It’s For&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Programming beginners who don’t want to deal with environment setup&lt;/li&gt;
&lt;li&gt;Those who want a plug-and-play experience&lt;/li&gt;
&lt;li&gt;Those who simply want to experience AI programming assistance&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;comparison-with-openclaw&quot;&gt;Comparison with OpenClaw&lt;/h3&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;OpenClaw&lt;/th&gt;&lt;th&gt;WorkBuddy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Deployment&lt;/td&gt;&lt;td&gt;Local deployment&lt;/td&gt;&lt;td&gt;No deployment needed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Customization&lt;/td&gt;&lt;td&gt;High&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Learning curve&lt;/td&gt;&lt;td&gt;Higher&lt;/td&gt;&lt;td&gt;Lower&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cost&lt;/td&gt;&lt;td&gt;Free/Paid&lt;/td&gt;&lt;td&gt;Has free credits&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;: If you just want to experience AI programming assistance, WorkBuddy is a simpler choice. If you want higher customization and scalability, OpenClaw is still the better choice.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This tutorial might still not be detailed enough, but I’ve written a very basic detailed configuration tutorial. I’ll update with more detailed LLM parameter explanations later. I may also update detailed tutorials on integrating OpenClaw with Feishu and more.&lt;/p&gt;</content:encoded><category>OpenClaw</category><category>AI</category><category>MiniMax</category><category>Qwen</category><category>Ollama</category><category>OpenRouter</category><category>OpenAI</category><category>Tutorial</category></item><item><title>如何注册一个 Cloudflare 域名</title><link>https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-cn/</guid><description>详细教程：一步一步教你如何在 Cloudflare 注册域名、完成 DNS 配置，并将域名用于部署网站或博客。</description><pubDate>Sun, 08 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;我前段时间打算给我的博客网站增加一些功能，例如 GitHub 登录、Cloudflare 全家桶、SEO 优化什么的，很可惜。都因为我没有域名，总是因为一些原因而失败。于是我想了想，一年几十块买个域名，也不算贵，因为我之前也搞过，只不过不是我出钱。&lt;/p&gt;
&lt;h2 id=&quot;为什么选择-cloudflare-注册域名&quot;&gt;为什么选择 &lt;a href=&quot;https://www.cloudflare.com/&quot;&gt;Cloudflare&lt;/a&gt; 注册域名？&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.cloudflare.com/products/registrar/&quot;&gt;Cloudflare Registrar&lt;/a&gt; 最大的特点是&lt;strong&gt;不赚差价&lt;/strong&gt;。它不像传统注册商那样靠域名盈利，而是以此作为进入其生态系统的入口。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;真正的批发价&lt;/strong&gt;：Cloudflare 承诺永久以&lt;strong&gt;成本价&lt;/strong&gt;销售域名。你支付的每一分钱都是直接交给注册局，CF 不加收任何服务费，且续费价格固定，没有“首年低价、次年暴涨”的套路。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;免费隐私保护&lt;/strong&gt;：默认提供 WHOIS 隐私保护，隐藏你的姓名、邮箱和地址。而在其他平台，这可能是一项年费支出。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;顶级安全防护&lt;/strong&gt;：免费赠送企业级 &lt;strong&gt;DNSSEC&lt;/strong&gt; 防止域名劫持，并支持硬件密钥（如 YubiKey）登录，安全性拉满。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;管理一步到位&lt;/strong&gt;：如果你打算用 Cloudflare 部署博客，域名在这里买可以省去修改 DNS 的等待时间，证书申请和解析都是秒级自动完成。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以在 Cloudflare 购买域名算是批发价格了，我下面提供一个表格，来对比一下 Cloudflare 和阿里云、腾讯云之类的区别。&lt;/p&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;维度&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Cloudflare&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;传统云厂商 (阿里/腾讯/Namecheap)&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;定价&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;成本价，无溢价&lt;/td&gt;&lt;td&gt;市场价，首年优惠次年贵&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;隐私保护&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;默认免费开启&lt;/td&gt;&lt;td&gt;免费或需额外购买&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;管理体验&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;开发者友好，集成度极高&lt;/td&gt;&lt;td&gt;功能分散，配置较多&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;备案支持&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;不支持&lt;/strong&gt;国内工信部备案&lt;/td&gt;&lt;td&gt;&lt;strong&gt;支持&lt;/strong&gt;国内工信部备案&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Cloudflare唯一存在一点不足，那就是不支持国内工信部备案，所以根据你的需求，是否一定要做工信部备案。对于我而言，我觉得目前不是特别有必要，我的服务托管到Cloudflare上了，唯一的支出也就域名了还能接受，并且白嫖Cloudflare的CDN国内访问也不是太大问题。如果我后续可能几年后有需要国内备案，那我就得再去整个国内服务器，还要买个国内域名了。&lt;/p&gt;
&lt;p&gt;所以对于&lt;strong&gt;不打算备案、使用 Cloudflare 生态&lt;/strong&gt;的个人博客来说，&lt;strong&gt;CF 就是域名的终点站。&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;准备工作&quot;&gt;准备工作&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Cloudflare 账户&lt;/li&gt;
&lt;li&gt;Visa 银行卡或者 PayPal&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你还没有注册  &lt;a href=&quot;https://www.cloudflare.com/&quot;&gt;Cloudflare&lt;/a&gt; 账户，那就注册一个，Google 账号登录或者 GitHub 登录即可，点击该超链接。&lt;/p&gt;
&lt;p&gt;对于 Visa 卡和 PayPal，对于国内读者可能有点难办了，因为需求原因，平时都没有用过。如果你找不到个哥们什么的帮你代付，你只能自己想办法了，很多银行其实有提供给学生的支持 Visa 的信用卡，以下内容我以工商银行的星座卡学生办举例（没有支付问题的朋友可以自行跳过，并非广告，解决国内学生朋友的问题）。&lt;/p&gt;
&lt;h3 id=&quot;支付准备工作&quot;&gt;支付准备工作&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;此处以工行星座卡校园版申请举例&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;申请条件&lt;/strong&gt;：需&lt;strong&gt;本科以上&lt;/strong&gt;学历，学生卡尽量不超过2~3张（1+1套卡算1张），网贷（花呗，白条等）账户尽量不超过2&lt;strong&gt;个&lt;/strong&gt;（其实一般你不乱搞什么的都有资质办理）&lt;/p&gt;
&lt;p&gt;星座卡特点：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;银联（人民币）+Visa（外币）套卡，卡等级为普卡，有效期内免年费（约等于永免）。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;绝大部分地区的校园版是&lt;strong&gt;0额度&lt;/strong&gt;！非校园版需有实习/工作单位。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;11币种账户&lt;/strong&gt;，但对征信无碍，放心申。&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;申请步骤&quot;&gt;&lt;em&gt;申请步骤：&lt;/em&gt;&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;打开中国工商银行app，点击顶部的搜索框输入星座卡学生办&lt;/li&gt;
&lt;li&gt;在页面中产品一栏，选择宇宙星座卡校园版（VISA+银联）&lt;/li&gt;
&lt;li&gt;按照流程填写信息，以及信用卡的邮寄地址&lt;/li&gt;
&lt;li&gt;等到银行卡拿到后，你就可以去线下网点激活了&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;当然你也可以直接去线下网点办理，不过要注意不要异地办理，例如你可能填写的注册银行是你家那边的支行，但是你在外省读大学，可能到了外省的线下网点就无法激活了，所以还是建议选一个你方便激活的银行地址。&lt;/p&gt;
&lt;h4 id=&quot;转换美元&quot;&gt;转换美元&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;打开中国工商银行app，点击顶部的搜索框输入美元兑换&lt;/li&gt;
&lt;li&gt;在产品栏看到结售汇，点击选择购汇&lt;/li&gt;
&lt;li&gt;币种选择美元然后按照你的需求购买&lt;/li&gt;
&lt;li&gt;受到短信后检查一下对应银行卡的美元余额&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;记住不要美元余额刚刚好是你的域名价格，因为境外网站可能对支付会有最低额度的设置。&lt;/p&gt;
&lt;p&gt;我还是很建议你办一张Visa卡，总有用到的时候。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;cloudflare-注册域名步骤&quot;&gt;Cloudflare 注册域名步骤&lt;/h2&gt;
&lt;p&gt;点击进入以下网址 &lt;a href=&quot;https://www.cloudflare.com/zh-cn/products/registrar/&quot;&gt;https://www.cloudflare.com/zh-cn/products/registrar/&lt;/a&gt;，你可以看一下 Cloudflare 的域名注册介绍，这个网址也很容易搜到，在搜索引擎搜查 Cloudflare 域名购买就可以直达。你也可以选择左侧导航面板点击： 域注册 → 注册域，或者直接点击链接访问：&lt;a href=&quot;https://dash.cloudflare.com/domains&quot;&gt;https://dash.cloudflare.com/domains&lt;/a&gt;（右上角可以选择切换语言）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;搜索你需要的域名，我们以danarnoux为例，可以看到有很多后缀的域名&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;至于这些域名后缀代表什么，我为您提供一份表格进行参考&lt;/p&gt;





















































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;后缀&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;类型&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;建议使用场景&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;特点&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.com&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;通用&lt;/td&gt;&lt;td&gt;&lt;strong&gt;首选&lt;/strong&gt;。个人博客、品牌、商业&lt;/td&gt;&lt;td&gt;全球认可度最高，用户心智首选，利于 SEO。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.net&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;通用&lt;/td&gt;&lt;td&gt;网络服务、技术博客、替代方案&lt;/td&gt;&lt;td&gt;历史悠久，专业感强，常作为 .com 被占用后的备份。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.org&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;非营利&lt;/td&gt;&lt;td&gt;开源项目、社区、公益组织&lt;/td&gt;&lt;td&gt;带有信任感和权威性，适合非营利性技术社区。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.io&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;技术&lt;/td&gt;&lt;td&gt;&lt;strong&gt;技术博客&lt;/strong&gt;、开发者工具、初创公司&lt;/td&gt;&lt;td&gt;在程序员圈子极受欢迎，代表 Input/Output，极简且酷。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.me&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;个人&lt;/td&gt;&lt;td&gt;&lt;strong&gt;个人简历&lt;/strong&gt;、生活随笔、作品集&lt;/td&gt;&lt;td&gt;个性化极强，非常适合强调“自我”品牌的个人博客。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.info&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;信息&lt;/td&gt;&lt;td&gt;知识库、资讯网站、说明文档&lt;/td&gt;&lt;td&gt;价格通常较便宜，适合做纯信息展示类项目。&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.dev&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;开发者&lt;/td&gt;&lt;td&gt;编程教程、代码库、开发日志&lt;/td&gt;&lt;td&gt;谷歌推出的后缀，强制 HTTPS 安全加密，极具辨识度。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;你可能会注意到.uk的价格比.com接近便宜一倍，那我是不是可以购买这个？我的建议是，&lt;strong&gt;这个便宜还是不贪为妙&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.uk&lt;/strong&gt; 是英国（United Kingdom）的国家代码顶级域名（ccTLD）。它由 Nominet 机构管理，类似于中国的 &lt;code&gt;.cn&lt;/code&gt; 或美国的 &lt;code&gt;.us&lt;/code&gt;。可以购买，但有“&lt;strong&gt;英国地址&lt;/strong&gt;”要求。如果你没有英国地址，很多注册商（包括 Cloudflare）可能会拒绝你注册，或者要求你使用代理服务。如果你随意填写虚假的英国地址，一旦被管理机构抽查，域名可能会被直接封禁（Suspended）。&lt;/p&gt;
&lt;p&gt;权衡一下，选择你想要的域名即可。记得注意一下有无被注册以及&lt;strong&gt;续费价格&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;购买-cloudflare-域名&quot;&gt;购买 Cloudflare 域名&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;选择好域名后，点击Confirm确认&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;按年计费&lt;/strong&gt;，选择你要购买的年份，注意选择支付方式后的 &lt;strong&gt;Automatic renewal&lt;/strong&gt;（自动续期），选择是否勾选&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;填写相关信息，以及发票信息&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;选择银行卡支付的时候，一定要注意不要输错安全码，输错三次银行卡会被锁，后续只能挂失新开一张银行卡了。（银行卡）&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;如果你支付的时候出现银行卡被拒绝的情况，检查一下账户内美元余额，安全码是否输错，卡号是否输对，实在不行可以联系银行客服。在我支付的时候，还出现了一种问题，估计是地理位置和ip不一致被支付网关拒绝了，说人话就是我停止使用香港节点进行支付成功了。如果你也出现了这种情况，可以试试，只是支付会慢一点。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;支付成功后，检查邮箱的发票以及银行卡余额。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;去左侧仪表盘内点击Domains，检查是否存在购买的域名。&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;域名解析与-dns-设置&quot;&gt;域名解析与 DNS 设置&lt;/h2&gt;
&lt;p&gt;点击左侧面板的 &lt;strong&gt;Domains&lt;/strong&gt;，点击右侧的三个点进入配置页面配置 DNS。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以参照我的设置选择 CNAME 进行解析，打码的内容为不重要，&lt;strong&gt;Cloudflare Proxy&lt;/strong&gt;（即橙色云）可默认勾选，提升网站速度和安全性。设置完后记得保存&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;结语&quot;&gt;结语&lt;/h2&gt;
&lt;p&gt;对于 SSL/TLS 加密的内容本篇文章不再赘述，一般情况下 Cloudflare 会默认给域名配置通用证书。后续我会提供更多内容，例如如何做好 SEO，如何做 GitHub OAuth 等内容。敬请关注&lt;/p&gt;
&lt;p&gt;Video Guide:【Cloudflare域名注册教程|step by step|包含支付问题解答】 &lt;a href=&quot;https://www.bilibili.com/video/BV1tvc6z1EfD/?share_source=copy_web&amp;#x26;vd_source=b29b2491306fe84f395d46cf297dc405&quot;&gt;https://www.bilibili.com/video/BV1tvc6z1EfD/?share_source=copy_web&amp;#x26;vd_source=b29b2491306fe84f395d46cf297dc405&lt;/a&gt;&lt;/p&gt;</content:encoded><category>Cloudflare</category><category>Domain</category><category>guide</category><category>CN</category></item><item><title>Cloudflare Domain Registration Guide</title><link>https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-en/</guid><description>A step-by-step tutorial on registering a domain with Cloudflare, configuring DNS, and using it for your website or blog.</description><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I wanted to add some features to my blog lately—GitHub login, Cloudflare ecosystem, SEO optimization, you name it. Problem is, I didn’t have a domain name. Every time I tried to set something up, it just… failed because of that. So I figured, why not just buy one? It’s not that expensive—maybe a few dozen bucks a year. I’ve done this before anyway, just never paid for it myself.&lt;/p&gt;
&lt;h2 id=&quot;why-choose-cloudflare-for-domain-registration&quot;&gt;Why Choose &lt;a href=&quot;https://www.cloudflare.com/&quot;&gt;Cloudflare&lt;/a&gt; for Domain Registration?&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.cloudflare.com/products/registrar/&quot;&gt;Cloudflare Registrar&lt;/a&gt; stands out because they &lt;strong&gt;don’t markup prices&lt;/strong&gt;. Unlike traditional registrars that profit from domain sales, Cloudflare uses domains as a gateway to their ecosystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;True wholesale pricing&lt;/strong&gt;: Cloudflare promises to sell domains at &lt;strong&gt;cost forever&lt;/strong&gt;. Every penny you pay goes directly to the registry—no hidden fees, and renewal prices stay the same. No “cheap first year, expensive second year” tricks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free privacy protection&lt;/strong&gt;: WHOIS privacy protection comes standard, hiding your name, email, and address. Other registrars often charge extra for this.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Top-tier security&lt;/strong&gt;: Free enterprise-grade &lt;strong&gt;DNSSEC&lt;/strong&gt; to prevent domain hijacking, plus hardware key support (like YubiKey) for login. Maximum security.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;All-in-one management&lt;/strong&gt;: If you’re deploying on Cloudflare anyway, buying your domain here saves you the DNS wait time. Certificate requests and DNS resolution happen automatically.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here’s a quick comparison:&lt;/p&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Cloudflare&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Traditional Registrars (Aliyun/Tencent/Namecheap)&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pricing&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Cost price, no markup&lt;/td&gt;&lt;td&gt;Market price, cheap first year, expensive renewal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Privacy&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Free by default&lt;/td&gt;&lt;td&gt;Free or extra cost&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Experience&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer-friendly, high integration&lt;/td&gt;&lt;td&gt;Feature-spread, more config needed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ICP License&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Not supported&lt;/strong&gt; (China MIIT)&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Supported&lt;/strong&gt; (China MIIT)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;One downside: Cloudflare doesn’t support China MIIT ICP filing. Whether you need that depends on your situation. For me, it’s not really necessary—my hosting is on Cloudflare, the only real cost is the domain, and Cloudflare’s CDN works fine in China. If I ever need ICP filing later, I’d need to get a Chinese server and a Chinese domain.&lt;/p&gt;
&lt;p&gt;So if you’re not planning to file in China and you’re using Cloudflare’s ecosystem, &lt;strong&gt;Cloudflare is the endpoint for domains.&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Cloudflare account&lt;/li&gt;
&lt;li&gt;Visa card or PayPal&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don’t have a Cloudflare account yet, just sign up with your Google or GitHub account.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;payment-prep-icbc-student-card-example&quot;&gt;Payment Prep (ICBC Student Card Example)&lt;/h3&gt;
&lt;p&gt;For international payments like Visa or PayPal, it can be tricky if you’re in China. If you can’t find someone to help you pay, you’ll need your own solution. Many banks offer Visa cards for students—here’s an example with ICBC’s Star Sign Card (this is just to help fellow students, not an ad).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Application requirements&lt;/strong&gt;: Undergraduate or above, try to keep student cards under 2-3, online loans (Huabei, Baitiao, etc.) under 2 accounts.&lt;/p&gt;
&lt;p&gt;Card features:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;UnionPay (CNY) + Visa (foreign currency) combo card, regular card, free annual fee.&lt;/li&gt;
&lt;li&gt;Campus version has &lt;strong&gt;0 credit limit&lt;/strong&gt; in most regions! Non-campus version requires work/internship proof.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;11 currency accounts&lt;/strong&gt;—doesn’t affect credit score.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Application steps&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open ICBC app, search “星座卡学生办” (Star Sign Student)&lt;/li&gt;
&lt;li&gt;Select 宇宙星座卡校园版 (VISA + UnionPay)&lt;/li&gt;
&lt;li&gt;Fill in your info and mailing address&lt;/li&gt;
&lt;li&gt;Once you get the card, activate it at a nearby branch&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: Don’t apply in a different city from where you registered. If your bank is in your hometown but you’re studying in another province, you might not be able to activate it. Pick a convenient location.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Converting to USD&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open ICBC app, search “美元兑换”&lt;/li&gt;
&lt;li&gt;Select 结售汇 → 购汇&lt;/li&gt;
&lt;li&gt;Buy USD as needed&lt;/li&gt;
&lt;li&gt;Check your card’s USD balance after getting the SMS&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Don’t just have exactly enough USD for your domain—some international sites have minimum payment amounts. Worth getting a Visa card anyway, you’ll use it eventually.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;cloudflare-domain-registration-steps&quot;&gt;Cloudflare Domain Registration Steps&lt;/h2&gt;
&lt;p&gt;Go to &lt;a href=&quot;https://www.cloudflare.com/products/registrar/&quot;&gt;https://www.cloudflare.com/products/registrar/&lt;/a&gt; to learn about Cloudflare’s domain registration. You can also find it by searching “Cloudflare domain purchase” or go directly to &lt;a href=&quot;https://dash.cloudflare.com/domains&quot;&gt;https://dash.cloudflare.com/domains&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step1.png&quot; alt=&quot;Search domain&quot;&gt;&lt;/p&gt;
&lt;p&gt;Search for your desired domain. Let’s use danarnoux as example—you’ll see many TLD options.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step2.png&quot; alt=&quot;Domain results&quot;&gt;&lt;/p&gt;
&lt;p&gt;Here’s a quick reference for common TLDs:&lt;/p&gt;





















































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;strong&gt;TLD&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/th&gt;&lt;th&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.com&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Generic&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Top choice&lt;/strong&gt;. Blogs, brands&lt;/td&gt;&lt;td&gt;Highest recognition, good for SEO.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.net&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Generic&lt;/td&gt;&lt;td&gt;Tech blogs, network services&lt;/td&gt;&lt;td&gt;Professional, good .com backup.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.org&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Non-profit&lt;/td&gt;&lt;td&gt;Open source, communities&lt;/td&gt;&lt;td&gt;Trustworthy, great for non-profit tech communities.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.io&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Tech&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Tech blogs&lt;/strong&gt;, dev tools&lt;/td&gt;&lt;td&gt;Super popular among programmers.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.me&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Personal&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Resumes&lt;/strong&gt;, portfolios&lt;/td&gt;&lt;td&gt;Perfect for personal branding.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.info&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Info&lt;/td&gt;&lt;td&gt;Knowledge bases, docs&lt;/td&gt;&lt;td&gt;Usually cheaper, good for info sites.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;.dev&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer&lt;/td&gt;&lt;td&gt;Tutorials, code repos&lt;/td&gt;&lt;td&gt;Google-owned, forced HTTPS, very recognizable.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;You might notice .uk is much cheaper than .com. My advice? &lt;strong&gt;Don’t chase the cheap price.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.uk&lt;/strong&gt; is the United Kingdom’s country code TLD, managed by Nominet (like .cn for China or .us for the US). You can buy it, but there’s a &lt;strong&gt;UK address requirement&lt;/strong&gt;. Without a UK address, many registrars (including Cloudflare) might reject your registration or require proxy services. If you provide a fake UK address, the domain could get suspended during random audits.&lt;/p&gt;
&lt;p&gt;Just pick what you want. Remember to check availability and &lt;strong&gt;renewal prices&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;buying-the-domain&quot;&gt;Buying the Domain&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select your domain and click Confirm&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose your billing period (years). Decide whether to enable &lt;strong&gt;Automatic renewal&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step3.png&quot; alt=&quot;Step 3&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Fill in your details and invoice info&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When paying with card, be careful with the security code—three wrong attempts locks your card. You’ll need to report it lost and get a new one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your card gets declined, check your USD balance, verify the security code and card number. Contact your bank if needed. One issue I ran into: payment gateway rejected me because of location/IP mismatch. I stopped using Hong Kong nodes and it worked. Try it if you have similar issues—just might be slower.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check your email for the invoice and card balance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Domains&lt;/strong&gt; in the sidebar to confirm your purchased domain is there.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;dns-settings&quot;&gt;DNS Settings&lt;/h2&gt;
&lt;p&gt;Click &lt;strong&gt;Domains&lt;/strong&gt; in the sidebar, then the three dots to configure DNS.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step4.png&quot; alt=&quot;Step 4&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can follow my setup—use CNAME for analysis. The redacted parts aren’t important. &lt;strong&gt;Cloudflare Proxy&lt;/strong&gt; (the orange cloud) should be enabled by default for better speed and security. Don’t forget to save.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-register-a-cloudflare-domain/step5.png&quot; alt=&quot;Step 5&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping Up&lt;/h2&gt;
&lt;p&gt;I won’t go into SSL/TLS details here—Cloudflare sets up a universal certificate by default. I’ll cover more in future posts, like how to do SEO right and GitHub OAuth. Stay tuned!&lt;/p&gt;
&lt;p&gt;Video Guide: &lt;a href=&quot;https://www.bilibili.com/video/BV1tvc6z1EfD/?share_source=copy_web&amp;#x26;vd_source=b29b2491306fe84f395d46cf297dc405&quot;&gt;https://www.bilibili.com/video/BV1tvc6z1EfD/?share_source=copy_web&amp;#x26;vd_source=b29b2491306fe84f395d46cf297dc405&lt;/a&gt;&lt;/p&gt;</content:encoded><category>Cloudflare</category><category>Domain</category><category>Guide</category></item><item><title>如何上手编程：工具、Git 与工程思维</title><link>https://danarnoux.com/blog/how-to-get-started-with-programming-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-get-started-with-programming-cn/</guid><description>从开发环境搭建到版本控制，再到语言选择与工程思维，本指南为初学者提供一条完整而清晰的入门路径。</description><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;我一直认为，人无法想象自己认知以外的事。尽管现在AI再这么强大，你或许还是没法用ai搓出一个满意的作品。你也有时候会焦虑，既然ai这么强大，那我学怎么编程还有意义？岂不是后面程序员都会被AI代替了？&lt;/p&gt;
&lt;p&gt;我知道你有很多疑惑，但是在我看来，时代在变化答案每天都在改变，今天适用的法则未必适用于明天，明天适用的法则也不一定适用于今天。比起一切浑然不知云里雾里，我更希望你对一个事物有所了解，毕竟其实这世上也没有什么神秘的事情。如有必要，最好亲身接触一下，我一直很喜欢一句话：“实践是检验真理的唯一标准”。&lt;/p&gt;
&lt;p&gt;学习一项技能是一个很光荣的事情，也会成为你一个终生的爱好。在我看来，无论看文章的你是个中学生，还是个刚上大学的大学生，都有必要学习如何使用计算机甚至写代码做项目。&lt;/p&gt;
&lt;p&gt;在我看来，所有人其实都有某一方面的天赋，只是受其环境或者经历原因，未被发掘出来而已，也许我每天都与未来的天才擦肩而过，而他们对此浑然不知。我更希望，所有有希望的学生都在年少时被一个偶然的经历激发起了对一件事的兴趣，然后开始培养一个爱好。&lt;/p&gt;
&lt;p&gt;对于我自己来说，我是浙江人，高中有门选考科目是技术，信息技术那块学的是Python。那会我们学校有个oj做题网站，大家都喜欢占着电脑做题，也在闲暇之余我们也研究过一些有趣的东西，殊不知这些东西也算是改变我们人生道路的一个开始。&lt;/p&gt;
&lt;p&gt;无论你是做工程的人，还是学文科的人，我觉得都有必要知晓其概念，这样当你做决策的时候，我不能保证你不会再迷茫，或许知道更多你会更加迷茫了，但你的脑海内会出现一个大大的问号，你开始有方向的进行思考了。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-什么是编程&quot;&gt;1. 什么是编程&lt;/h2&gt;
&lt;p&gt;编程没那么神秘，它更像一种工程表达能力：把问题拆开，把步骤排好，再让机器稳定执行。&lt;/p&gt;
&lt;p&gt;你不需要一开始就懂所有底层。先记住一件事：你写的不是炫技语法，而是一套能复现、能排错、能维护的流程。&lt;/p&gt;
&lt;h3 id=&quot;11-计算机体系里编程在什么位置&quot;&gt;1.1 计算机体系里编程在什么位置&lt;/h3&gt;
&lt;p&gt;你可以把这件事想成一条从下到上的链路。最下面是硬件，CPU、内存、硬盘都在这一层。CPU 还有自己的架构（x86、ARM），它决定了机器能听懂哪一套指令。&lt;/p&gt;
&lt;p&gt;再往上是操作系统（Windows / Linux / macOS）。它负责把硬件管起来，再给程序一套统一入口。你写代码时调用文件、网络、窗口，背后都是系统在接住。&lt;/p&gt;
&lt;p&gt;编程语言在中间扮演翻译层。你写的是 Python 或 C，机器最后执行的是更底层的指令。最上面才是应用程序，也就是你每天点开的浏览器、编辑器，或者你自己写的小工具。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows 和 Linux 是什么？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Windows 和 Linux 都是操作系统，不是编程语言。你可以这样理解：它们是“管家”，负责把硬件资源分配好，再把规则定清楚。&lt;/p&gt;
&lt;p&gt;我见过很多新手一开始会把“会用 Windows”当成“会编程”，这很正常。操作系统更像是运行环境，它决定程序怎么访问文件、怎么申请内存、怎么跟设备打交道。&lt;/p&gt;
&lt;p&gt;系统是舞台，程序是演员，语言是你写剧本的方式。把这三个角色分开，后面很多概念就不容易混。&lt;/p&gt;
&lt;h3 id=&quot;12-路径与目录path根目录相对路径&quot;&gt;1.2 路径与目录：Path、根目录、相对路径&lt;/h3&gt;
&lt;p&gt;路径你可以继续理解成地址和门牌号。程序去找文件，其实就是在问“它具体放哪儿了”。&lt;/p&gt;
&lt;p&gt;比如 &lt;code&gt;C:\Users\Dan\Desktop\learning\hello.txt&lt;/code&gt;，这是完整门牌号；你在终端里用 &lt;code&gt;cd&lt;/code&gt;，就是先把自己走到正确楼层，再去拿文件。&lt;/p&gt;
&lt;p&gt;这里有个很常见的小坑：路径里不是说中文一定不行，但在一些工具链、编码设置、老库或命令行组合里，中文目录名偶尔会出幺蛾子。为了少踩坑，平时尽量用英文路径名会更稳，比如 &lt;code&gt;test&lt;/code&gt;、&lt;code&gt;folder&lt;/code&gt;、&lt;code&gt;project&lt;/code&gt;、&lt;code&gt;data&lt;/code&gt;、&lt;code&gt;output&lt;/code&gt; 这种短词就很好用。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是根目录&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;在 Windows 里，&lt;code&gt;C:\&lt;/code&gt; 就是一个“根”。你可以把它想成省级入口，下面再分用户目录、项目目录、数据目录。路径一长，其实就是从这个入口一层层往下走。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是相对路径&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;相对路径是“相对于你当前所在目录”的写法。绝对路径像 &lt;code&gt;C:\Users\Dan\Desktop\learning\hello.txt&lt;/code&gt;，一步到位；相对路径像 &lt;code&gt;.\hello.txt&lt;/code&gt; 或 &lt;code&gt;data\input.txt&lt;/code&gt;，默认从你当前站的位置出发。&lt;/p&gt;
&lt;p&gt;相对路径报错最常见的原因，不是文件不存在，而是你站错目录了。你以为自己在 &lt;code&gt;learning&lt;/code&gt;，其实终端还停在上一级，这时候路径当然会找不到。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows 用户可跳过这一小段：&lt;/strong&gt;&lt;br&gt;
Mac 的根目录是 &lt;code&gt;/&lt;/code&gt;，个人目录通常是 &lt;code&gt;/Users/你的用户名&lt;/code&gt;。&lt;br&gt;
相对路径规则不变，常见写法还是 &lt;code&gt;./&lt;/code&gt;、&lt;code&gt;../&lt;/code&gt;。&lt;/p&gt;
&lt;h3 id=&quot;13-架构差异x86-vs-arm&quot;&gt;1.3 架构差异：x86 vs ARM&lt;/h3&gt;
&lt;p&gt;x86 和 ARM 是两种主流 CPU 架构，可以当成两种不同的“机器方言”。传统 PC 长期以 x86 为主，手机和平板基本是 ARM，新款 Mac（Apple Silicon）也是 ARM。&lt;/p&gt;
&lt;p&gt;你写的代码最终都要翻译成目标架构能执行的指令。慢慢你就会发现，同一份代码换到不同设备上，偶尔会遇到兼容性差异，这不是你写错了，很多时候只是底层平台不同。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;编程语言在这套体系中的位置&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这里最容易混淆。Python 不是系统，C 也不是 CPU。语言更像翻译层，把你的想法组织成机器能执行的形式。&lt;/p&gt;
&lt;p&gt;把这个位置想明白后，你看“系统报错”“解释器版本”“架构兼容”这些词就不会混成一团。&lt;/p&gt;
&lt;h3 id=&quot;14-编程基本概念流程脚本变量编码&quot;&gt;1.4 编程基本概念：流程、脚本、变量、编码&lt;/h3&gt;
&lt;p&gt;举个很接地气的例子：把下载目录里的图片统一改名。你要先找到目标目录，再筛出 &lt;code&gt;.jpg&lt;/code&gt; / &lt;code&gt;.png&lt;/code&gt;，然后定好排序和命名规则，最后把失败项记下来重试。&lt;/p&gt;
&lt;p&gt;你会发现，真正重要的是步骤设计，不是某个语法点背得多熟。这就是算法思维。语言只是工具，流程才是核心。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是脚本？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;脚本（script）就是为具体任务写的小程序，重点是“省重复劳动”。&lt;/p&gt;
&lt;p&gt;比如每天整理下载目录、批量改文件名、自动汇总文本，这些都很适合脚本。它未必复杂，但非常实用。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是变量？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;变量就是给数据起名字。名字起得好，你过几天回来看还能一眼看懂；名字起得随便，代码就会很快变成谜语。&lt;/p&gt;
&lt;p&gt;比如统计图片数量，用 &lt;code&gt;image_count&lt;/code&gt; 基本不用解释；写成 &lt;code&gt;a1&lt;/code&gt;，三天后你自己都要猜半天。我当年第一次写脚本时就吃过这个亏，代码能跑，但一个月后根本不想再碰。&lt;/p&gt;
&lt;p&gt;变量看起来是小事，实际上它直接影响可读性，也影响你后面的排错速度。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是编码？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;换个角度想，编码不是打字比赛，而是组织能力。你在做的是把一个想法拆成可执行的结构：变量怎么放、流程怎么走、函数怎么分、模块怎么拆。
这里说的“编码”，指的是写代码、把想法组织成程序，不是 UTF-8 这类字符编码。&lt;/p&gt;
&lt;p&gt;结构清楚，后面改需求会轻松很多。结构混乱，功能越加越痛苦。你现在不懂也正常，先从“写完自己能看懂”这件事开始就行。&lt;/p&gt;
&lt;h3 id=&quot;15-英文与报错阅读重要但别焦虑&quot;&gt;1.5 英文与报错阅读：重要但别焦虑&lt;/h3&gt;
&lt;p&gt;不用把这件事搞成压力竞赛。你不是先背完词典才能学编程。我不建议你因为学编程而现在开始准备学英语，而是边做边学。&lt;/p&gt;
&lt;p&gt;但有一件事很现实：你迟早要看英文报错、英文文档、英文 issue。能不能读懂关键内容，会直接影响你的排错速度。&lt;/p&gt;
&lt;p&gt;所以目标不是“英语满分”，而是“能看懂核心技术词，能读懂自己写的变量名和错误信息”。&lt;/p&gt;
&lt;h3 id=&quot;16-新手误区与起步心态&quot;&gt;1.6 新手误区与起步心态&lt;/h3&gt;
&lt;p&gt;我见过很多新手会卡在几个差不多的地方：只背语法不做项目，只看视频不动手，一报错就停，把 AI 当魔法不做验证，总想“再准备一下”结果一直不开工。首先对于ai来说，你啥也不知道就让他做个网站，有点像遇到不知具体需求的甲方了，大概率得到的结果不如你所愿。&lt;/p&gt;
&lt;p&gt;这些都不是能力问题，更多是节奏问题。先做一个很小的可运行结果，再逐步加复杂度，心态会稳很多。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;先选路线，再装工具&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;很多新手最容易卡在“环境要怎么装”，结果还没开始写代码就已经疲惫了。&lt;/p&gt;
&lt;p&gt;我更建议你先把方向定下来：第一门语言先 Python，然后用最小路线跑通“写 -&gt; 跑 -&gt; 改”。&lt;/p&gt;
&lt;p&gt;你先有“能跑起来”的体验，再回头看工具细节，心态和效率都会好很多。下面先讲语言选择，再讲环境搭建。&lt;/p&gt;
&lt;h2 id=&quot;2-c-还是-python&quot;&gt;2. C 还是 Python？&lt;/h2&gt;
&lt;p&gt;这一节我给一个稳妥建议：第一门语言先学 Python。无论你是文科、理工、转行，还是在校生，先 Python 都更容易建立正反馈。&lt;/p&gt;
&lt;h3 id=&quot;21-为什么先-python&quot;&gt;2.1 为什么先 Python&lt;/h3&gt;
&lt;p&gt;Python 最大的优势是反馈快。你写几行就能看到结果，这对新手特别重要，因为你会持续获得“我确实在前进”的感觉。当你在做一件事，如果能及时得到正反馈，你反而会越来越感兴趣进步的越来越快，我不是很希望一上来就整太难的人你收获满满的挫败感。&lt;/p&gt;
&lt;p&gt;它的语法也比较直观，资料和社区都很成熟，遇到问题通常能查到可用答案。我见过很多新手不是因为难度放弃，而是因为长期没有正反馈。Python 在这件事上确实更友好。&lt;/p&gt;
&lt;h3 id=&quot;22-python-10-分钟入门写到循环为止&quot;&gt;2.2 Python 10 分钟入门（写到循环为止）&lt;/h3&gt;
&lt;p&gt;先说清楚范围：这一段只带你走到循环，够你跑出第一个小程序。后面的函数、列表、字典、文件先不展开。当前内容可以在后面配完开发环境后进行验证，你也可以直接跳过到2.4&lt;/p&gt;
&lt;p&gt;变量这件事可以当成“给数据起名字”，名字清楚，代码就好读。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;Dan&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 18&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(name, age)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行后你应该看到一行输出，比如 &lt;code&gt;Dan 18&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;print()&lt;/code&gt; 是输出，&lt;code&gt;input()&lt;/code&gt; 是输入。&lt;code&gt;input()&lt;/code&gt; 拿到的是字符串，想做数字运算要先 &lt;code&gt;int()&lt;/code&gt;。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;请输入你的年龄：&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;明年你是&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;岁&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行后你输入一个数字，会看到“明年你是 xx 岁”。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;if&lt;/code&gt; 就是条件判断，满足条件才执行对应分支。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;score &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 72&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; score &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 60&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;及格&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;再练练&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行后你会看到 &lt;code&gt;及格&lt;/code&gt;（因为示例分数是 72）。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;for&lt;/code&gt; 常用于“按次数重复”。&lt;code&gt;range(5)&lt;/code&gt; 是 0 到 4，&lt;code&gt;range(1, 6)&lt;/code&gt; 是 1 到 5。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行后会按行输出 1 到 5。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;while&lt;/code&gt; 适合“满足条件就继续循环”。比如累计到 100 就停：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 100&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; n&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(total, n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行后会输出累计结果和最后一次加到的数字（例如 &lt;code&gt;105 14&lt;/code&gt; 这种形式）。&lt;/p&gt;
&lt;h3 id=&quot;23-自学入口与小作业&quot;&gt;2.3 自学入口与小作业&lt;/h3&gt;
&lt;p&gt;到循环为止你就有了起步能力，后面的函数、列表、字典、文件、模块建议自己学。核心不是“背完”，而是会查资料、会读文档、会验证结果。&lt;/p&gt;
&lt;p&gt;自学入口可以先用菜鸟教程：&lt;a href=&quot;https://www.runoob.com/&quot;&gt;https://www.runoob.com/&lt;/a&gt;。遇到新语法别急着全记，先跑一个最小例子看它到底做了什么。&lt;/p&gt;
&lt;p&gt;给你一道小作业，先做出结果，再慢慢优化：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;水仙花数&lt;/strong&gt;（也称为自恋数或阿姆斯壮数）是指一个 n 位数，其各个数字的 n 次方和等于该数本身。例如，三位数的水仙花数是指一个三位数的每个数字的立方和等于该数本身。计算方法如下：将三位数的每个数字提取出来，计算这三个数字的立方和，判断这个和是否等于原数。我需要你找出（100~999）的水仙花数&lt;br&gt;
提示：拆成百位/十位/个位，算三次方后比较是否等于原数。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;24-python-的应用场景与语言对比&quot;&gt;2.4 Python 的应用场景与语言对比&lt;/h3&gt;
&lt;p&gt;它的应用非常广。文科方向可以做文本分析、表格清洗和可视化；经济金融方向常见是指标计算和报表自动化；地理方向也能处理云图和空间数据。理工科这边也很好落地，比如实验数据清洗、批量画图、参数扫描、简单数值计算，很多重复步骤都能脚本化。再往工程一点走，自动化脚本、Web 后端、AI 数据预处理和训练脚本都很常见。你不需要一次全学会，先在自己最有感觉的场景里做出一个小结果，学习效率会高很多。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Python vs C：看一个最小示例&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;同样是打印 1 到 5：&lt;/p&gt;
&lt;p&gt;Python：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;c&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &amp;#x3C;stdio.h&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;        printf&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;%d\n&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, i);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个例子不是为了说明谁“更高级”，只是让你直观看到入门阻力差异。&lt;/p&gt;
&lt;h3 id=&quot;25-c-以后要不要学&quot;&gt;2.5 C 以后要不要学&lt;/h3&gt;
&lt;p&gt;要不要学，答案是：看方向。你先用 Python 建立编程直觉，后面如果要做底层、性能、系统方向，再补 C 会更顺。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;一条最小起步路线&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先学 Python 基础（变量、分支、循环、函数）。&lt;/li&gt;
&lt;li&gt;写一个能跑的小脚本（比如批量改名）。&lt;/li&gt;
&lt;li&gt;遇到报错就查、就改、就复跑。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这条路线跑通一次，入门就稳了。&lt;/p&gt;
&lt;h2 id=&quot;3-开发环境搭建&quot;&gt;3. 开发环境搭建&lt;/h2&gt;
&lt;h3 id=&quot;31-编辑器与-ide为什么先用-vs-code&quot;&gt;3.1 编辑器与 IDE：为什么先用 VS Code&lt;/h3&gt;
&lt;p&gt;如果你刚开始学，我更倾向先用 Visual Studio Code。&lt;/p&gt;
&lt;p&gt;先说一下 IDE 这个词。IDE（Integrated Development Environment，集成开发环境）可以理解成“工具全家桶”，里面通常包含编辑器、调试器、运行器、项目管理这些能力。像 PyCharm、Visual Studio 都属于这一类。&lt;/p&gt;
&lt;p&gt;我不建议新手一上来就用重型 IDE，不是因为它们不好，而是功能太多时你容易被界面带着走，反而看不清“代码到底怎么跑起来”。入门阶段更重要的是把这条底层流程先摸熟。&lt;/p&gt;
&lt;p&gt;VS Code 的好处是，它介于纯编辑器和重型 IDE 之间：默认轻量，按需扩展，够用但不过度。这个平衡对新手很友好。&lt;/p&gt;
&lt;p&gt;原因很实际：跨语言、插件生态成熟、内置终端够用、Git 集成也顺手。新手阶段工具越统一，心智负担越小。&lt;/p&gt;
&lt;p&gt;我当年第一次装环境也卡过，界面里一堆选项看得人头大。这很正常，先把工具链跑通，后面再慢慢调习惯。&lt;/p&gt;
&lt;p&gt;官网地址在这：&lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;先装最少插件，够用就行：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Python&lt;/code&gt;（&lt;code&gt;ms-python.python&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pylance&lt;/code&gt;（&lt;code&gt;ms-python.vscode-pylance&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Markdown All in One&lt;/code&gt;（&lt;code&gt;yzhang.markdown-all-in-one&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GitLens&lt;/code&gt;（&lt;code&gt;eamodio.gitlens&lt;/code&gt;，可选）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;32-python-插件与解释器vs-code-里到底做什么&quot;&gt;3.2 Python 插件与解释器：VS Code 里到底做什么&lt;/h3&gt;
&lt;p&gt;这个问题新手很容易混淆。&lt;code&gt;Python&lt;/code&gt; 和 &lt;code&gt;Pylance&lt;/code&gt; 插件主要做的是编辑器能力：语法高亮、补全、跳转、类型提示、调试入口这些。&lt;/p&gt;
&lt;p&gt;它会让你写代码更顺手，但它本身不是 Python 解释器。那句最关键的话是：&lt;strong&gt;VS Code 里装了 Python 插件，不代表电脑里装了 Python。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;再补一句更本质的话：VS Code 主要是“写代码和组织工程”的工作台，不是运行时本体。它可以调用你电脑里的终端、解释器和 Git，但它不会替你装好 Python 本体。你在 VS Code 里能不能跑 &lt;code&gt;python&lt;/code&gt;，最终还是取决于你系统里有没有可用解释器，以及路径有没有配对。&lt;/p&gt;
&lt;p&gt;你在 VS Code 里看到的“Select Interpreter（选择解释器）”，本质上也是在告诉编辑器：这次项目要调用你电脑上的哪一个 Python。&lt;/p&gt;
&lt;p&gt;你可以直接这样操作一遍：打开 VS Code，按 &lt;code&gt;Ctrl + Shift + P&lt;/code&gt;，输入 &lt;code&gt;Python: Select Interpreter&lt;/code&gt;，然后选择你刚创建的 &lt;code&gt;learn&lt;/code&gt; 环境。如果这里选错，VS Code 可能运行的就不是你刚安装的那套 Python。&lt;/p&gt;
&lt;p&gt;选对之后，状态栏通常会显示当前 Python 环境或版本（不同主题位置会有点差异），这是你是否切换成功的一个直观信号。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-3-3-vscode-python.png&quot; alt=&quot;VS Code 安装 Python 扩展示例&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;33-vs-code-安装中文语言包与插件&quot;&gt;3.3 VS Code 安装、中文语言包与插件&lt;/h3&gt;
&lt;p&gt;先按最稳流程走一遍，别一上来改太多选项。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;去 VS Code 官网下载 Windows 安装包。&lt;br&gt;
你应该看到明显的 &lt;code&gt;Download for Windows&lt;/code&gt; 按钮。&lt;/li&gt;
&lt;li&gt;安装时建议勾选：
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Add to PATH&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Open with Code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;（可选）&lt;code&gt;Register Code as an editor for supported file types&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;安装完成后启动 VS Code。&lt;br&gt;
你应该能看到左侧活动栏（Explorer/Search/Source Control/Run/Extensions）。&lt;/li&gt;
&lt;li&gt;打开扩展市场（左侧方块图标 &lt;code&gt;Extensions&lt;/code&gt;），搜索并安装简体中文语言包：&lt;br&gt;
&lt;code&gt;Chinese (Simplified) Language Pack for Visual Studio Code&lt;/code&gt;（Microsoft 官方）。&lt;/li&gt;
&lt;li&gt;安装后按提示重启 VS Code。&lt;br&gt;
重启后界面会切到中文（如果没自动切，可在命令面板手动切换显示语言）。&lt;/li&gt;
&lt;li&gt;如果你习惯繁体，也有对应语言包可装：&lt;br&gt;
&lt;code&gt;Chinese (Traditional) Language Pack for Visual Studio Code&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;第一次打开后再做三件事：
&lt;ul&gt;
&lt;li&gt;语言切到你习惯的界面。&lt;/li&gt;
&lt;li&gt;安装上面的最少插件清单。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;Ctrl + ~&lt;/code&gt; 打开终端，确认可以正常输入命令。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Windows 用户可跳过这一小段：&lt;/strong&gt;&lt;br&gt;
VS Code 官网同样提供 macOS 版本：&lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;。&lt;br&gt;
装好后直接打开即可，插件安装和解释器选择逻辑与 Windows 基本一致。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;什么是开发环境？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;开发环境可以理解成你的“编程工作台”。编辑器负责写代码，解释器或编译器负责把代码变成可运行结果，终端是你下命令和跑程序的入口。&lt;/p&gt;
&lt;p&gt;包管理器（比如 &lt;code&gt;pip&lt;/code&gt;、&lt;code&gt;conda&lt;/code&gt;）用来装和管理依赖，运行时则决定代码真正执行时依赖的条件。你不需要一次全部吃透，先知道这些部件是在配合工作就够了。&lt;/p&gt;
&lt;h3 id=&quot;34-终端与-winr先把命令行跑通&quot;&gt;3.4 终端与 Win+R：先把命令行跑通&lt;/h3&gt;
&lt;p&gt;CMD，powershell，vscode里的终端，他们都又是什么呢？&lt;/p&gt;
&lt;p&gt;刚开始你可能觉得黑框很可怕，但它只是一个输入命令的地方。&lt;/p&gt;
&lt;p&gt;它们本质都是命令行入口。CMD 更直接，适合先上手；PowerShell 功能更丰富；VS Code Terminal 本质上是把这两者放进编辑器里，少切几个窗口。&lt;/p&gt;
&lt;p&gt;先固定一个就够，我建议先用 CMD。&lt;/p&gt;
&lt;p&gt;先记住几条最常用的就够：&lt;code&gt;cd&lt;/code&gt; 切目录，&lt;code&gt;dir&lt;/code&gt; 看文件，&lt;code&gt;mkdir&lt;/code&gt; 建目录，&lt;code&gt;rmdir&lt;/code&gt; 删空目录，&lt;code&gt;echo&lt;/code&gt; 输出文本，&lt;code&gt;cls&lt;/code&gt; 清屏。&lt;/p&gt;
&lt;p&gt;做个 3 分钟练习（可直接复制）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;mkdir &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;%USERPROFILE%\Desktop\learning&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 创建 learning 文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;cd /d &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;%USERPROFILE%\Desktop\learning&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 进入 learning 文件夹（/d 支持切换盘符）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;echo Hello Programming &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; hello.txt      # 创建并写入 hello.txt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;dir                                     # 查看当前目录内容&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;type hello.txt                          # 查看文件内容&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;mkdir temp                              # 创建 temp 子文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;rmdir temp                              # 删除空的 temp 子文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;cls                                     # 清空终端屏幕&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你大概率会看到：执行 &lt;code&gt;dir&lt;/code&gt; 之后列表里有 &lt;code&gt;hello.txt&lt;/code&gt;，执行 &lt;code&gt;type hello.txt&lt;/code&gt; 会输出 &lt;code&gt;Hello Programming&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;常见坑也就两个：一是忘了 &lt;code&gt;cd /d&lt;/code&gt;，盘符没切过去；二是没进 &lt;code&gt;learning&lt;/code&gt; 就建文件，结果文件跑到别的目录里。&lt;/p&gt;
&lt;p&gt;如果你能看懂每条命令在做什么，终端这关就过了第一步。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;怎么打开系统命令行（Win + R）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;如果你不在 VS Code 里，也可以直接开系统命令行。按 &lt;code&gt;Win + R&lt;/code&gt;，输入 &lt;code&gt;cmd&lt;/code&gt;，回车，就会打开 Windows 的命令提示符。&lt;/p&gt;
&lt;p&gt;打开后你通常会看到类似 &lt;code&gt;C:\Users\你的用户名&gt;&lt;/code&gt; 的提示符，这就是你当前所在目录。&lt;/p&gt;
&lt;p&gt;如果你不小心开成了 PowerShell 也不用慌，大多数基础命令照样能跑，先把流程走通最重要。&lt;/p&gt;
&lt;p&gt;VS Code 底部那个终端，本质上也是在调用这套命令行环境，只是它被放在编辑器里了。你在两边输入的很多命令是同一套逻辑。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mac 用户可跳过 Windows 这段：&lt;/strong&gt;&lt;br&gt;
Mac 上打开“终端 Terminal”即可，Spotlight 搜索 &lt;code&gt;Terminal&lt;/code&gt; 很快能找到。&lt;br&gt;
命令大多相同，只是 Windows 常见 &lt;code&gt;cmd&lt;/code&gt;，Mac 常见 &lt;code&gt;bash/zsh&lt;/code&gt;。&lt;/p&gt;
&lt;h3 id=&quot;35-python-本体miniconda-与安装路线&quot;&gt;3.5 Python 本体、Miniconda 与安装路线&lt;/h3&gt;
&lt;p&gt;我推荐Miniconda，其实可能 Anaconda会更好但是我还是希望你能熟悉一下终端操作。&lt;/p&gt;
&lt;p&gt;我依旧推荐 Miniconda，原因是轻量、可控、环境隔离体验好。&lt;/p&gt;
&lt;p&gt;Miniconda 官方下载页：&lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;https://docs.conda.io/en/latest/miniconda.html&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;先记三个词：Python 版本（比如 3.10、3.11）、包（比如 &lt;code&gt;requests&lt;/code&gt; 这种第三方库）、虚拟环境（每个项目各用各的依赖，互不干扰）。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Python 到底装在哪？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Python 有两种常见安装方式。第一种是直接去 Python 官网下载并安装：&lt;a href=&quot;https://www.python.org/&quot;&gt;https://www.python.org/&lt;/a&gt;。第二种是装 Miniconda，它本身也会带一套 Python。&lt;/p&gt;
&lt;p&gt;两种方式都能用，选一个就可以。新手我更建议先走 Miniconda，后面做环境隔离会省很多麻烦。&lt;/p&gt;
&lt;p&gt;再强调一次最容易误会的点：&lt;strong&gt;VS Code 里装了 Python 插件，不代表电脑里装了 Python。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;怎么确认 Python 真的装好了&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;装完后你可以先做这个最小检查：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version      # 查看 Python 版本&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python          # 查看 python 执行路径&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;正常你会看到类似：&lt;code&gt;Python 3.11.x&lt;/code&gt;，以及一条指向 Miniconda 目录的 &lt;code&gt;python.exe&lt;/code&gt; 路径。&lt;/p&gt;
&lt;p&gt;如果 &lt;code&gt;python --version&lt;/code&gt; 没反应或提示找不到，通常是 PATH 没生效，或者终端还没刷新；如果 &lt;code&gt;where python&lt;/code&gt; 指向了非 Miniconda 路径，多半是系统里有多套 Python 或 PATH 顺序靠前的不是你想用的那套。&lt;/p&gt;
&lt;p&gt;改完 PATH 之后，记得把终端全关掉再开一次。&lt;/p&gt;
&lt;p&gt;如果能看到版本号和明确路径，基本就说明本体已经可用了。看不到也别慌，很多时候只是环境变量或终端会话没刷新，关掉终端再开一次通常就能确认。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;使用清华镜像加速（强烈建议国内用户配置）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;清华开源镜像站：&lt;a href=&quot;https://mirrors.tuna.tsinghua.edu.cn/&quot;&gt;https://mirrors.tuna.tsinghua.edu.cn/&lt;/a&gt;。你可以把“清华源”理解成官方仓库在国内的同步副本，所以叫镜像。它不是魔改版，内容来源还是官方，只是访问路径换成了更稳定的国内节点。&lt;/p&gt;
&lt;p&gt;如果你在国内装过 &lt;code&gt;pandas&lt;/code&gt;、&lt;code&gt;numpy&lt;/code&gt;，大概率见过“命令敲了很久没动静”的时刻。很多时候不是你写错了，而是默认源连接不稳定。把源切到镜像后，下载过程通常会顺很多。&lt;/p&gt;
&lt;p&gt;想自己确认路径也不难：打开镜像站首页，搜 &lt;code&gt;anaconda&lt;/code&gt;，进入目录就能看到常见通道。&lt;code&gt;pkgs/main&lt;/code&gt; 是常用基础包，&lt;code&gt;pkgs/free&lt;/code&gt; 偏历史包，&lt;code&gt;cloud/conda-forge&lt;/code&gt; 对应社区维护、更新更快的 conda-forge。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;channel&lt;/code&gt; 可以理解成 conda 查找包时依次访问的仓库列表。以下命令请在 &lt;strong&gt;Miniconda Prompt&lt;/strong&gt; 中执行，而不是普通 CMD：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/         # 添加主仓库镜像（常用基础包）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/         # 添加历史仓库镜像（兼容旧依赖）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;forge/ # 添加 conda&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;forge 镜像（社区包更全）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;show_channel_urls yes                                                      # 显示包来源通道，排错时更容易定位&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;pip&lt;/code&gt; 默认访问官方 PyPI，国内网络下也可能慢。设置 &lt;code&gt;index-url&lt;/code&gt; 后会长期生效：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global.index&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;url https://pypi.tuna.tsinghua.edu.cn/simple  # 设置 pip 默认镜像（持久生效）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config list                                                            # 查看配置是否生效&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果后面要回退到默认源，执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config unset global.index&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;url  # 取消自定义镜像，恢复默认 PyPI&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;36-miniconda-安装与验证闭环&quot;&gt;3.6 Miniconda 安装与验证闭环&lt;/h3&gt;
&lt;p&gt;这一段我按“国内下载”和“国际下载”分开写，你照着走就能闭环。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;国内用户（清华镜像）下载流程&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 &lt;a href=&quot;https://mirrors.tuna.tsinghua.edu.cn/&quot;&gt;https://mirrors.tuna.tsinghua.edu.cn/&lt;/a&gt;。&lt;/li&gt;
&lt;li&gt;进入首页后，看右侧的“下载链接”模块。&lt;/li&gt;
&lt;li&gt;点击蓝色按钮“获取下载链接”。&lt;/li&gt;
&lt;li&gt;在弹窗里切到“应用软件（或应用程序）”选项卡，左侧选择 &lt;code&gt;Conda&lt;/code&gt;，右侧选择 &lt;code&gt;Miniconda3-latest (Windows/x86_64, exe)&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;x86_64&lt;/code&gt; 就是 64 位 Windows，大多数电脑都是这个；不要选 Linux 的 &lt;code&gt;.sh&lt;/code&gt;，也不要选 macOS 的 &lt;code&gt;.pkg&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;下载后的文件名通常类似：&lt;code&gt;Miniconda3-latest-Windows-x86_64.exe&lt;/code&gt;，看到这种格式基本就是对的。&lt;/li&gt;
&lt;li&gt;下载 &lt;code&gt;.exe&lt;/code&gt; 安装包到英文目录（比如 &lt;code&gt;Downloads&lt;/code&gt;）。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-3-6-tsinghua-miniconda.png&quot; alt=&quot;清华镜像下载 Miniconda 页面&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;国际用户（官网）下载流程&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 &lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;https://docs.conda.io/en/latest/miniconda.html&lt;/a&gt;。&lt;/li&gt;
&lt;li&gt;找到 &lt;code&gt;Windows 64-bit Installer&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;下载对应的 &lt;code&gt;.exe&lt;/code&gt; 安装包。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Windows 用户可跳过这一小段：&lt;/strong&gt;&lt;br&gt;
Mac 用户也可以在同一页面下载 macOS 版本（Apple Silicon / Intel 按机型选）。&lt;br&gt;
安装完成后在 Terminal 里先执行 &lt;code&gt;conda --version&lt;/code&gt; 做最小验证。&lt;/p&gt;
&lt;p&gt;下载好之后，安装步骤按这个走：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;双击安装包。&lt;/li&gt;
&lt;li&gt;用户范围建议选 &lt;code&gt;Just Me&lt;/code&gt;（个人电脑更省心，也不容易碰权限问题）。&lt;/li&gt;
&lt;li&gt;安装路径建议用 &lt;code&gt;C:\Miniconda3&lt;/code&gt;，尽量避免中文路径和空格。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Add Miniconda to PATH&lt;/code&gt;：如果你是第一次安装，建议勾选，这样可以直接在 CMD 中使用 &lt;code&gt;python&lt;/code&gt; 和 &lt;code&gt;conda&lt;/code&gt;；如果后面要管理多个 Python 版本，再学习更规范的环境隔离方式。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Register Miniconda as default Python&lt;/code&gt; 建议勾选，这样常见工具会优先识别这套 Python；如果你已经有固定项目绑定其他 Python，再按实际情况决定。&lt;/li&gt;
&lt;li&gt;安装完成后，在开始菜单搜索并打开 &lt;code&gt;Miniconda Prompt&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你不想改系统 PATH，也可以不勾选；但新手为了少踩坑，勾上更省事。后面我也会教你怎么验证和手动处理。
&lt;strong&gt;装完立刻验证&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;安装完成后，先在 &lt;code&gt;Miniconda Prompt&lt;/code&gt; 里跑一遍这三条：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version              # 确认 conda 可用&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version             # 确认 Python 可用（来自 Miniconda）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python                 # 确认 python 路径指向 Miniconda 目录&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda --version&lt;/code&gt; 正常会显示类似：&lt;code&gt;conda 24.x.x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python --version&lt;/code&gt; 正常会显示类似：&lt;code&gt;Python 3.11.x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where python&lt;/code&gt; 第一条路径通常应指向：&lt;code&gt;C:\Miniconda3\python.exe&lt;/code&gt;（或你自己的 Miniconda 安装目录）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where python&lt;/code&gt; 有时会输出多行，第一行就是当前优先命中的 Python。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;37-path-环境变量不勾选时怎么手动处理&quot;&gt;3.7 PATH 环境变量：不勾选时怎么手动处理&lt;/h3&gt;
&lt;p&gt;这个步骤听起来有点“系统设置味”，但实际做一遍就熟了。你可以按下面这条路走：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;右键桌面或资源管理器里的“此电脑”。&lt;/li&gt;
&lt;li&gt;点击“属性”。&lt;/li&gt;
&lt;li&gt;点击“高级系统设置”。&lt;/li&gt;
&lt;li&gt;在弹出的窗口里点击“环境变量”。&lt;/li&gt;
&lt;li&gt;在“系统变量”区域找到 &lt;code&gt;Path&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点击“编辑”。&lt;/li&gt;
&lt;li&gt;点击“新建”。&lt;/li&gt;
&lt;li&gt;添加 Miniconda 安装目录，例如 &lt;code&gt;C:\Miniconda3&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;再点击一次“新建”，添加 &lt;code&gt;C:\Miniconda3\Scripts&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;一路点击“确定”保存。&lt;/li&gt;
&lt;li&gt;关闭所有已经打开的终端窗口，再重新打开。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你可以把 &lt;code&gt;PATH&lt;/code&gt; 理解成系统查找可执行文件的“目录列表”。你在 &lt;code&gt;cmd&lt;/code&gt; 里输入 &lt;code&gt;python&lt;/code&gt;，系统就会按这张列表从上到下去找 &lt;code&gt;python.exe&lt;/code&gt;。如果目录没加进去，命令行就会表现成“找不到 python”。&lt;/p&gt;
&lt;p&gt;至于为什么要“关掉终端再开”，原因也不复杂：终端启动时会读取一份当时的环境变量快照。你后面改了 PATH，老窗口不会自动刷新，新开的窗口才会拿到最新配置。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;怎么验证 PATH 已经生效&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;配完后建议马上检查一次：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python   # 查看 python 实际命中路径&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;PATH&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    # 打印当前 PATH 列表，确认是否包含 Miniconda 目录&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果 &lt;code&gt;where python&lt;/code&gt; 能看到你刚配置的路径，基本就说明已经生效了。&lt;/p&gt;
&lt;h3 id=&quot;38-创建-learn-环境与常见坑&quot;&gt;3.8 创建 learn 环境与常见坑&lt;/h3&gt;
&lt;p&gt;在 Miniconda Prompt 里执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda create &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;n learn python&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3.11&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 创建名为 learn 的 Python &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3.11&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; 环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda activate learn               # 激活 learn 环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version                   # 检查当前 Python 版本&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip install requests               # 在当前环境安装 requests 包&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda deactivate                   # 退出当前环境&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;conda activate learn&lt;/code&gt; 成功后，提示符左侧通常会出现 &lt;code&gt;(learn)&lt;/code&gt;，这是最直观的激活信号。&lt;/p&gt;
&lt;p&gt;第一次执行 &lt;code&gt;conda create -n learn python=3.11&lt;/code&gt; 时，通常会看到：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Proceed ([y]/n)?&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;输入 &lt;code&gt;y&lt;/code&gt; 然后回车继续即可。&lt;/p&gt;
&lt;p&gt;如果 &lt;code&gt;pip install requests&lt;/code&gt; 报超时或下载很慢，优先回到上面的清华镜像小节检查配置是否生效。&lt;/p&gt;
&lt;p&gt;还有一个很常见的小坑：没激活环境就直接装包，包装到了 &lt;code&gt;base&lt;/code&gt; 或系统环境里，后面切到别的环境运行时就会冒 &lt;code&gt;ModuleNotFoundError&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;跑通这一组命令，你就完成了第一个可用开发环境。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;如果遇到这些情况：&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;python 不是内部或外部命令&lt;/code&gt;&lt;br&gt;
这通常是 PATH 没配置好，或者你改完 PATH 后终端没重开。最短排查：&lt;code&gt;where python&lt;/code&gt;，然后重开终端。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where python&lt;/code&gt; 指向了别的路径&lt;br&gt;
说明系统里可能有多套 Python，当前命中的不是你想用的那套。最短修复：调整 PATH 顺序，或先明确用 &lt;code&gt;C:\Miniconda3\python.exe&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;conda&lt;/code&gt; 不是命令&lt;br&gt;
你大概率没在 Miniconda Prompt 里执行。最短修复：先切到 Miniconda Prompt，再试一次。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ModuleNotFoundError&lt;/code&gt;&lt;br&gt;
先确认 VS Code 解释器和当前环境一致，再在当前环境里执行 &lt;code&gt;pip install&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;你会踩的坑&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;最常见的几个问题你大概率都会遇到：&lt;code&gt;python 不是内部或外部命令&lt;/code&gt;、电脑里装了多个 Python 但不知道当前到底调用了哪个、&lt;code&gt;pip&lt;/code&gt; 把包装进了系统环境而不是项目环境。&lt;/p&gt;
&lt;p&gt;很多新手都会经历这个阶段。你可能在终端里敲了 &lt;code&gt;conda activate learn&lt;/code&gt;，结果像“没反应”一样，既不报错也没明显变化。这通常不是命令坏了，而是终端没加载 conda，或者你开的不是 Miniconda Prompt。&lt;/p&gt;
&lt;p&gt;我当年也踩过这个坑。最后回头看，问题基本都在路径和环境没对齐。先用下面两个命令把现状看清楚：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda info &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;envs  # 查看所有 conda 环境，以及当前激活环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python       # 查看当前 python 命令实际指向的可执行路径&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;conda info --envs&lt;/code&gt; 用来确认当前激活的是哪个环境；&lt;code&gt;where python&lt;/code&gt; 用来确认当前调用的 python 路径。&lt;/p&gt;
&lt;p&gt;如果你看着这些输出有点懵也正常，先确认两件事：&lt;br&gt;
第一，你是不是在 &lt;code&gt;learn&lt;/code&gt; 环境里；第二，&lt;code&gt;where python&lt;/code&gt; 第一条路径是不是你预期的那一个。&lt;/p&gt;
&lt;h2 id=&quot;4-版本管理&quot;&gt;4. 版本管理&lt;/h2&gt;
&lt;h3 id=&quot;41-为什么要做版本管理&quot;&gt;4.1 为什么要做版本管理&lt;/h3&gt;
&lt;p&gt;你大概率见过这种场景：桌面里有 &lt;code&gt;final.py&lt;/code&gt;、&lt;code&gt;final_final.py&lt;/code&gt;、&lt;code&gt;final_final_v3.py&lt;/code&gt;，过几天自己都分不清哪个能跑。版本管理的价值就在这里：它把每次改动记录成时间线，能回看、能回退、也方便协作。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Git 是什么（用一句话说清楚）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Git 就是一套本地版本控制工具，负责记录代码历史和变更。&lt;/p&gt;
&lt;h3 id=&quot;42-git-安装与基础配置windows-主线--mac-支线&quot;&gt;4.2 Git 安装与基础配置（Windows 主线 + Mac 支线）&lt;/h3&gt;
&lt;p&gt;先打开 Git 官网：&lt;a href=&quot;https://git-scm.com/&quot;&gt;https://git-scm.com/&lt;/a&gt;。Windows 用户点 &lt;code&gt;Download for Windows&lt;/code&gt;（或等价入口），下载完成后双击安装包（文件名通常类似 &lt;code&gt;Git-2.xx.x-64-bit.exe&lt;/code&gt;）。&lt;/p&gt;
&lt;p&gt;安装器里你会看到不少页面，下面按“新手最关键选项”走一遍：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;License&lt;/code&gt;：直接 &lt;code&gt;Next&lt;/code&gt;。&lt;br&gt;
这页主要是许可说明，不需要额外改动。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Select Destination Location&lt;/code&gt;：建议默认。&lt;br&gt;
如果你要改路径，尽量英文目录，例如 &lt;code&gt;D:\Git&lt;/code&gt; 或 &lt;code&gt;C:\Program Files\Git&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Select Components&lt;/code&gt;：大体默认即可，关键项看这几个。&lt;br&gt;
&lt;code&gt;Git Bash Here&lt;/code&gt; 建议勾选（右键能快速开 Bash）；&lt;code&gt;Git GUI Here&lt;/code&gt; 可选；&lt;code&gt;Git LFS&lt;/code&gt; 建议勾选；&lt;code&gt;Associate .git* configuration files with the default text editor&lt;/code&gt; 建议保留；&lt;code&gt;Associate .sh files to be run with Bash&lt;/code&gt; 可选；&lt;code&gt;Add a Git Bash Profile to Windows Terminal&lt;/code&gt; 可选。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Start Menu Folder&lt;/code&gt;：默认 &lt;code&gt;Next&lt;/code&gt;。&lt;br&gt;
新手不用在这页折腾。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the default editor used by Git&lt;/code&gt;：&lt;br&gt;
如果你已经装了 VS Code，推荐 &lt;code&gt;Use Visual Studio Code as Git&apos;s default editor&lt;/code&gt;；没装就先保持默认也能继续，后面可以再改。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Adjusting the name of the initial branch in new repositories&lt;/code&gt;：&lt;br&gt;
推荐选 &lt;code&gt;Override the default branch name for new repositories&lt;/code&gt; 并填 &lt;code&gt;main&lt;/code&gt;，和主流仓库默认值保持一致。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Adjusting your PATH environment&lt;/code&gt;：&lt;br&gt;
新手推荐 &lt;code&gt;Git from the command line and also from 3rd-party software&lt;/code&gt;，这样在 CMD / PowerShell / VS Code 终端都能直接用 git。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the SSH executable&lt;/code&gt; 与 &lt;code&gt;Choosing HTTPS transport backend&lt;/code&gt;：&lt;br&gt;
都保持默认就行（通常是 &lt;code&gt;Use bundled OpenSSH&lt;/code&gt; / &lt;code&gt;Use the OpenSSL library&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Configuring the line ending conversions&lt;/code&gt;：&lt;br&gt;
推荐 &lt;code&gt;Checkout Windows-style, commit Unix-style line endings&lt;/code&gt;，跨平台时更不容易出现整文件换行变更。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Configuring the terminal emulator to use with Git Bash&lt;/code&gt;：&lt;br&gt;
保持默认 &lt;code&gt;Use MinTTY&lt;/code&gt; 即可；你平时在 VS Code 内置终端使用也不冲突。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the default behavior of &apos;git pull&apos;&lt;/code&gt;、&lt;code&gt;credential helper&lt;/code&gt;、&lt;code&gt;extra/experimental options&lt;/code&gt;：&lt;br&gt;
这几页先保持默认（&lt;code&gt;Git Credential Manager&lt;/code&gt; 也建议保留），先把主流程跑通。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;安装完成后，先把所有终端窗口关掉再打开。然后在 CMD（&lt;code&gt;Win + R&lt;/code&gt; 输入 &lt;code&gt;cmd&lt;/code&gt;）里执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version    # 正常会看到：git version &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;xx.x&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果提示 &lt;code&gt;git&lt;/code&gt; 不是命令，先重开一次终端；还不行就重装一遍，并确认 PATH 那页选的是“from the command line and also from 3rd-party software”。&lt;/p&gt;
&lt;p&gt;Mac 支线（Windows 用户可跳过）：在 Terminal 输入 &lt;code&gt;git --version&lt;/code&gt;，通常会提示安装命令行工具，按向导完成即可。装完后重开 Terminal 再执行一次确认。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;第一次 Git 基础配置（user.name / user.email）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这一步是给提交记录写“署名信息”，不是账号密码。只要配置一次，后面提交会稳定很多。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global user.name &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;你的名字&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          # 设置提交显示名&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global user.email &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;you@example.com&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; # 设置提交邮箱&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;list                        # 验证配置&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你大概率会看到 &lt;code&gt;user.name=&lt;/code&gt; 和 &lt;code&gt;user.email=&lt;/code&gt; 这两行，说明配置已经生效。&lt;/p&gt;
&lt;h3 id=&quot;43-github-注册与账号准备&quot;&gt;4.3 GitHub 注册与账号准备&lt;/h3&gt;
&lt;p&gt;Git 是本地版本工具，GitHub 是远程托管与协作平台。一个负责记录版本，一个负责把版本放到线上并支持协作。&lt;/p&gt;
&lt;p&gt;GitHub 官网：&lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;对初学者来说，GitHub 最大的意义是“学习过程可见”。你做过哪些项目、怎么改进，都会留下记录；别人能看，你自己也能回看。它还很适合学习他人的仓库结构、README 写法和 issue 提问方式，长期看非常实用。&lt;/p&gt;
&lt;h3 id=&quot;44-github-网页端入门界面建仓库第一次提交&quot;&gt;4.4 GitHub 网页端入门：界面、建仓库、第一次提交&lt;/h3&gt;
&lt;p&gt;GitHub 默认是英文界面，这很正常，别紧张。新手先把常见按钮认熟，后面会越来越顺。&lt;br&gt;
登录 &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt; 后，你通常会到 &lt;code&gt;Dashboard&lt;/code&gt; / &lt;code&gt;Home&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;你大概率会先看到三个东西：顶部搜索框、右上角头像和 &lt;code&gt;+&lt;/code&gt; 菜单、左侧仓库区域。界面偶尔会小改，但核心入口基本不变：头像、&lt;code&gt;+&lt;/code&gt;、&lt;code&gt;Repositories&lt;/code&gt;、&lt;code&gt;Settings&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;先认这几个区域就够用：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;左侧仓库区（&lt;code&gt;Top repositories&lt;/code&gt; / &lt;code&gt;Repositories&lt;/code&gt;）：看你常用仓库入口。&lt;/li&gt;
&lt;li&gt;中间 Feed：先知道有这块就行，不用深挖。&lt;/li&gt;
&lt;li&gt;右上角 &lt;code&gt;+&lt;/code&gt; 菜单：最常用是 &lt;code&gt;New repository&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;Dashboard 左侧绿色 &lt;code&gt;New&lt;/code&gt;：也能直接创建仓库。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;再看右上角头像菜单，点开后常用项是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Your profile&lt;/code&gt; / &lt;code&gt;Profile&lt;/code&gt;：看个人主页。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Your repositories&lt;/code&gt; / &lt;code&gt;Repositories&lt;/code&gt;：看自己的仓库列表。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Settings&lt;/code&gt;：账号设置（邮箱、密码、安全项都在这里）。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sign out&lt;/code&gt;：退出登录。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;第一次先把这几个入口认熟，就够你开始做项目了。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-4-4-github-web.png&quot; alt=&quot;GitHub 网页端界面示例&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GitHub 注册（一步一步来）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;GitHub 基本是英文界面。我不建议一上来就完全依赖翻译器，但你真的卡住时可以临时用一下，先把流程走通。后面慢慢养成“看英文按钮、看英文报错”的习惯就好。&lt;/p&gt;
&lt;p&gt;注册流程按页面走：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;，右上角点 &lt;code&gt;Sign up&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;按顺序填写 &lt;code&gt;Email address&lt;/code&gt;、&lt;code&gt;Password&lt;/code&gt;、&lt;code&gt;Username&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;按提示完成 &lt;code&gt;Verify your account&lt;/code&gt;（人机验证）和邮箱验证码。&lt;/li&gt;
&lt;li&gt;完成后进入首页，通常会看到右上角头像或 &lt;code&gt;+&lt;/code&gt; 菜单。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;常见卡点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Username&lt;/code&gt; 被占用：换一个名字。&lt;/li&gt;
&lt;li&gt;邮箱收不到验证：先看垃圾箱，稍等几分钟，不行换邮箱。&lt;/li&gt;
&lt;li&gt;页面加载慢：先刷新或稍后再试；如果经常卡加载，后面有可选方案。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;GitHub 注册邮箱建议&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;国内用户用 QQ 邮箱、163 邮箱都可以。&lt;br&gt;
如果你更习惯国际服务，Gmail、Outlook 也不错。&lt;br&gt;
邮箱没有高下之分，能长期稳定使用、能收验证码、你自己顺手最重要。&lt;br&gt;
同样地，英文界面也不用焦虑，先把常见按钮认熟；实在卡住再临时翻译一下即可。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;网页端新建一个仓库（一步一步来）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Step 0：先确认你已登录成功。&lt;br&gt;
你应该在右上角看到头像，这是后面操作的起点。&lt;/p&gt;
&lt;p&gt;Step 1：进入创建页。&lt;br&gt;
入口 1：右上角 &lt;code&gt;+&lt;/code&gt; -&gt; &lt;code&gt;New repository&lt;/code&gt;；入口 2：Dashboard 左侧绿色 &lt;code&gt;New&lt;/code&gt;。&lt;br&gt;
你应该会进入 &lt;code&gt;Create a new repository&lt;/code&gt; 页面。&lt;/p&gt;
&lt;p&gt;Step 2：填写 &lt;code&gt;Repository name&lt;/code&gt;。&lt;br&gt;
建议用英文和短横线，比如 &lt;code&gt;project-hello&lt;/code&gt;。&lt;br&gt;
名称合法时通常会出现绿色通过提示；如果报错就改短一点、只用字母数字短横线。&lt;/p&gt;
&lt;p&gt;Step 3：决定 &lt;code&gt;Public&lt;/code&gt; / &lt;code&gt;Private&lt;/code&gt;。&lt;br&gt;
&lt;code&gt;Public&lt;/code&gt; 更适合学习展示，别人能直接看；&lt;code&gt;Private&lt;/code&gt; 更像个人草稿本。&lt;br&gt;
你应该看到被选中的那一项高亮。&lt;/p&gt;
&lt;p&gt;Step 4：&lt;code&gt;Add a README file&lt;/code&gt; 建议勾选。&lt;br&gt;
原因很实际：不空仓库，创建后直接能看到一个可读入口，结构更好理解。&lt;br&gt;
勾选后创建页会显示该选项已启用。&lt;/p&gt;
&lt;p&gt;Step 5：&lt;code&gt;.gitignore&lt;/code&gt; 与 &lt;code&gt;License&lt;/code&gt;。&lt;br&gt;
&lt;code&gt;.gitignore&lt;/code&gt; 可以先不选；如果你明确是 Python 项目，也可以选 Python 模板。&lt;br&gt;
&lt;code&gt;Choose a license&lt;/code&gt; 不懂就先不选，后面随时可补。&lt;/p&gt;
&lt;p&gt;Step 6：点 &lt;code&gt;Create repository&lt;/code&gt;。&lt;br&gt;
创建后会进入仓库页面，默认在 &lt;code&gt;Code&lt;/code&gt; 标签；如果你勾选了 README，会看到 &lt;code&gt;README.md&lt;/code&gt; 出现在文件列表。&lt;/p&gt;
&lt;p&gt;常见坑：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;仓库名重复或不合法：换一个名字（字母/数字/短横线最稳）。&lt;/li&gt;
&lt;li&gt;邮箱未验证：部分功能会受限，先去邮箱完成验证再回来。&lt;/li&gt;
&lt;li&gt;页面加载慢：如果经常卡在创建页或加载页，再看后面的可选方案。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;网页端做第一次提交（不装任何工具也能完成）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;如果你现在还不想装任何工具，网页端也可以先跑通一次提交，先建立“我能把改动提交上去”的手感。&lt;/p&gt;
&lt;p&gt;路线 1：&lt;code&gt;Add file -&gt; Create new file&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;进入仓库的 &lt;code&gt;Code&lt;/code&gt; 页面，点 &lt;code&gt;Add file&lt;/code&gt; -&gt; &lt;code&gt;Create new file&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;文件名建议英文，比如 &lt;code&gt;notes.md&lt;/code&gt; 或 &lt;code&gt;hello.txt&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;在编辑框写一点内容。&lt;/li&gt;
&lt;li&gt;往下滚到 &lt;code&gt;Commit changes&lt;/code&gt;，在 &lt;code&gt;Commit message&lt;/code&gt; 填一句说明，比如 &lt;code&gt;add notes&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点 &lt;code&gt;Commit changes&lt;/code&gt; 提交。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你应该看到：新文件出现在列表里，&lt;code&gt;Commits&lt;/code&gt; 计数会 +1。&lt;/p&gt;
&lt;p&gt;路线 2：&lt;code&gt;Add file -&gt; Upload files&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在 &lt;code&gt;Code&lt;/code&gt; 页面点 &lt;code&gt;Add file&lt;/code&gt; -&gt; &lt;code&gt;Upload files&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;把本地的 &lt;code&gt;main.py&lt;/code&gt; 拖进去（或点按钮选择文件）。&lt;/li&gt;
&lt;li&gt;等上传进度完成后，往下到 &lt;code&gt;Commit changes&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;写 &lt;code&gt;Commit message&lt;/code&gt;（例如 &lt;code&gt;upload main.py&lt;/code&gt;），点 &lt;code&gt;Commit changes&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你应该看到：&lt;code&gt;main.py&lt;/code&gt; 出现在文件列表，提交历史新增一条记录。&lt;/p&gt;
&lt;p&gt;网页端很适合这种小改动和临时补文件。长期开发还是更建议本地开发 + Desktop，效率会更稳。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;仓库页面怎么读（Code 页面最常用区块）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;第一次进仓库页，不用全看，先逛这几个区域：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;顶部 Tab：&lt;code&gt;Code&lt;/code&gt; / &lt;code&gt;Issues&lt;/code&gt; / &lt;code&gt;Pull requests&lt;/code&gt; / &lt;code&gt;Actions&lt;/code&gt; / &lt;code&gt;Settings&lt;/code&gt;。&lt;br&gt;
新手先用 &lt;code&gt;Code&lt;/code&gt;；&lt;code&gt;Issues&lt;/code&gt; 用来提问题；&lt;code&gt;Actions&lt;/code&gt; 后面再学。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Branch&lt;/code&gt; 下拉（通常是 &lt;code&gt;main&lt;/code&gt;）：切分支入口。&lt;/li&gt;
&lt;li&gt;绿色 &lt;code&gt;Code&lt;/code&gt; 按钮：里面常用 &lt;code&gt;HTTPS&lt;/code&gt; / &lt;code&gt;SSH&lt;/code&gt; / &lt;code&gt;Download ZIP&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Go to file&lt;/code&gt;：文件多的时候，快速跳到目标文件。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Add file&lt;/code&gt;：新增文件或上传文件入口。&lt;/li&gt;
&lt;li&gt;文件列表（如 &lt;code&gt;src/&lt;/code&gt;、&lt;code&gt;README.md&lt;/code&gt;）：项目内容主入口。&lt;/li&gt;
&lt;li&gt;页面下方会渲染 &lt;code&gt;README&lt;/code&gt;，这是项目说明的第一入口。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Commits&lt;/code&gt;：改动历史入口，能看到时间线和每次提交内容。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;45-git-工作流与最小词汇&quot;&gt;4.5 Git 工作流与最小词汇&lt;/h3&gt;
&lt;p&gt;先记这五个词：&lt;code&gt;commit&lt;/code&gt;、&lt;code&gt;push&lt;/code&gt;、&lt;code&gt;pull&lt;/code&gt;、&lt;code&gt;branch&lt;/code&gt;、&lt;code&gt;merge&lt;/code&gt;。日常就是本地改完先 &lt;code&gt;commit&lt;/code&gt;，再 &lt;code&gt;push&lt;/code&gt;；需要同步时 &lt;code&gt;pull&lt;/code&gt;；并行开发用 &lt;code&gt;branch&lt;/code&gt;，最后 &lt;code&gt;merge&lt;/code&gt;。遇到冲突别慌，先看清两边改动再决定保留哪部分。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;VS Code 里的 Git 功能（简版）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;VS Code 左侧 &lt;code&gt;Source Control&lt;/code&gt;（源代码管理）面板可以看 diff、暂存文件、写 commit message、提交。日常小改动很顺手。&lt;/p&gt;
&lt;p&gt;但对新手来说，&lt;code&gt;push/publish&lt;/code&gt; 阶段用 GitHub Desktop 往往更稳，状态也更直观。先用 GUI 跑通 &lt;code&gt;commit/push/pull&lt;/code&gt;，命令行后面再补不迟。&lt;/p&gt;
&lt;h3 id=&quot;46-国内访问慢时的可选处理&quot;&gt;4.6 国内访问慢时的可选处理&lt;/h3&gt;
&lt;p&gt;国内网络环境下，GitHub 偶尔会出现加载慢、登录慢、Release 下载慢。先用不依赖工具的方式：换时间段、优先用 GitHub Desktop 完成同步。&lt;/p&gt;
&lt;p&gt;如果你经常卡在注册验证页、登录页，或者 Desktop 的网页授权回调慢，再考虑下面这个可选方案。&lt;/p&gt;
&lt;p&gt;如果你需要可选的网络优化工具，可以了解 &lt;strong&gt;Watt 工具箱（Steam++）&lt;/strong&gt;：&lt;a href=&quot;https://steampp.net/&quot;&gt;https://steampp.net/&lt;/a&gt;。这里只是提供一个备选思路，不做效果承诺。工具只是手段，不要为了工具偏离学习目标。&lt;/p&gt;
&lt;h3 id=&quot;47-github-desktop-工作流登录授权到-publish&quot;&gt;4.7 GitHub Desktop 工作流：登录授权到 Publish&lt;/h3&gt;
&lt;p&gt;GitHub Desktop 下载地址：&lt;a href=&quot;https://desktop.github.com/&quot;&gt;https://desktop.github.com/&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;先把第一次登录/授权走完，后面步骤会顺很多：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 GitHub Desktop。&lt;/li&gt;
&lt;li&gt;Windows 一般在 &lt;code&gt;File -&gt; Options -&gt; Accounts&lt;/code&gt;，macOS 一般在 &lt;code&gt;GitHub Desktop -&gt; Settings -&gt; Accounts&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点 &lt;code&gt;Sign in&lt;/code&gt;，按提示打开浏览器授权（通常会看到 &lt;code&gt;Authorize GitHub Desktop&lt;/code&gt; 或类似按钮）。&lt;/li&gt;
&lt;li&gt;授权完成后回到 Desktop，应该能看到已登录账号（头像或用户名）。&lt;/li&gt;
&lt;li&gt;如果网页授权加载慢，先换时间段或重试一次；还是经常卡再看上面的可选方案。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你应该看到的结果是：左上角 &lt;code&gt;File&lt;/code&gt; 菜单可用；完成一次 commit 后，&lt;code&gt;Publish repository&lt;/code&gt; 会出现。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-4-7-github-desktop.png&quot; alt=&quot;GitHub Desktop 操作界面&quot;&gt;&lt;/p&gt;
&lt;p&gt;确保你已经在 Desktop 里登录了 GitHub 账号（上一步做过）。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在桌面新建项目文件夹 &lt;code&gt;project-hello&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;用 VS Code 打开它，创建 &lt;code&gt;main.py&lt;/code&gt;，写一行：&lt;code&gt;print(&quot;Hello from my first repo&quot;)&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;打开 GitHub Desktop：
&lt;ul&gt;
&lt;li&gt;如果本地还不是仓库，用 &lt;code&gt;File -&gt; New repository...&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;如果已经是仓库，用 &lt;code&gt;File -&gt; Add local repository...&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;在左下角填 &lt;code&gt;Summary&lt;/code&gt;，点击 &lt;code&gt;Commit to main&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点击 &lt;code&gt;Publish repository&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;回到 GitHub 网页确认仓库已创建，并能看到 &lt;code&gt;main.py&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;每一步你应该看到的状态：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;新建仓库后，左侧会显示文件改动。&lt;/li&gt;
&lt;li&gt;Commit 后改动列表会清空。&lt;/li&gt;
&lt;li&gt;Publish 后网页仓库可访问。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果你卡住了：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Commit&lt;/code&gt; 按钮是灰色：通常是没有保存文件或没有改动。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Publish&lt;/code&gt; 没出现：先确认是否已经登录 GitHub。&lt;/li&gt;
&lt;li&gt;网页打不开或加载慢：先用 Desktop 完成流程；必要时再考虑上面的可选工具。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;最小 Git 词汇表&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;repo&lt;/code&gt; 是仓库，&lt;code&gt;commit&lt;/code&gt; 是快照，&lt;code&gt;branch&lt;/code&gt; 是并行开发线，&lt;code&gt;merge&lt;/code&gt; 是合并分支，&lt;code&gt;push/pull&lt;/code&gt; 是和远端同步，&lt;code&gt;clone&lt;/code&gt; 是把远端仓库拉到本地。&lt;/p&gt;
&lt;h2 id=&quot;5-ai-时代你可以不写代码但不能没有工程思维&quot;&gt;5. AI 时代你可以不写代码，但不能没有工程思维&lt;/h2&gt;
&lt;p&gt;AI 让写代码更快了，这件事没问题。真正没变的是：项目要落地，还是要有人把问题拆清楚、把结果做扎实。&lt;/p&gt;
&lt;p&gt;我现在更在意的不是你记了多少语法，而是你能不能把一件事从“看起来会”变成“稳定可复现”。工程能力就在这个过程里。&lt;/p&gt;
&lt;p&gt;真实场景通常很朴素。你复制一段代码，一跑就报 &lt;code&gt;ModuleNotFoundError&lt;/code&gt;。先查解释器，&lt;code&gt;where python&lt;/code&gt; 看路径，再把依赖装到当前环境。继续跑，又遇到 &lt;code&gt;FileNotFoundError&lt;/code&gt;，再回头看路径。问题是一层层剥开的，不是一次性被“神答案”解决的。&lt;/p&gt;
&lt;p&gt;我最想保留这句话：&lt;strong&gt;“你不理解的代码，AI 写得再漂亮也是负债。”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AI 能做很多事：给模板、给思路、解释报错、提优化建议。它做不了的，是替你理解需求、替你承担后果、替你做长期架构取舍。&lt;/p&gt;
&lt;p&gt;工具选择也不用神化。初学者用豆包、DeepSeek 完全够起步；如果你对质量和上下文有更高要求，再试试 ChatGPT、Gemini、Claude。&lt;/p&gt;
&lt;p&gt;在 VS Code 里配 Codex 这类插件也很实用，补全和解释都能提速。它可以当副驾驶，但方向盘还是你自己握着。&lt;/p&gt;
&lt;p&gt;最后就收在一句话：你真正要练的，是把混乱变清晰。工具会换，方法会变，方向盘始终在你手里。&lt;/p&gt;
&lt;p&gt;我希望你能掌握一种这个时代值得掌握的能力，发现问题与思考解决问题。当你遇到问题的第一反应不应该是放弃，而是我应该怎么去解决，大脑有一定概念了就去尝试。如果这个软件没有我还能去哪里获取下载资源？我现在做的东西有没有人也曾经和我遇到一样的问题？他们有没有留下解决方案？如果有我可以抄到答案吗？&lt;/p&gt;
&lt;p&gt;成大事者不应该对工具的使用产生负担，工具只是你的手段，实现你的目的你不应该纠结你的手段够不够优雅完美。我一直很喜欢一句话：“&lt;em&gt;&lt;strong&gt;真正的大师通常保持着一颗学徒的心&lt;/strong&gt;&lt;/em&gt;”。我希望你在探索解决工程问题的时候，多多善用社区资源以及搜索引擎。这个世界很大，大到任何你生活中遇到的可能性或许已经被记录下来了。&lt;/p&gt;
&lt;h2 id=&quot;6-调试与工程习惯可选进阶&quot;&gt;6. 调试与工程习惯（可选进阶）&lt;/h2&gt;
&lt;h3 id=&quot;61-报错与定位怎么读-traceback怎么缩小问题&quot;&gt;6.1 报错与定位：怎么读 Traceback，怎么缩小问题&lt;/h3&gt;
&lt;p&gt;新手怕报错很正常，我当年也会看到红字就紧张。后来才发现，报错更像导航：它在告诉你问题大概在哪。&lt;/p&gt;
&lt;p&gt;先记住这四个问题：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;我运行的到底是哪一个 Python/程序？先看 &lt;code&gt;where python&lt;/code&gt;，再看 VS Code 解释器是不是同一个环境。&lt;/li&gt;
&lt;li&gt;报错发生在哪一行？traceback 最后一段通常已经给了文件名和行号。&lt;/li&gt;
&lt;li&gt;这行依赖什么外部东西？常见就是包、文件路径、权限、网络。&lt;/li&gt;
&lt;li&gt;我改完怎么验证？做最小复现，一次只改一处再重跑。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;ModuleNotFoundError: No module named &apos;xxx&apos;&lt;/code&gt;&lt;br&gt;
常见原因是缺包，或者包装到别的环境。&lt;br&gt;
你可以这样做：先确认解释器；在当前环境装包；重跑同一段代码。&lt;br&gt;
修好后你会看到：这个报错消失，程序继续执行。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;FileNotFoundError: ...&lt;/code&gt;&lt;br&gt;
多数是路径写错，或者启动目录不对。&lt;br&gt;
你可以这样做：先确认当前工作目录；用绝对路径先跑通；再改回相对路径。&lt;br&gt;
修好后你会看到：文件能被读取，后续逻辑开始跑。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
最常见的是少冒号、括号没闭合、缩进错。&lt;br&gt;
你可以这样做：跳到报错行并看上一行；补符号并对齐缩进；重跑最小代码。&lt;br&gt;
修好后你会看到：解释器不再第一时间中断。&lt;/p&gt;
&lt;h3 id=&quot;62-断点调试用-vs-code-看见变量与流程&quot;&gt;6.2 断点调试：用 VS Code 看见变量与流程&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;打开要运行的 &lt;code&gt;.py&lt;/code&gt; 文件。&lt;/li&gt;
&lt;li&gt;在行号左侧点红点，设断点。&lt;/li&gt;
&lt;li&gt;点左侧 &lt;code&gt;Run and Debug&lt;/code&gt;，或按 &lt;code&gt;F5&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;第一次会让你选环境，选 &lt;code&gt;Python&lt;/code&gt;；提示建 &lt;code&gt;launch.json&lt;/code&gt; 就点确定。&lt;/li&gt;
&lt;li&gt;程序停在断点后，看 &lt;code&gt;Variables&lt;/code&gt; 面板里的变量值。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;F10&lt;/code&gt; 单步，&lt;code&gt;F11&lt;/code&gt; 进入函数，&lt;code&gt;Shift+F11&lt;/code&gt; 跳出函数。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你应该看到：程序停在断点，变量区会刷新，你可以逐行观察。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hit&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, total)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;        break&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;done&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, total)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;把断点打在 &lt;code&gt;total += i&lt;/code&gt; 这行，你会看到 &lt;code&gt;total&lt;/code&gt; 每轮怎么变化。调试不是炫技，是省时间。&lt;/p&gt;
&lt;h3 id=&quot;63-工程习惯目录结构markdown文件类型提交&quot;&gt;6.3 工程习惯：目录结构、Markdown、文件类型、提交&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-hello/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  src/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  data/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  output/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  README.md&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  .gitignore&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;src/&lt;/code&gt; 放代码，&lt;code&gt;data/&lt;/code&gt; 放输入，&lt;code&gt;output/&lt;/code&gt; 放结果，&lt;code&gt;README.md&lt;/code&gt; 讲怎么跑，&lt;code&gt;.gitignore&lt;/code&gt; 管不该进仓库的文件。结构清楚后，排错会轻松很多。&lt;/p&gt;
&lt;p&gt;路径和文件名尽量用英文，不是为了好看，而是减少跨工具时的奇怪兼容问题。&lt;/p&gt;
&lt;p&gt;最小 README 可以先写这几行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# project-hello&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;项目作用：xxx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;运行方式：python src/main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;依赖：xxx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;输入在 data/，输出在 output/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你可以把 Markdown 理解成“纯文本 + 轻量标记”。它不是 Word 那种二进制格式，所以很适合放进 Git 做版本管理，也更容易跨平台打开。&lt;/p&gt;
&lt;p&gt;工程里它出现频率很高：&lt;code&gt;README&lt;/code&gt;、项目文档、issue 记录、博客、学习笔记，基本都能用它。你学会最小写法后，很多地方都能直接复用。&lt;/p&gt;
&lt;p&gt;工具上，VS Code 直接就能写，建议装一个 Markdown 增强插件，比如 &lt;code&gt;Markdown All in One&lt;/code&gt;。它的预览只是显示方式，不会改变你文件本身。&lt;br&gt;
如果你更喜欢所见即所得，Typora 也很好用。我自己写长文时会用它，节奏会更顺。&lt;/p&gt;
&lt;p&gt;最小写法先记这几个就够：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;# 一级标题&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## 二级标题&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; 列表项&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;```python&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;链接写法我这篇文章里更推荐尖括号 `&amp;#x3C;https://...&gt;`，统一、直观，拷贝后也不容易出格式问题。（`[text](url)` 也可用，看你习惯。）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;你照抄就能用的迷你 README 模板：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;```markdown&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# project-hello&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;这个项目是做什么的&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## 运行方式&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;python src/main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## 输入输出&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;输入在 data/，输出在 output/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;常见坑就三个：列表缩进不一致、代码块三反引号没闭合、把中文标点写进代码里。中文标点对 Markdown 正文影响不大，但放进代码会直接出错。&lt;/p&gt;
&lt;p&gt;先记高频就够用：&lt;code&gt;.py/.md/.txt&lt;/code&gt; 是代码和文本，编辑器直接开；&lt;code&gt;.json/.csv/.xlsx&lt;/code&gt; 是常见数据，前两者编辑器可读，表格类可用 Excel；&lt;code&gt;.yaml/.yml/.toml&lt;/code&gt; 常做配置，改时注意缩进和键名；&lt;code&gt;.zip/.7z&lt;/code&gt; 先解压再处理；&lt;code&gt;.exe/.msi&lt;/code&gt; 是安装程序，不是数据文件。&lt;/p&gt;
&lt;p&gt;扩展名不等于内容本质，但它能帮你快速判断该用什么工具。&lt;/p&gt;
&lt;p&gt;习惯 1：小步提交，一件事一个 commit。&lt;br&gt;
习惯 2：提交信息写人话，用 &lt;code&gt;verb + object&lt;/code&gt;，比如 &lt;code&gt;add notes&lt;/code&gt;、&lt;code&gt;fix path&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;你可能会遇到一次“改崩了”的时刻。那时如果历史里每条提交都清楚，你不会慌，回退也很快。这个习惯看起来小，真出事时最值钱。&lt;/p&gt;
&lt;h2 id=&quot;7-硬件常识看懂你的电脑在做什么&quot;&gt;7. 硬件常识：看懂你的电脑在做什么&lt;/h2&gt;
&lt;h3 id=&quot;71-硬件四件套cpugpu内存存储&quot;&gt;7.1 硬件四件套：CPU、GPU、内存、存储&lt;/h3&gt;
&lt;p&gt;先把四个词分开，后面看配置就不会晕。CPU 像指挥中心，擅长通用计算和复杂逻辑分支，所以单线程表现常常很关键。GPU 更像一群小工人一起干活，擅长并行任务，比如图形渲染、深度学习里的矩阵计算。&lt;/p&gt;
&lt;p&gt;RAM 是“工作台”，程序运行时的数据临时放这里；台面越大，同时摊开的东西越多。ROM 这个词在手机圈常被说成“存储”，但在 PC 语境里，大家口头说的“ROM/存储”通常是 SSD/HDD 这类持久化存储，不是严格意义的只读 ROM。&lt;/p&gt;
&lt;p&gt;再补一层很实用的理解：RAM 是易失的临时空间。你开着程序时，变量和缓存都在这块“工作台”上；程序一退出、电脑一重启，或者直接断电，这些内容就会清空。你在断点调试里看到的变量值，本质也在 RAM 里，停掉进程后就没了。这也是为什么有时你重新打开程序，之前算到一半的中间结果会消失，它本来就没写进硬盘。&lt;/p&gt;
&lt;p&gt;最常见误区就一句：内存（RAM）不等于硬盘（SSD/HDD）。一个管“运行时临时空间”，一个管“长期保存文件”，作用完全不同。&lt;/p&gt;
&lt;p&gt;很多笔记本会同时出现核显和独显，这是正常设计。核显（iGPU）在 CPU 里，省电、发热低，写代码、看文档、日常开发都够用。独显（dGPU）是单独芯片，图形和并行计算更强，适合游戏、3D 渲染、视频导出、模型训练。&lt;/p&gt;
&lt;p&gt;你会看到“自动切换”，本质是系统在做省电和性能平衡：轻任务走核显，重任务再调独显。对编程新手很实用的一点是，学编程本身不依赖独显；但如果你准备走深度学习，NVIDIA 的 CUDA 生态会更常见，没独显也能学，只是训练速度会慢不少。&lt;/p&gt;
&lt;h3 id=&quot;72-存储与接口hddssdsatam2nvme&quot;&gt;7.2 存储与接口：HDD/SSD，SATA/M.2/NVMe&lt;/h3&gt;
&lt;p&gt;一句话先记住：HDD 和 SSD 都是“长期存东西”的地方，不是内存。HDD（机械硬盘）像老仓库，容量大、价格友好，但速度慢、会有噪音，也更怕震动；SSD（固态硬盘）像新仓库，快、安静、抗震，系统启动、装包、打开项目都会更利落。&lt;/p&gt;
&lt;p&gt;新手最容易混的是三个词：外形、接口、协议。&lt;code&gt;2.5 寸 SATA&lt;/code&gt; 常见为线缆连接；&lt;code&gt;M.2&lt;/code&gt; 是小卡片形态；&lt;code&gt;NVMe&lt;/code&gt; 是协议，通常跑在 PCIe 上。你会看到“长得像 M.2，但速度差很多”，多数就是协议不同，不是你看错。&lt;/p&gt;
&lt;p&gt;装之前可以按三步看规格，不容易踩坑：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先看主板或笔记本规格页：确认支持 &lt;code&gt;SATA&lt;/code&gt; 还是 &lt;code&gt;M.2&lt;/code&gt;，别先买再猜。&lt;/li&gt;
&lt;li&gt;再看细节：M.2 的长度规格（比如 &lt;code&gt;2280&lt;/code&gt;）和插槽协议（SATA/NVMe）要对上。&lt;/li&gt;
&lt;li&gt;最后看资源占用：有些 M.2 插槽会占用 SATA 通道；笔记本还要确认是否可扩展。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;还有一个口语细节：很多人说“手机 256G 内存不够”，大多是在说存储空间快满了。你只要听懂对方在说“空间不够”就行，不必在术语上较劲。&lt;/p&gt;
&lt;h3 id=&quot;73-内存条与频率ddr4ddr5-与速度指标&quot;&gt;7.3 内存条与频率：DDR4/DDR5 与速度指标&lt;/h3&gt;
&lt;p&gt;按“浏览器 + VS Code + Python + 表格”这种真实场景看，8GB 可以跑，但多开标签页后容易顶满；16GB 是现在最稳的甜点位，学习和中度开发都舒服；32GB 更像进阶余量，开虚拟机、数据处理、剪视频会更从容。&lt;/p&gt;
&lt;p&gt;SSD 建议至少 512GB。原因很现实：开发环境、包缓存、项目文件、数据集都会慢慢吃空间，256GB 很快就紧张。看配置时别只盯 CPU，CPU 很强但内存很小，体验一样会被拖住。&lt;/p&gt;
&lt;p&gt;DDR4 和 DDR5 本质是内存代际。它们不是随便混插的，能不能用由主板和 CPU 平台决定，所以先看兼容，再看参数。别把“新一代”理解成“所有机器都能直接升级”。&lt;/p&gt;
&lt;p&gt;频率这块，商家有时写 &lt;code&gt;MHz&lt;/code&gt;，有时写 &lt;code&gt;MT/s&lt;/code&gt;，偶尔也会口语写成 &lt;code&gt;Hz&lt;/code&gt;。你把它当“速度档位”理解就够了。频率高会有帮助，但体感不一定翻倍，因为瓶颈也可能在 CPU、磁盘，或者程序本身写得慢。&lt;/p&gt;
&lt;p&gt;给新手一个可执行顺序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先看兼容：主板和 CPU 支持 DDR4 还是 DDR5。&lt;/li&gt;
&lt;li&gt;再看容量：先保证 &lt;code&gt;16GB&lt;/code&gt; 起步，必要时上 &lt;code&gt;32GB&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;最后看频率：在预算允许时再抬一档，双通道（两条同规格）通常更稳。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;真实开发里，浏览器 + VS Code + Python + 表格更容易先吃满容量，所以大多数时候“容量够不够”比“频率冲多高”更影响体验。&lt;/p&gt;
&lt;h3 id=&quot;74-型号速读intel--amd--nvidia&quot;&gt;7.4 型号速读：Intel / AMD / NVIDIA&lt;/h3&gt;
&lt;p&gt;先说一个总原则：型号命名会随年份微调，后缀也会更新。遇到新后缀别硬猜，以官网说明为准。&lt;/p&gt;
&lt;p&gt;Intel CPU 先看三件事：系列、代际、后缀。&lt;code&gt;i3/i5/i7/i9&lt;/code&gt; 是大致定位，但同是 i7，12 代和 14 代差别可能很大。像 &lt;code&gt;i5-12400&lt;/code&gt;、&lt;code&gt;i7-13700K&lt;/code&gt;、&lt;code&gt;i7-13620H&lt;/code&gt;、&lt;code&gt;i5-1340P&lt;/code&gt;，先看前面的代数，再看后缀：&lt;code&gt;K&lt;/code&gt; 常见为可超频，&lt;code&gt;F&lt;/code&gt; 常见为无核显，笔记本里 &lt;code&gt;H/HX&lt;/code&gt; 偏性能，&lt;code&gt;U&lt;/code&gt; 偏低功耗，&lt;code&gt;P&lt;/code&gt; 在中间档。&lt;/p&gt;
&lt;p&gt;AMD CPU 也类似，先看 &lt;code&gt;Ryzen 3/5/7/9&lt;/code&gt; 定位，再看代际数字。比如 &lt;code&gt;Ryzen 5 5600&lt;/code&gt;、&lt;code&gt;Ryzen 7 7700X&lt;/code&gt;、&lt;code&gt;Ryzen 7 7840HS&lt;/code&gt;、&lt;code&gt;Ryzen 5 7530U&lt;/code&gt;，数字大体反映代际和定位；笔记本后缀常见 &lt;code&gt;H/HS/U&lt;/code&gt;。另外 APU（带较强核显）值得知道一下，轻度图形处理和轻剪辑会更舒服。&lt;/p&gt;
&lt;p&gt;NVIDIA GPU 最容易看错的点是：数字大不一定更强，要先看“代”。&lt;code&gt;GTX&lt;/code&gt; 多是更早一代，&lt;code&gt;RTX&lt;/code&gt; 通常带更完整的新特性。比如 &lt;code&gt;RTX 3060&lt;/code&gt; 和 &lt;code&gt;RTX 4060&lt;/code&gt;，先分清代际，再看同代内 &lt;code&gt;60/70/80/90&lt;/code&gt; 的定位；&lt;code&gt;Ti/SUPER&lt;/code&gt; 一般是同代增强款。再提醒一句，&lt;code&gt;Laptop GPU&lt;/code&gt; 同名不等于桌面版性能。做 AI 时，显存（VRAM）很关键，8GB 能入门，12GB 会宽松很多，16GB 以上在大模型和大图任务里更从容。&lt;/p&gt;
&lt;h3 id=&quot;75-自查与远程任务管理器设备管理器rdp服务器&quot;&gt;7.5 自查与远程：任务管理器、设备管理器、RDP、服务器&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;先看内存和硬盘：&lt;code&gt;16GB RAM + 512GB SSD&lt;/code&gt; 作为起步更稳。&lt;/li&gt;
&lt;li&gt;再看 CPU 的代际和定位：别只看 &lt;code&gt;i7/i9&lt;/code&gt; 这几个字。&lt;/li&gt;
&lt;li&gt;你要做 AI、游戏、渲染，再重点看独显；NVIDIA 生态通常更省事。&lt;/li&gt;
&lt;li&gt;你更在意便携和续航，核显本也完全能学编程。&lt;/li&gt;
&lt;li&gt;最后再看屏幕、接口、重量：学生党看便携，桌面党看扩展，按使用场景选。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;你现在手里的电脑，大概率已经够你开始学习了，不用等一台“完美机器”才开工。&lt;/p&gt;
&lt;p&gt;你前面学了 CPU、GPU、内存、硬盘这些概念，下一步就是在自己电脑里把它们对上号。入口不复杂，记住这三条路就够。&lt;/p&gt;
&lt;p&gt;A) 任务管理器 -&gt; 性能（最常用）&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开方式一：右键开始菜单，点“任务管理器”。&lt;/li&gt;
&lt;li&gt;打开方式二：&lt;code&gt;Win + R&lt;/code&gt;，输入 &lt;code&gt;taskmgr&lt;/code&gt; 回车。&lt;/li&gt;
&lt;li&gt;如果只看到简版窗口，先点“更多详细信息”。&lt;/li&gt;
&lt;li&gt;进入“性能（Performance）”，依次点 &lt;code&gt;CPU / 内存 / 磁盘 / GPU&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;你会看到：CPU 名称与基础频率、内存总容量、磁盘型号与活动时间、GPU 名称与显存占用。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-7-4-performance.png&quot; alt=&quot;任务管理器 性能页面&quot;&gt;&lt;/p&gt;
&lt;p&gt;B) 设备管理器（看硬件列表与驱动状态）&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开方式一：&lt;code&gt;Win + X&lt;/code&gt; 菜单，点“设备管理器”。&lt;/li&gt;
&lt;li&gt;打开方式二：&lt;code&gt;Win + R&lt;/code&gt;，输入 &lt;code&gt;devmgmt.msc&lt;/code&gt; 回车。&lt;/li&gt;
&lt;li&gt;展开 &lt;code&gt;Display adapters / Processors / Disk drives / Network adapters&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;你会看到设备名称列表；如果有异常，通常会有黄色感叹号。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;C) 第三方工具：图吧工具箱（可选）&lt;/p&gt;
&lt;p&gt;如果你想一眼看汇总信息，可以把它当补充工具。下载地址：&lt;a href=&quot;https://www.tbtool.cn/&quot;&gt;https://www.tbtool.cn/&lt;/a&gt;。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开方式一：浏览器直接访问上面的官网地址下载。&lt;/li&gt;
&lt;li&gt;打开方式二：&lt;code&gt;Win + R&lt;/code&gt;，直接输入 &lt;code&gt;https://www.tbtool.cn/&lt;/code&gt; 回车。&lt;/li&gt;
&lt;li&gt;打开工具后看“硬件总览/传感器”一类页面，核对 CPU、内存、磁盘、GPU。&lt;/li&gt;
&lt;li&gt;如果和任务管理器显示略有差异，先以系统入口为准，再交叉确认。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;不同品牌电脑的显示项会有小差异，但入口基本一致：先看性能页，再看设备列表，最后用第三方做补充核对。&lt;/p&gt;
&lt;p&gt;第一件事是会打开。三种方式任选一种：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Ctrl + Shift + Esc&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;右键任务栏，点“任务管理器”。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Win + R&lt;/code&gt; 输入 &lt;code&gt;taskmgr&lt;/code&gt; 回车。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;第二件事是知道看哪几个标签页：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;进程（Processes）&lt;/code&gt;：按 CPU/内存排序，找谁在吃资源。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;性能（Performance）&lt;/code&gt;：看 CPU、内存、磁盘、GPU 的实时占用。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;启动应用（Startup）&lt;/code&gt;：看开机自启项（不同版本可能显示为“启动”或“启动应用”）。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;第三件事是会正确结束卡死程序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先确认是你认识且卡住的程序（比如浏览器、编辑器）。&lt;/li&gt;
&lt;li&gt;点选该进程。&lt;/li&gt;
&lt;li&gt;点“结束任务（End task）”。&lt;/li&gt;
&lt;li&gt;你应该看到程序窗口消失，CPU/内存占用回落。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;补一条安全线：别随便结束你不认识的系统进程，比如 &lt;code&gt;System&lt;/code&gt;、&lt;code&gt;Service Host&lt;/code&gt;、&lt;code&gt;Windows Explorer&lt;/code&gt;。不确定就先搜进程名或截图记录。进程本质上就是“正在运行的程序实例”。
不确定是不是系统进程时，先别结束；把进程名复制去搜一下，通常 30 秒就能判断。&lt;/p&gt;
&lt;p&gt;一个常见场景：电脑突然很卡，你先去“进程”按 CPU 排序，发现某程序长期 90% 以上。先保存手头工作，再结束它，通常就能把机器拉回可用状态。&lt;/p&gt;
&lt;p&gt;它的作用不是“装驱动神器”，而是先帮你判断硬件状态对不对。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开方式一：&lt;code&gt;Win + X&lt;/code&gt; -&gt; “设备管理器”。&lt;/li&gt;
&lt;li&gt;打开方式二：&lt;code&gt;Win + R&lt;/code&gt; 输入 &lt;code&gt;devmgmt.msc&lt;/code&gt; 回车。&lt;/li&gt;
&lt;li&gt;重点看四类：&lt;code&gt;Display adapters&lt;/code&gt;（显卡）、&lt;code&gt;Processors&lt;/code&gt;（CPU）、&lt;code&gt;Disk drives&lt;/code&gt;（硬盘）、&lt;code&gt;Network adapters&lt;/code&gt;（网卡）。&lt;/li&gt;
&lt;li&gt;如果看到黄色感叹号：右键设备 -&gt; &lt;code&gt;Properties/属性&lt;/code&gt; -&gt; &lt;code&gt;Device status/设备状态&lt;/code&gt;，先看系统给的原因。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;更新驱动时的新手顺序也很简单：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先去硬件官网或整机厂商官网找对应型号驱动。&lt;/li&gt;
&lt;li&gt;不要乱装来路不明的驱动包。&lt;/li&gt;
&lt;li&gt;Windows 更新有时会带驱动，但可能不是最新版本。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你看到两个显卡（核显 + 独显），大多数情况下是正常现象，这和前面讲的自动切换逻辑是一致的。&lt;/p&gt;
&lt;p&gt;一句话说清楚：远程桌面就是“把别的电脑当成你的电脑来用”，屏幕、键盘、鼠标都像在本地操作。&lt;br&gt;
你会用到它的场景通常就这几类：远程到家里或公司的电脑拿文件、远程到实验室机器跑任务、远程到云服务器做部署和维护。&lt;/p&gt;
&lt;p&gt;Windows 里最常见的连接步骤可以直接照做：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;按 &lt;code&gt;Win + R&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;输入 &lt;code&gt;mstsc&lt;/code&gt;，回车打开“远程桌面连接”。&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;Computer&lt;/code&gt; 里填目标机器的 IP 或机器名。&lt;/li&gt;
&lt;li&gt;点 &lt;code&gt;Show Options&lt;/code&gt;（可选）填用户名，避免每次重输。&lt;/li&gt;
&lt;li&gt;点 &lt;code&gt;Connect&lt;/code&gt; 开始连接。&lt;/li&gt;
&lt;li&gt;输入密码，并按提示确认首次证书窗口。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你应该看到的是：屏幕会弹出一个新窗口，窗口里是另一台电脑的桌面，你可以像本地一样打开程序和文件。&lt;/p&gt;
&lt;p&gt;常见坑先记四个：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;对方电脑没开机或进了睡眠，连接会直接失败。&lt;/li&gt;
&lt;li&gt;目标机没启用远程桌面，需要在“设置 -&gt; 系统 -&gt; 远程桌面”里打开允许远程连接。&lt;/li&gt;
&lt;li&gt;网络不通时会超时，公网场景可能要内网穿透或端口转发。&lt;/li&gt;
&lt;li&gt;账号权限不够也会被拒绝，而且不是所有 Windows 版本都适合当被远程主机。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;安全上保持克制就行：别把密码到处保存，能用强密码就用强密码。&lt;/p&gt;
&lt;p&gt;你可以把服务器理解成“24 小时开着的工作机器”。它优先考虑的是稳定、持续运行、可远程维护，而不是你坐在前面直接操作的体验。&lt;/p&gt;
&lt;p&gt;新手最容易误解的一点是：服务器并不神秘，它本质上也是 CPU、内存、硬盘组成的一台电脑。区别主要在用途和运行方式。你的笔记本更像个人工作台，服务器更像长期值守的生产机。&lt;/p&gt;
&lt;p&gt;很多服务器没有显示器和键盘，不是它不能接，而是日常没必要。管理员通常通过 SSH 或 RDP 远程进去做配置、部署、看日志。&lt;/p&gt;
&lt;p&gt;把流程串起来你就很清楚了：你在本机写代码 -&gt; push 到 GitHub -&gt; 部署到服务器，本质就是把程序从“你的开发电脑”搬到“另一台长期运行的机器”。&lt;/p&gt;
&lt;p&gt;台式机的关键词是扩展性、散热和性价比。适合长期固定开发、多屏办公、后续慢慢升级配件。&lt;br&gt;
笔记本强调便携，性能和续航是折中关系。适合学习、出门上课、移动办公。&lt;br&gt;
手机多数是 ARM 平台，适合“使用服务”而不是“开发主力”。它更像辅助终端，可以配合远程控制或云服务。&lt;br&gt;
工作站面向渲染、仿真、AI 这类专业负载，稳定性和扩展空间更重要。别被“工作站”这个名字吓到，还是看你实际任务。&lt;br&gt;
服务器核心是长期在线、远程管理、稳定运行。很多场景会用 Linux，而且常见无 GUI 或只保留最小图形环境。&lt;/p&gt;
&lt;p&gt;给新手的判断框架，先按这个来就够：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;先问自己：我是学习编程，还是已经有重度渲染/训练任务？&lt;/li&gt;
&lt;li&gt;学习和日常项目优先保证可用性：&lt;code&gt;16GB&lt;/code&gt; 内存 + 足够 SSD，通常比追极限型号更重要。&lt;/li&gt;
&lt;li&gt;需要固定工位和多屏就偏台式机；经常移动就偏笔记本。&lt;/li&gt;
&lt;li&gt;只有在任务明确需要时，再考虑工作站或服务器。&lt;/li&gt;
&lt;li&gt;大多数情况下，你现在手里的电脑已经能开始做项目。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;结语&quot;&gt;结语&lt;/h2&gt;
&lt;p&gt;如果你能把这篇文章从头到尾照着走一遍——哪怕只是跑通一次：装好环境、能在终端里跑起 &lt;code&gt;python&lt;/code&gt;、能在 VS Code 里写一段循环、能在 GitHub 上创建仓库并成功提交——那你其实已经完成了“入门”的核心。&lt;/p&gt;
&lt;p&gt;很多人以为编程入门是“背语法”，但我更愿意把它理解成一种生活化的能力：你能不能把一个问题拆开，找到资料，尝试验证，遇到报错不慌，最后把结果复现出来。你会发现，真正让人拉开差距的往往不是聪明，而是这套流程是否稳定。&lt;/p&gt;
&lt;p&gt;最后还是那句话：工具只是手段。你用 Python、用 VS Code、用 GitHub，甚至用 AI 插件，都没问题。重点不是“我用了什么”，而是“我有没有把问题搞清楚，并且能把它做出来”。&lt;/p&gt;
&lt;p&gt;为了让你不能有太大心里负担，我必须告诉你。本博客网站和你现在阅读的这篇文章我用了不少AI辅助，Chatgpt帮我写了不少，很好用。我为了节省了大量时间可以做别的事而高兴，很直观的提升了我的效率。&lt;/p&gt;</content:encoded><category>code</category><category>guide</category><category>CN</category></item><item><title>How to Get Started with Programming: Tools, Git, and Engineering Thinking</title><link>https://danarnoux.com/blog/how-to-get-started-with-programming-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-get-started-with-programming-en/</guid><description>From setting up your dev environment to version control, language choices, and engineering thinking, this guide gives beginners a complete and clear path to get started.</description><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;preface&quot;&gt;Preface&lt;/h2&gt;
&lt;p&gt;I’ve always believed this: people can’t imagine things outside what they already know. Even with AI this strong now, you still might not be able to build something you’re truly satisfied with just by prompting. And yes, you might feel anxious too. If AI is so powerful, does learning programming still matter? Won’t programmers be replaced anyway?&lt;/p&gt;
&lt;p&gt;I know you have a lot of questions. In my view, times change and answers change every day. Rules that work today may not work tomorrow, and rules that work tomorrow may not work today either. Instead of staying in the dark, I’d rather you understand at least a bit of how things work. Nothing in this world is really that mystical. If possible, touch it with your own hands. I really like this line: “Practice is the only criterion for testing truth.”&lt;/p&gt;
&lt;p&gt;Learning a skill is an honorable thing, and it can become a lifelong hobby. Whether you’re in middle school or just entered university, I think it’s worth learning how to use computers well, and even how to code and build projects.&lt;/p&gt;
&lt;p&gt;I also think everyone has talent in some area. Sometimes it’s just not discovered yet because of environment or life experience. Maybe I walk past future geniuses every day and they don’t even know it. What I hope is that more students get sparked by one accidental moment when they’re young, then turn that spark into a real hobby.&lt;/p&gt;
&lt;p&gt;As for me, I’m from Zhejiang. In high school we had a technical elective, and the information technology part was Python. Back then our school had an OJ problem site. Everyone loved occupying the computers to solve problems, and in free time we explored a lot of fun stuff. We didn’t realize it then, but that was the start of a different life path for many of us.&lt;/p&gt;
&lt;p&gt;Whether you’re in engineering or the humanities, I still think it’s useful to understand these core ideas. When you make decisions later, I can’t guarantee you won’t feel confused. Sometimes knowing more actually gives you more confusion first. But then a big question mark appears in your mind, and you finally start thinking in a directed way.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-what-is-programming&quot;&gt;1. What Is Programming&lt;/h2&gt;
&lt;p&gt;Programming is not as mysterious as it looks. It’s more like an engineering expression skill: break a problem down, arrange the steps, and let the machine execute them reliably.&lt;/p&gt;
&lt;p&gt;You don’t need to understand every low-level detail at the beginning. Just remember one thing first: you’re not writing flashy syntax, you’re building a process that can be reproduced, debugged, and maintained.&lt;/p&gt;
&lt;h3 id=&quot;11-where-programming-sits-in-the-computer-stack&quot;&gt;1.1 Where Programming Sits in the Computer Stack&lt;/h3&gt;
&lt;p&gt;Think of it as a bottom-up chain. At the bottom is hardware: CPU, memory, and storage. The CPU also has its architecture (x86, ARM), which decides which instruction set the machine can understand.&lt;/p&gt;
&lt;p&gt;Above that is the operating system (Windows / Linux / macOS). It manages the hardware and gives programs a unified interface. When your code touches files, network, or windows, the OS is what handles all that underneath.&lt;/p&gt;
&lt;p&gt;Programming languages sit in the middle as a translation layer. You write Python or C, but the machine finally executes lower-level instructions. At the top are applications, like the browser or editor you click every day, or the small tools you build yourself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What are Windows and Linux?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Windows and Linux are operating systems, not programming languages. You can think of them as managers: they allocate hardware resources and define execution rules.&lt;/p&gt;
&lt;p&gt;I’ve seen many beginners confuse “I can use Windows” with “I can program.” That’s normal. An OS is more like the runtime environment. It decides how programs access files, request memory, and talk to devices.&lt;/p&gt;
&lt;p&gt;The system is the stage, the program is the actor, and the language is how you write the script. Once you separate these roles, a lot of concepts stop mixing together.&lt;/p&gt;
&lt;h3 id=&quot;12-paths-and-directories-path-root-directory-relative-path&quot;&gt;1.2 Paths and Directories: Path, Root Directory, Relative Path&lt;/h3&gt;
&lt;p&gt;You can think of a path as an address and house number. When a program looks for a file, it’s really asking, “Where exactly is it?”&lt;/p&gt;
&lt;p&gt;For example, &lt;code&gt;C:\Users\Dan\Desktop\learning\hello.txt&lt;/code&gt; is a full address. When you use &lt;code&gt;cd&lt;/code&gt; in a terminal, you’re walking to the right floor first, then picking up the file.&lt;/p&gt;
&lt;p&gt;Here’s a very common pitfall: Chinese folder names are not always impossible, but with some toolchains, encoding settings, old libraries, or command-line combinations, non-ASCII paths can occasionally cause weird issues. To reduce random trouble, using English folder names is usually safer: short names like &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;folder&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;, &lt;code&gt;data&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt; work great.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is the root directory&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Windows, &lt;code&gt;C:\&lt;/code&gt; is a root. You can treat it like a top-level entry point, then beneath it you have user directories, project directories, and data directories. Long paths are just layers going down from this entry.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is a relative path&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A relative path is written relative to your current directory. An absolute path like &lt;code&gt;C:\Users\Dan\Desktop\learning\hello.txt&lt;/code&gt; goes straight to the target. A relative path like &lt;code&gt;.\hello.txt&lt;/code&gt; or &lt;code&gt;data\input.txt&lt;/code&gt; starts from where you’re standing now.&lt;/p&gt;
&lt;p&gt;The most common reason relative paths fail is not that the file doesn’t exist, but that you’re in the wrong directory. You think you’re in &lt;code&gt;learning&lt;/code&gt;, but your terminal is still one level above.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows users can skip this short part:&lt;/strong&gt;&lt;br&gt;
On Mac, the root directory is &lt;code&gt;/&lt;/code&gt;, and your home directory is usually &lt;code&gt;/Users/your-username&lt;/code&gt;.&lt;br&gt;
Relative path rules are the same, typically &lt;code&gt;./&lt;/code&gt; and &lt;code&gt;../&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;13-architecture-differences-x86-vs-arm&quot;&gt;1.3 Architecture Differences: x86 vs ARM&lt;/h3&gt;
&lt;p&gt;x86 and ARM are two mainstream CPU architectures. You can treat them as two different machine dialects. Traditional PCs have long been mostly x86, phones and tablets are mostly ARM, and new Macs (Apple Silicon) are ARM too.&lt;/p&gt;
&lt;p&gt;Your code is always translated into instructions the target architecture can execute. Over time you’ll notice: the same code on different devices can have compatibility differences. Often that’s not your coding mistake, just platform differences underneath.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where programming languages fit in this system&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is where people mix things up most easily. Python is not an OS, and C is not a CPU. A language is a translation layer that organizes your ideas into something machines can run.&lt;/p&gt;
&lt;p&gt;Once this position is clear, terms like “system error,” “interpreter version,” and “architecture compatibility” stop feeling like one tangled ball.&lt;/p&gt;
&lt;h3 id=&quot;14-core-programming-concepts-flow-script-variables-coding&quot;&gt;1.4 Core Programming Concepts: Flow, Script, Variables, Coding&lt;/h3&gt;
&lt;p&gt;A grounded example: batch-renaming images in your Downloads folder. First locate the target directory, then filter &lt;code&gt;.jpg&lt;/code&gt; / &lt;code&gt;.png&lt;/code&gt;, then define sorting and naming rules, and finally log failed items and retry.&lt;/p&gt;
&lt;p&gt;You’ll notice what matters is process design, not how many syntax tricks you memorized. That’s algorithmic thinking. Language is a tool; process is the core.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is a script?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A script is a small program for a specific task. The point is reducing repetitive work.&lt;/p&gt;
&lt;p&gt;Things like organizing your Downloads folder, batch-renaming files, and auto-summarizing text are all script-friendly. It doesn’t have to be complex to be very practical.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is a variable?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A variable is a name for data. Good names make code readable even days later; random names make code turn into riddles quickly.&lt;/p&gt;
&lt;p&gt;If you’re counting images, &lt;code&gt;image_count&lt;/code&gt; needs no explanation. If you call it &lt;code&gt;a1&lt;/code&gt;, even you may have to guess what it means after three days. I made this mistake when I first wrote scripts: the code ran, but a month later I didn’t even want to touch it.&lt;/p&gt;
&lt;p&gt;Variables look small, but they directly affect readability and your debugging speed later.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is coding?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;From another angle, coding is not a typing competition. It’s organization ability. You’re breaking an idea into executable structure: where variables go, how flow moves, how functions split, how modules are separated.
Here, “coding” means writing code and turning ideas into programs, not character encodings like UTF-8.&lt;/p&gt;
&lt;p&gt;If the structure is clear, future changes are easier. If the structure is messy, every new feature hurts. It’s normal if this still feels vague now. Start from one rule: write code that you yourself can understand later.&lt;/p&gt;
&lt;h3 id=&quot;15-english-and-reading-errors-important-but-dont-panic&quot;&gt;1.5 English and Reading Errors: Important, But Don’t Panic&lt;/h3&gt;
&lt;p&gt;Don’t turn this into an anxiety competition. You don’t need to memorize a whole dictionary before learning programming. I don’t suggest you pause coding to formally “start learning English first”; learn while doing.&lt;/p&gt;
&lt;p&gt;But one thing is practical: sooner or later you’ll read English errors, English docs, and English issues. Whether you can extract key information directly affects your debugging speed.&lt;/p&gt;
&lt;p&gt;So the goal is not “perfect English.” The goal is: understand core technical words, and understand your own variable names and error messages.&lt;/p&gt;
&lt;h3 id=&quot;16-common-beginner-mistakes-and-mindset&quot;&gt;1.6 Common Beginner Mistakes and Mindset&lt;/h3&gt;
&lt;p&gt;I’ve seen many beginners get stuck in similar places: memorizing syntax without building anything, watching videos without hands-on practice, stopping at the first error, treating AI as magic without verification, or endlessly “preparing” without starting. And for AI specifically, asking it to build a whole website when you don’t know your own requirements is like becoming a vague client; the result often won’t match what you want.&lt;/p&gt;
&lt;p&gt;These are usually rhythm problems, not ability problems. Build one tiny runnable result first, then add complexity step by step. Your mindset gets much steadier that way.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pick the route first, then install tools&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Many beginners get stuck on environment setup before writing a single line of code.&lt;/p&gt;
&lt;p&gt;I recommend deciding direction first: pick Python as your first language, then run the minimum loop: “write -&gt; run -&gt; fix.”&lt;/p&gt;
&lt;p&gt;Once you feel “it runs,” tool details become much easier to digest. Next I’ll talk about language choice first, then environment setup.&lt;/p&gt;
&lt;h2 id=&quot;2-c-or-python&quot;&gt;2. C or Python?&lt;/h2&gt;
&lt;p&gt;I’ll give you a stable recommendation here: learn Python first. Whether you’re from humanities, science/engineering, changing careers, or still in school, Python is usually the easiest way to build early positive feedback.&lt;/p&gt;
&lt;h3 id=&quot;21-why-start-with-python&quot;&gt;2.1 Why Start with Python&lt;/h3&gt;
&lt;p&gt;Python’s biggest advantage is fast feedback. You write a few lines and see a result immediately. That’s huge for beginners, because you keep getting the feeling that “I’m actually moving forward.” If you get timely positive feedback while learning, you’re more likely to stay interested and improve faster. I don’t want your first experience to be pure frustration from starting too hard.&lt;/p&gt;
&lt;p&gt;Its syntax is also more intuitive, and its resources/community are mature. When you hit problems, there are usually workable answers. I’ve seen many beginners quit not because coding is impossible, but because they get no positive feedback for too long. Python is genuinely friendlier here.&lt;/p&gt;
&lt;h3 id=&quot;22-python-in-10-minutes-up-to-loops&quot;&gt;2.2 Python in 10 Minutes (Up to Loops)&lt;/h3&gt;
&lt;p&gt;Let’s define scope first: this part only takes you up to loops, enough to run your first small program. Functions, lists, dicts, and file operations are intentionally not expanded here. You can verify this later after finishing environment setup, or skip to 2.4 for now.&lt;/p&gt;
&lt;p&gt;Think of variables as “naming data.” Clear names make code easier to read.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;Dan&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 18&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(name, age)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running, you should see one line like &lt;code&gt;Dan 18&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;print()&lt;/code&gt; outputs, &lt;code&gt;input()&lt;/code&gt; takes input. &lt;code&gt;input()&lt;/code&gt; returns a string, so convert with &lt;code&gt;int()&lt;/code&gt; before numeric operations.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;请输入你的年龄：&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;明年你是&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, age &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;岁&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running, enter a number and you’ll see “next year you are xx years old.”&lt;/p&gt;
&lt;p&gt;&lt;code&gt;if&lt;/code&gt; is conditional branching: only execute that branch when the condition is met.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;score &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 72&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; score &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 60&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;及格&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;再练练&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running, you’ll see &lt;code&gt;Pass&lt;/code&gt; (because the example score is 72).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;for&lt;/code&gt; is commonly used for fixed-count repetition. &lt;code&gt;range(5)&lt;/code&gt; is 0 to 4; &lt;code&gt;range(1, 6)&lt;/code&gt; is 1 to 5.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running, it prints 1 through 5 line by line.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;while&lt;/code&gt; is for “keep looping while condition is true.” For example, accumulate until reaching 100:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 100&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; n&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(total, n &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running, it prints the accumulated result and the last added number (something like &lt;code&gt;105 14&lt;/code&gt;).&lt;/p&gt;
&lt;h3 id=&quot;23-self-learning-entry-and-mini-exercises&quot;&gt;2.3 Self-Learning Entry and Mini Exercises&lt;/h3&gt;
&lt;p&gt;Once you can handle loops, you have enough to start. For functions, lists, dicts, files, and modules, learn them next by yourself. The core isn’t “memorize everything”; it’s learning to search, read docs, and verify outputs.&lt;/p&gt;
&lt;p&gt;A good place to start is Runoob: &lt;a href=&quot;https://www.runoob.com/&quot;&gt;https://www.runoob.com/&lt;/a&gt;. When you meet new syntax, don’t rush to memorize. Run a minimal example first and see exactly what it does.&lt;/p&gt;
&lt;p&gt;Here’s one mini exercise. Get a working result first, then optimize gradually:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Narcissistic numbers&lt;/strong&gt; (also called Armstrong numbers): for an n-digit number, the sum of each digit to the power of n equals the number itself. For 3-digit numbers, it means the sum of cubes of each digit equals the original number. I want you to find all narcissistic numbers in &lt;code&gt;100~999&lt;/code&gt;.&lt;br&gt;
Hint: split into hundreds/tens/ones, cube each digit, compare with the original number.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;24-python-use-cases-and-language-comparison&quot;&gt;2.4 Python Use Cases and Language Comparison&lt;/h3&gt;
&lt;p&gt;Its use cases are broad. In humanities, you can do text analysis, spreadsheet cleaning, and visualization. In economics/finance, common tasks include indicator calculations and report automation. In geography, you can process cloud maps and spatial data. On the science/engineering side, it’s great for experiment data cleaning, batch plotting, parameter scanning, and simple numerical computation. Move one step further and you’ll see it in automation scripts, web backends, AI preprocessing, and training scripts. You don’t need to master all of this at once. Build one small result in the scenario you care about most first; your learning speed will be much higher.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Python vs C: a minimal example&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Same goal: print 1 to 5.&lt;/p&gt;
&lt;p&gt;Python:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;c&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &amp;#x3C;stdio.h&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;        printf&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;%d\n&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, i);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This example isn’t to say one language is “more advanced.” It’s just to show entry friction differences directly.&lt;/p&gt;
&lt;h3 id=&quot;25-should-you-learn-c-later&quot;&gt;2.5 Should You Learn C Later?&lt;/h3&gt;
&lt;p&gt;Should you learn it? Depends on your direction. Build programming intuition with Python first. If you later move into systems, performance, or low-level work, adding C becomes much smoother.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A minimal starter route&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Learn Python basics first (variables, branching, loops, functions).&lt;/li&gt;
&lt;li&gt;Build one runnable script (for example, batch rename).&lt;/li&gt;
&lt;li&gt;When you hit errors, search, fix, and rerun.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Run this route once, and your foundation is stable.&lt;/p&gt;
&lt;h2 id=&quot;3-development-environment-setup&quot;&gt;3. Development Environment Setup&lt;/h2&gt;
&lt;h3 id=&quot;31-editors-and-ides-why-start-with-vs-code&quot;&gt;3.1 Editors and IDEs: Why Start with VS Code&lt;/h3&gt;
&lt;p&gt;If you’re just starting, I’d suggest Visual Studio Code first.&lt;/p&gt;
&lt;p&gt;Let’s define IDE quickly. IDE (Integrated Development Environment) is like an all-in-one toolkit: editor, debugger, runner, project management, and so on. PyCharm and Visual Studio are typical IDEs.&lt;/p&gt;
&lt;p&gt;I don’t recommend heavy IDEs on day one, not because they’re bad, but because too many features can distract you from the core question: “How does code actually run?” At the beginning, understanding that baseline flow matters more.&lt;/p&gt;
&lt;p&gt;VS Code sits between a plain editor and a heavy IDE: lightweight by default, expandable when needed, enough without overload. That balance is very beginner-friendly.&lt;/p&gt;
&lt;p&gt;The reasons are practical: cross-language support, mature extension ecosystem, usable integrated terminal, and handy Git integration. One unified toolchain means less mental load early on.&lt;/p&gt;
&lt;p&gt;I got stuck during my first setup too. So many options on screen felt overwhelming. That’s normal. Get the toolchain running first; tune habits later.&lt;/p&gt;
&lt;p&gt;Official site: &lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Install the minimum set of extensions first; enough is enough:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Python&lt;/code&gt; (&lt;code&gt;ms-python.python&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pylance&lt;/code&gt; (&lt;code&gt;ms-python.vscode-pylance&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Markdown All in One&lt;/code&gt; (&lt;code&gt;yzhang.markdown-all-in-one&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GitLens&lt;/code&gt; (&lt;code&gt;eamodio.gitlens&lt;/code&gt;, optional)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;32-python-extension-and-interpreter-what-vs-code-actually-does&quot;&gt;3.2 Python Extension and Interpreter: What VS Code Actually Does&lt;/h3&gt;
&lt;p&gt;This part confuses beginners easily. The &lt;code&gt;Python&lt;/code&gt; and &lt;code&gt;Pylance&lt;/code&gt; extensions mainly provide editor features: syntax highlighting, completion, jump-to-definition, type hints, debugging entry, etc.&lt;/p&gt;
&lt;p&gt;They make writing smoother, but they are not the Python interpreter itself. The key sentence again: &lt;strong&gt;installing Python extension in VS Code does not mean Python is installed on your computer.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One layer deeper: VS Code is mostly your “write code and organize projects” workstation, not the runtime itself. It can call your system terminal, interpreter, and Git, but it does not install Python for you. Whether &lt;code&gt;python&lt;/code&gt; runs in VS Code depends on whether your system has a usable interpreter and correct path config.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Select Interpreter&lt;/code&gt; action in VS Code is basically telling the editor which Python on your machine this project should use.&lt;/p&gt;
&lt;p&gt;Try this once directly: open VS Code, press &lt;code&gt;Ctrl + Shift + P&lt;/code&gt;, type &lt;code&gt;Python: Select Interpreter&lt;/code&gt;, then choose the &lt;code&gt;learn&lt;/code&gt; environment you created. If you pick the wrong one, VS Code may run a different Python than the one you just installed.&lt;/p&gt;
&lt;p&gt;After selecting correctly, the status bar usually shows the current Python environment/version (position may vary by theme). That’s the most direct success signal.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-3-3-vscode-python.png&quot; alt=&quot;VS Code Python extension example&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;33-vs-code-installation-chinese-language-pack-and-extensions&quot;&gt;3.3 VS Code Installation, Chinese Language Pack, and Extensions&lt;/h3&gt;
&lt;p&gt;Start with the safest path. Don’t tweak too many options at first.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the VS Code site and download the Windows installer.&lt;br&gt;
You should see a clear &lt;code&gt;Download for Windows&lt;/code&gt; button.&lt;/li&gt;
&lt;li&gt;During installation, recommended options:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Add to PATH&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Open with Code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;(optional) &lt;code&gt;Register Code as an editor for supported file types&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Launch VS Code after installation.&lt;br&gt;
You should see the left activity bar (Explorer/Search/Source Control/Run/Extensions).&lt;/li&gt;
&lt;li&gt;Open Extensions (the square icon), search and install the Simplified Chinese pack:&lt;br&gt;
&lt;code&gt;Chinese (Simplified) Language Pack for Visual Studio Code&lt;/code&gt; (official Microsoft pack).&lt;/li&gt;
&lt;li&gt;Restart VS Code when prompted.&lt;br&gt;
After restart, UI should switch to Chinese (if not, manually switch display language in Command Palette).&lt;/li&gt;
&lt;li&gt;If you prefer Traditional Chinese, there’s also:&lt;br&gt;
&lt;code&gt;Chinese (Traditional) Language Pack for Visual Studio Code&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Do three things on first launch:
&lt;ul&gt;
&lt;li&gt;Switch UI language to what you’re comfortable with.&lt;/li&gt;
&lt;li&gt;Install the minimal extension list above.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + ~&lt;/code&gt; to open terminal and confirm commands can be entered normally.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Windows users can skip this short part:&lt;/strong&gt;&lt;br&gt;
VS Code also provides a macOS build at &lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;.&lt;br&gt;
After install, open it directly; extension logic and interpreter selection are basically the same as on Windows.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is a development environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Think of it as your programming workbench. The editor is for writing code, interpreter/compiler turns code into runnable behavior, and terminal is where you run commands and execute programs.&lt;/p&gt;
&lt;p&gt;Package managers (like &lt;code&gt;pip&lt;/code&gt;, &lt;code&gt;conda&lt;/code&gt;) install and manage dependencies, while runtime defines what conditions your code runs under. You don’t need to master everything at once; it’s enough to know these parts work together.&lt;/p&gt;
&lt;h3 id=&quot;34-terminal-and-winr-get-command-line-running-first&quot;&gt;3.4 Terminal and Win+R: Get Command Line Running First&lt;/h3&gt;
&lt;p&gt;What are CMD, PowerShell, and VS Code terminal exactly?&lt;/p&gt;
&lt;p&gt;At first the black window may feel scary, but it’s just a place to type commands.&lt;/p&gt;
&lt;p&gt;They’re all command-line entry points. CMD is simpler and easier to start with. PowerShell is more powerful. VS Code Terminal is basically one of these embedded in your editor so you switch fewer windows.&lt;/p&gt;
&lt;p&gt;Pick one first. I suggest CMD.&lt;/p&gt;
&lt;p&gt;Memorize a few core commands first: &lt;code&gt;cd&lt;/code&gt; to change directory, &lt;code&gt;dir&lt;/code&gt; to list files, &lt;code&gt;mkdir&lt;/code&gt; to create directory, &lt;code&gt;rmdir&lt;/code&gt; to remove empty directory, &lt;code&gt;echo&lt;/code&gt; to output text, &lt;code&gt;cls&lt;/code&gt; to clear screen.&lt;/p&gt;
&lt;p&gt;Try this 3-minute exercise (copy-paste ready):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;mkdir &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;%USERPROFILE%\Desktop\learning&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 创建 learning 文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;cd /d &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;%USERPROFILE%\Desktop\learning&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 进入 learning 文件夹（/d 支持切换盘符）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;echo Hello Programming &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; hello.txt      # 创建并写入 hello.txt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;dir                                     # 查看当前目录内容&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;type hello.txt                          # 查看文件内容&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;mkdir temp                              # 创建 temp 子文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;rmdir temp                              # 删除空的 temp 子文件夹&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;cls                                     # 清空终端屏幕&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will most likely see: after &lt;code&gt;dir&lt;/code&gt;, &lt;code&gt;hello.txt&lt;/code&gt; appears in the list; after &lt;code&gt;type hello.txt&lt;/code&gt;, output is &lt;code&gt;Hello Programming&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Two common pitfalls: forgetting &lt;code&gt;cd /d&lt;/code&gt; so drive letter doesn’t switch; or creating files before entering &lt;code&gt;learning&lt;/code&gt;, so files appear elsewhere.&lt;/p&gt;
&lt;p&gt;If you understand what each command does, you’ve cleared the first terminal hurdle.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to open system command line (Win + R)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’re not inside VS Code, open system command line directly: press &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;cmd&lt;/code&gt;, press Enter.&lt;/p&gt;
&lt;p&gt;After opening, you’ll usually see a prompt like &lt;code&gt;C:\Users\your-username&gt;&lt;/code&gt;. That’s your current directory.&lt;/p&gt;
&lt;p&gt;If you accidentally open PowerShell, no need to panic. Most basic commands still work. Getting the workflow running matters most.&lt;/p&gt;
&lt;p&gt;The terminal at the bottom of VS Code is essentially the same command-line environment embedded in the editor. Many commands follow the exact same logic.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mac users can skip this Windows part:&lt;/strong&gt;&lt;br&gt;
On Mac, open Terminal (search &lt;code&gt;Terminal&lt;/code&gt; with Spotlight).&lt;br&gt;
Most commands are similar; Windows commonly uses &lt;code&gt;cmd&lt;/code&gt;, Mac commonly uses &lt;code&gt;bash/zsh&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;35-python-runtime-miniconda-and-installation-route&quot;&gt;3.5 Python Runtime, Miniconda, and Installation Route&lt;/h3&gt;
&lt;p&gt;I recommend Miniconda. Maybe Anaconda can be better in some cases, but I still hope you get familiar with terminal operations.&lt;/p&gt;
&lt;p&gt;I still recommend Miniconda because it’s lightweight, controllable, and great for environment isolation.&lt;/p&gt;
&lt;p&gt;Miniconda official download page: &lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;https://docs.conda.io/en/latest/miniconda.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Remember three words first: Python version (e.g. 3.10, 3.11), packages (third-party libraries like &lt;code&gt;requests&lt;/code&gt;), and virtual environment (each project uses its own dependencies without conflicts).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where is Python actually installed?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are two common ways to install Python. One is direct install from the official Python site: &lt;a href=&quot;https://www.python.org/&quot;&gt;https://www.python.org/&lt;/a&gt;. The other is installing Miniconda, which also includes its own Python.&lt;/p&gt;
&lt;p&gt;Both ways work. Pick one. For beginners, I recommend starting with Miniconda to save trouble when you isolate environments later.&lt;/p&gt;
&lt;p&gt;One more time for the most common misunderstanding: &lt;strong&gt;installing Python extension in VS Code does not mean Python is installed on your computer.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to confirm Python is really installed&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After installation, run this minimum check first:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version      # 查看 Python 版本&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python          # 查看 python 执行路径&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Normally you’ll see something like &lt;code&gt;Python 3.11.x&lt;/code&gt;, plus a &lt;code&gt;python.exe&lt;/code&gt; path pointing to your Miniconda directory.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;python --version&lt;/code&gt; doesn’t respond or says command not found, PATH is usually not effective yet, or terminal session wasn’t refreshed. If &lt;code&gt;where python&lt;/code&gt; points to a non-Miniconda path, you likely have multiple Python installs or PATH order is pointing to a different one first.&lt;/p&gt;
&lt;p&gt;After changing PATH, remember to close all terminal windows and reopen.&lt;/p&gt;
&lt;p&gt;If you can see both version and clear path, your runtime is basically ready. If not, don’t panic. Most of the time it’s just environment variables or terminal session not refreshed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use Tsinghua Mirror for Acceleration (Strongly recommended for users in mainland China)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tsinghua open-source mirror: &lt;a href=&quot;https://mirrors.tuna.tsinghua.edu.cn/&quot;&gt;https://mirrors.tuna.tsinghua.edu.cn/&lt;/a&gt;. You can think of the “Tsinghua source” as a synchronized domestic mirror of official repositories. It’s not a modified fork; content still comes from upstream, just via a more stable local route.&lt;/p&gt;
&lt;p&gt;If you’ve tried installing &lt;code&gt;pandas&lt;/code&gt; or &lt;code&gt;numpy&lt;/code&gt; in China, you’ve probably seen commands freeze for a long time. Often that’s not your code, just unstable default source connectivity. Switching to mirror usually makes downloads much smoother.&lt;/p&gt;
&lt;p&gt;If you want to confirm paths yourself: open the mirror homepage, search &lt;code&gt;anaconda&lt;/code&gt;, and you’ll find common channels. &lt;code&gt;pkgs/main&lt;/code&gt; is core packages, &lt;code&gt;pkgs/free&lt;/code&gt; is older compatibility packages, &lt;code&gt;cloud/conda-forge&lt;/code&gt; is community-maintained packages with faster updates.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;channel&lt;/code&gt; is basically the repository list conda checks in order when resolving packages. Run the following in &lt;strong&gt;Miniconda Prompt&lt;/strong&gt;, not plain CMD:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/         # 添加主仓库镜像（常用基础包）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/         # 添加历史仓库镜像（兼容旧依赖）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;forge/ # 添加 conda&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;forge 镜像（社区包更全）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;show_channel_urls yes                                                      # 显示包来源通道，排错时更容易定位&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;pip&lt;/code&gt; uses official PyPI by default, which can also be slow on some domestic networks. Setting &lt;code&gt;index-url&lt;/code&gt; becomes persistent:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global.index&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;url https://pypi.tuna.tsinghua.edu.cn/simple  # 设置 pip 默认镜像（持久生效）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config list                                                            # 查看配置是否生效&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you want to revert to default source later, run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip config unset global.index&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;url  # 取消自定义镜像，恢复默认 PyPI&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;36-miniconda-installation-and-verification-loop&quot;&gt;3.6 Miniconda Installation and Verification Loop&lt;/h3&gt;
&lt;p&gt;I’ll split this into “domestic download” and “international download.” Follow it and you’ll close the loop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Domestic users (Tsinghua mirror) download path&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;a href=&quot;https://mirrors.tuna.tsinghua.edu.cn/&quot;&gt;https://mirrors.tuna.tsinghua.edu.cn/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;On the homepage, look at the “download links” module on the right.&lt;/li&gt;
&lt;li&gt;Click the blue button “Get download links”.&lt;/li&gt;
&lt;li&gt;In the popup, switch to “Applications (or Application Software)” tab, select &lt;code&gt;Conda&lt;/code&gt; on the left, then choose &lt;code&gt;Miniconda3-latest (Windows/x86_64, exe)&lt;/code&gt; on the right.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;x86_64&lt;/code&gt; means 64-bit Windows, which is most computers; don’t select Linux &lt;code&gt;.sh&lt;/code&gt; or macOS &lt;code&gt;.pkg&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Downloaded filename usually looks like &lt;code&gt;Miniconda3-latest-Windows-x86_64.exe&lt;/code&gt;; this format is normally correct.&lt;/li&gt;
&lt;li&gt;Save the &lt;code&gt;.exe&lt;/code&gt; installer to an English-path directory (like &lt;code&gt;Downloads&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-3-6-tsinghua-miniconda.png&quot; alt=&quot;Tsinghua mirror Miniconda download page&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;International users (official site) download path&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;https://docs.conda.io/en/latest/miniconda.html&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Find &lt;code&gt;Windows 64-bit Installer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Download the corresponding &lt;code&gt;.exe&lt;/code&gt; installer.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Windows users can skip this short part:&lt;/strong&gt;&lt;br&gt;
Mac users can download macOS builds on the same page (choose Apple Silicon / Intel based on your device).&lt;br&gt;
After installation, run &lt;code&gt;conda --version&lt;/code&gt; in Terminal for a minimum verification.&lt;/p&gt;
&lt;p&gt;After download, installation steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Double-click installer.&lt;/li&gt;
&lt;li&gt;For user scope, &lt;code&gt;Just Me&lt;/code&gt; is recommended (less permission issues on personal machines).&lt;/li&gt;
&lt;li&gt;Installation path recommendation: &lt;code&gt;C:\Miniconda3&lt;/code&gt;; avoid Chinese path and spaces.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Add Miniconda to PATH&lt;/code&gt;: if this is your first install, checking it is recommended so &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;conda&lt;/code&gt; work directly in CMD. If you later manage multiple Python versions, you can adopt stricter isolation workflows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Register Miniconda as default Python&lt;/code&gt; is recommended, so common tools prioritize this Python. If your existing projects depend on another Python, decide based on your situation.&lt;/li&gt;
&lt;li&gt;After installation, search Start Menu and open &lt;code&gt;Miniconda Prompt&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don’t want to modify system PATH, you can leave it unchecked; but for beginners, checking it usually avoids more pitfalls. I’ll also show verification and manual handling below.
&lt;strong&gt;Verify immediately after install&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After installation, run these three commands in &lt;code&gt;Miniconda Prompt&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version              # 确认 conda 可用&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version             # 确认 Python 可用（来自 Miniconda）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python                 # 确认 python 路径指向 Miniconda 目录&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda --version&lt;/code&gt; should output something like &lt;code&gt;conda 24.x.x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python --version&lt;/code&gt; should output something like &lt;code&gt;Python 3.11.x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;first path in &lt;code&gt;where python&lt;/code&gt; usually should point to &lt;code&gt;C:\Miniconda3\python.exe&lt;/code&gt; (or your own Miniconda directory)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where python&lt;/code&gt; may print multiple lines; the first line is the currently prioritized Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;37-path-environment-variable-manual-handling-when-you-dont-check-it&quot;&gt;3.7 PATH Environment Variable: Manual Handling When You Don’t Check It&lt;/h3&gt;
&lt;p&gt;This sounds very “system settings” at first, but once you do it once, it becomes easy.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right-click “This PC” on desktop or in Explorer.&lt;/li&gt;
&lt;li&gt;Click “Properties”.&lt;/li&gt;
&lt;li&gt;Click “Advanced system settings”.&lt;/li&gt;
&lt;li&gt;In the popup, click “Environment Variables”.&lt;/li&gt;
&lt;li&gt;In “System variables”, find &lt;code&gt;Path&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click “Edit”.&lt;/li&gt;
&lt;li&gt;Click “New”.&lt;/li&gt;
&lt;li&gt;Add your Miniconda directory, e.g. &lt;code&gt;C:\Miniconda3&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click “New” again and add &lt;code&gt;C:\Miniconda3\Scripts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click “OK” all the way to save.&lt;/li&gt;
&lt;li&gt;Close all opened terminals, then reopen.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can think of &lt;code&gt;PATH&lt;/code&gt; as the system’s “search directory list” for executables. When you type &lt;code&gt;python&lt;/code&gt; in &lt;code&gt;cmd&lt;/code&gt;, Windows checks this list top-to-bottom to find &lt;code&gt;python.exe&lt;/code&gt;. If the directory isn’t listed, command line will say it can’t find Python.&lt;/p&gt;
&lt;p&gt;Why reopen terminal? Because terminal reads an environment snapshot when it launches. If you change PATH later, old windows won’t auto-refresh; only new windows read the new values.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to verify PATH is effective&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After configuration, check immediately:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python   # 查看 python 实际命中路径&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;PATH&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    # 打印当前 PATH 列表，确认是否包含 Miniconda 目录&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If &lt;code&gt;where python&lt;/code&gt; shows your newly configured path, it’s basically effective.&lt;/p&gt;
&lt;h3 id=&quot;38-create-the-learn-environment-and-common-pitfalls&quot;&gt;3.8 Create the &lt;code&gt;learn&lt;/code&gt; Environment and Common Pitfalls&lt;/h3&gt;
&lt;p&gt;Run these in Miniconda Prompt:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda create &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;n learn python&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3.11&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  # 创建名为 learn 的 Python &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3.11&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; 环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda activate learn               # 激活 learn 环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;python &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version                   # 检查当前 Python 版本&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;pip install requests               # 在当前环境安装 requests 包&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda deactivate                   # 退出当前环境&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After &lt;code&gt;conda activate learn&lt;/code&gt;, you’ll usually see &lt;code&gt;(learn)&lt;/code&gt; on the left side of prompt. That’s the most direct activation signal.&lt;/p&gt;
&lt;p&gt;When you run &lt;code&gt;conda create -n learn python=3.11&lt;/code&gt; for the first time, you’ll usually see:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Proceed ([y]/n)?&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;y&lt;/code&gt; and press Enter to continue.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;pip install requests&lt;/code&gt; times out or is very slow, go back to the Tsinghua mirror section above and check if mirror configuration is effective.&lt;/p&gt;
&lt;p&gt;Another common pitfall: installing packages without activating target environment first. Then packages may go into &lt;code&gt;base&lt;/code&gt; or system environment, and when you switch environment later you’ll get &lt;code&gt;ModuleNotFoundError&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If this command set runs through, you’ve finished your first usable dev environment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you run into these cases:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;python&lt;/code&gt; is not recognized as an internal or external command&lt;br&gt;
Usually PATH is not configured correctly, or you didn’t reopen terminal after changing PATH. Fastest check: &lt;code&gt;where python&lt;/code&gt;, then reopen terminal.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where python&lt;/code&gt; points somewhere else&lt;br&gt;
You probably have multiple Python installs and current one is not the one you expect. Fastest fix: adjust PATH order, or explicitly use &lt;code&gt;C:\Miniconda3\python.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;conda&lt;/code&gt; is not a command&lt;br&gt;
You’re most likely not in Miniconda Prompt. Fastest fix: open Miniconda Prompt and run again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ModuleNotFoundError&lt;/code&gt;&lt;br&gt;
Confirm VS Code interpreter matches your active environment, then run &lt;code&gt;pip install&lt;/code&gt; inside that same environment.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Pitfalls you’ll likely hit&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Most common ones: &lt;code&gt;python&lt;/code&gt; not recognized, multiple Python installs with unclear active one, or &lt;code&gt;pip&lt;/code&gt; installing into system env instead of project env.&lt;/p&gt;
&lt;p&gt;Many beginners go through this stage. You might run &lt;code&gt;conda activate learn&lt;/code&gt; and feel like “nothing happened”. Usually command isn’t broken; either conda wasn’t loaded in this terminal, or you’re not using Miniconda Prompt.&lt;/p&gt;
&lt;p&gt;I hit this too. Looking back, most issues came from path and environment not aligned. Use these two commands to make current state explicit:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;conda info &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;envs  # 查看所有 conda 环境，以及当前激活环境&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;where python       # 查看当前 python 命令实际指向的可执行路径&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;conda info --envs&lt;/code&gt; confirms which environment is active; &lt;code&gt;where python&lt;/code&gt; confirms which executable is actually called.&lt;/p&gt;
&lt;p&gt;If output still looks confusing, that’s normal. Just confirm two things first:&lt;br&gt;
(1) are you in &lt;code&gt;learn&lt;/code&gt; environment, and (2) does first line of &lt;code&gt;where python&lt;/code&gt; match the Python you intended.&lt;/p&gt;
&lt;h2 id=&quot;4-version-control&quot;&gt;4. Version Control&lt;/h2&gt;
&lt;h3 id=&quot;41-why-you-need-version-control&quot;&gt;4.1 Why You Need Version Control&lt;/h3&gt;
&lt;p&gt;You’ve probably seen this: desktop full of &lt;code&gt;final.py&lt;/code&gt;, &lt;code&gt;final_final.py&lt;/code&gt;, &lt;code&gt;final_final_v3.py&lt;/code&gt;, and a week later you can’t tell which one actually runs. That’s where version control matters: it records each change as a timeline, so you can review, rollback, and collaborate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is Git (one sentence)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Git is a local version control toolset that records code history and changes.&lt;/p&gt;
&lt;h3 id=&quot;42-git-installation-and-basic-setup-windows-mainline--mac-side-note&quot;&gt;4.2 Git Installation and Basic Setup (Windows Mainline + Mac Side Note)&lt;/h3&gt;
&lt;p&gt;Start at Git official site: &lt;a href=&quot;https://git-scm.com/&quot;&gt;https://git-scm.com/&lt;/a&gt;. Windows users click &lt;code&gt;Download for Windows&lt;/code&gt; (or equivalent), then run installer (filename usually like &lt;code&gt;Git-2.xx.x-64-bit.exe&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Installer has many pages. Here’s the beginner-focused pass through key options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;License&lt;/code&gt;: click &lt;code&gt;Next&lt;/code&gt;.&lt;br&gt;
This page is just licensing text.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Select Destination Location&lt;/code&gt;: default is fine.&lt;br&gt;
If changing path, prefer English path like &lt;code&gt;D:\Git&lt;/code&gt; or &lt;code&gt;C:\Program Files\Git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Select Components&lt;/code&gt;: mostly default, focus on key options.&lt;br&gt;
&lt;code&gt;Git Bash Here&lt;/code&gt; recommended; &lt;code&gt;Git GUI Here&lt;/code&gt; optional; &lt;code&gt;Git LFS&lt;/code&gt; recommended; &lt;code&gt;Associate .git* configuration files with the default text editor&lt;/code&gt; recommended; &lt;code&gt;Associate .sh files to be run with Bash&lt;/code&gt; optional; &lt;code&gt;Add a Git Bash Profile to Windows Terminal&lt;/code&gt; optional.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Start Menu Folder&lt;/code&gt;: default &lt;code&gt;Next&lt;/code&gt;.&lt;br&gt;
No need to tweak this page as a beginner.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the default editor used by Git&lt;/code&gt;:&lt;br&gt;
If VS Code is installed, choose &lt;code&gt;Use Visual Studio Code as Git&apos;s default editor&lt;/code&gt;; otherwise default is fine and can be changed later.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Adjusting the name of the initial branch in new repositories&lt;/code&gt;:&lt;br&gt;
Recommended: &lt;code&gt;Override the default branch name for new repositories&lt;/code&gt; and set to &lt;code&gt;main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Adjusting your PATH environment&lt;/code&gt;:&lt;br&gt;
Beginner recommendation: &lt;code&gt;Git from the command line and also from 3rd-party software&lt;/code&gt;, so git works in CMD/PowerShell/VS Code terminal.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the SSH executable&lt;/code&gt; and &lt;code&gt;Choosing HTTPS transport backend&lt;/code&gt;:&lt;br&gt;
Keep defaults (usually &lt;code&gt;Use bundled OpenSSH&lt;/code&gt; / &lt;code&gt;Use the OpenSSL library&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Configuring the line ending conversions&lt;/code&gt;:&lt;br&gt;
Recommended: &lt;code&gt;Checkout Windows-style, commit Unix-style line endings&lt;/code&gt;, to avoid full-file line ending diffs cross-platform.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Configuring the terminal emulator to use with Git Bash&lt;/code&gt;:&lt;br&gt;
Keep default &lt;code&gt;Use MinTTY&lt;/code&gt;; doesn’t conflict with daily use in VS Code terminal.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Choosing the default behavior of &apos;git pull&apos;&lt;/code&gt;, &lt;code&gt;credential helper&lt;/code&gt;, &lt;code&gt;extra/experimental options&lt;/code&gt;:&lt;br&gt;
Keep defaults for now (&lt;code&gt;Git Credential Manager&lt;/code&gt; should stay enabled).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After install, close all terminal windows and reopen. Then in CMD (&lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;cmd&lt;/code&gt;) run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version    # 正常会看到：git version &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;xx.x&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If it says &lt;code&gt;git&lt;/code&gt; is not a command: reopen terminal once first; if still broken, reinstall and make sure PATH page selected “from the command line and also from 3rd-party software.”&lt;/p&gt;
&lt;p&gt;Mac side note (Windows users can skip): run &lt;code&gt;git --version&lt;/code&gt; in Terminal. It usually prompts to install command line tools. Follow wizard, then reopen Terminal and verify again.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First Git basic config (&lt;code&gt;user.name&lt;/code&gt; / &lt;code&gt;user.email&lt;/code&gt;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This sets commit identity, not account password. Configure once and commit records become stable.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global user.name &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;你的名字&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          # 设置提交显示名&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global user.email &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;you@example.com&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; # 设置提交邮箱&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;git config &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;global &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;list                        # 验证配置&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see &lt;code&gt;user.name=&lt;/code&gt; and &lt;code&gt;user.email=&lt;/code&gt; lines, meaning configuration is active.&lt;/p&gt;
&lt;h3 id=&quot;43-github-registration-and-account-preparation&quot;&gt;4.3 GitHub Registration and Account Preparation&lt;/h3&gt;
&lt;p&gt;Git is local version control; GitHub is remote hosting and collaboration. One records versions locally, the other puts versions online and supports collaboration.&lt;/p&gt;
&lt;p&gt;GitHub official site: &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For beginners, GitHub’s biggest value is making learning visible. What you built and how you improved are recorded. Others can see it, and you can review it yourself. It’s also great for learning repository structure, README style, and issue-writing patterns from others.&lt;/p&gt;
&lt;h3 id=&quot;44-github-web-quickstart-interface-new-repo-first-commit&quot;&gt;4.4 GitHub Web Quickstart: Interface, New Repo, First Commit&lt;/h3&gt;
&lt;p&gt;GitHub UI is English by default, which is normal. Don’t panic. As a beginner, recognize core buttons first and everything gets easier.&lt;br&gt;
After logging into &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;, you’ll usually land on &lt;code&gt;Dashboard&lt;/code&gt; / &lt;code&gt;Home&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You’ll usually see three things first: top search box, top-right avatar and &lt;code&gt;+&lt;/code&gt; menu, and left-side repo area. UI may change slightly over time, but core entries are stable: avatar, &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;Repositories&lt;/code&gt;, &lt;code&gt;Settings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;These areas are enough to start:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Left repo area (&lt;code&gt;Top repositories&lt;/code&gt; / &lt;code&gt;Repositories&lt;/code&gt;): quick access to your repos.&lt;/li&gt;
&lt;li&gt;Center feed: just know it exists for now.&lt;/li&gt;
&lt;li&gt;Top-right &lt;code&gt;+&lt;/code&gt; menu: most used item is &lt;code&gt;New repository&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Green &lt;code&gt;New&lt;/code&gt; button on left Dashboard: also creates a repo.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In avatar menu, common entries are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Your profile&lt;/code&gt; / &lt;code&gt;Profile&lt;/code&gt;: your personal page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Your repositories&lt;/code&gt; / &lt;code&gt;Repositories&lt;/code&gt;: your repo list.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Settings&lt;/code&gt;: account settings (email/password/security, etc.).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sign out&lt;/code&gt;: sign out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For your first time, knowing these entries is enough.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-4-4-github-web.png&quot; alt=&quot;GitHub web interface example&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GitHub registration (step by step)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;GitHub is mostly English UI. I don’t recommend relying entirely on translators from day one, but if you’re truly stuck, use translation temporarily and get through the flow first. Over time, build the habit of reading English buttons and errors directly.&lt;/p&gt;
&lt;p&gt;Registration flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;, click &lt;code&gt;Sign up&lt;/code&gt; in top-right.&lt;/li&gt;
&lt;li&gt;Fill &lt;code&gt;Email address&lt;/code&gt;, &lt;code&gt;Password&lt;/code&gt;, &lt;code&gt;Username&lt;/code&gt; in order.&lt;/li&gt;
&lt;li&gt;Complete &lt;code&gt;Verify your account&lt;/code&gt; and email verification code.&lt;/li&gt;
&lt;li&gt;After completion, you’ll enter homepage and usually see your avatar or &lt;code&gt;+&lt;/code&gt; menu on top-right.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Common blockers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Username&lt;/code&gt; already taken: choose another one.&lt;/li&gt;
&lt;li&gt;Verification email not received: check spam, wait a few minutes, or switch mailbox.&lt;/li&gt;
&lt;li&gt;Slow page loading: refresh or retry later; if it happens often, see optional section below.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Mailbox suggestions for GitHub registration&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Domestic users can use QQ Mail or 163 Mail.&lt;br&gt;
If you prefer international services, Gmail/Outlook are also fine.&lt;br&gt;
There’s no hierarchy between mailbox providers. The important part is long-term stability, receiving verification codes, and your own convenience.&lt;br&gt;
Same for English UI: don’t panic. Learn common buttons first; translate temporarily only when truly stuck.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create a new repo on web (step by step)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Step 0: confirm login success.&lt;br&gt;
You should see your avatar at top-right.&lt;/p&gt;
&lt;p&gt;Step 1: enter creation page.&lt;br&gt;
Entry A: top-right &lt;code&gt;+&lt;/code&gt; -&gt; &lt;code&gt;New repository&lt;/code&gt;; Entry B: green &lt;code&gt;New&lt;/code&gt; on left Dashboard.&lt;br&gt;
You should arrive at &lt;code&gt;Create a new repository&lt;/code&gt; page.&lt;/p&gt;
&lt;p&gt;Step 2: fill &lt;code&gt;Repository name&lt;/code&gt;.&lt;br&gt;
Use English plus hyphen, e.g. &lt;code&gt;project-hello&lt;/code&gt;.&lt;br&gt;
When valid, you’ll usually get a green pass hint. If error appears, shorten name and keep to letters/numbers/hyphens.&lt;/p&gt;
&lt;p&gt;Step 3: choose &lt;code&gt;Public&lt;/code&gt; / &lt;code&gt;Private&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;Public&lt;/code&gt; is better for learning showcase; &lt;code&gt;Private&lt;/code&gt; works as private draft notebook.&lt;br&gt;
You should see your selected option highlighted.&lt;/p&gt;
&lt;p&gt;Step 4: &lt;code&gt;Add a README file&lt;/code&gt; is recommended.&lt;br&gt;
Practical reason: non-empty repo, with an immediate readable entry point.&lt;br&gt;
After checking it, the option should show enabled.&lt;/p&gt;
&lt;p&gt;Step 5: &lt;code&gt;.gitignore&lt;/code&gt; and &lt;code&gt;License&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;.gitignore&lt;/code&gt; can be skipped at first; if this is clearly a Python project, choose Python template.&lt;br&gt;
If unsure about &lt;code&gt;Choose a license&lt;/code&gt;, skip for now and add later.&lt;/p&gt;
&lt;p&gt;Step 6: click &lt;code&gt;Create repository&lt;/code&gt;.&lt;br&gt;
After creation you’ll enter repo page on &lt;code&gt;Code&lt;/code&gt; tab by default; if README was selected, you’ll see &lt;code&gt;README.md&lt;/code&gt; in file list.&lt;/p&gt;
&lt;p&gt;Common pitfalls:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Duplicate/invalid repo name: switch to a different one (letters/numbers/hyphens are safest).&lt;/li&gt;
&lt;li&gt;Email not verified: some features may be restricted; verify email first.&lt;/li&gt;
&lt;li&gt;Slow page loading: if creation/loading pages get stuck often, check optional handling section later.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;First web commit (without installing any tools)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you don’t want to install tools yet, web flow can still complete your first commit and build confidence that “I can submit changes.”&lt;/p&gt;
&lt;p&gt;Route 1: &lt;code&gt;Add file -&gt; Create new file&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open repo &lt;code&gt;Code&lt;/code&gt; page, click &lt;code&gt;Add file&lt;/code&gt; -&gt; &lt;code&gt;Create new file&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use English filename like &lt;code&gt;notes.md&lt;/code&gt; or &lt;code&gt;hello.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Write some content in editor.&lt;/li&gt;
&lt;li&gt;Scroll down to &lt;code&gt;Commit changes&lt;/code&gt;, fill &lt;code&gt;Commit message&lt;/code&gt; (for example &lt;code&gt;add notes&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Commit changes&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should see: new file appears in list, and &lt;code&gt;Commits&lt;/code&gt; count increases by one.&lt;/p&gt;
&lt;p&gt;Route 2: &lt;code&gt;Add file -&gt; Upload files&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On &lt;code&gt;Code&lt;/code&gt; page click &lt;code&gt;Add file&lt;/code&gt; -&gt; &lt;code&gt;Upload files&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Drag local &lt;code&gt;main.py&lt;/code&gt; in (or click button to choose file).&lt;/li&gt;
&lt;li&gt;Wait upload to finish, then scroll to &lt;code&gt;Commit changes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Fill &lt;code&gt;Commit message&lt;/code&gt; (e.g. &lt;code&gt;upload main.py&lt;/code&gt;) and click &lt;code&gt;Commit changes&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should see: &lt;code&gt;main.py&lt;/code&gt; appears in file list, and commit history has a new entry.&lt;/p&gt;
&lt;p&gt;Web flow is great for small edits and temporary file updates. For long-term development, local workflow + Desktop is still more stable and efficient.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to read a repo page (most-used parts on Code tab)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First time entering repo page, don’t read everything. Just walk through these areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Top tabs: &lt;code&gt;Code&lt;/code&gt; / &lt;code&gt;Issues&lt;/code&gt; / &lt;code&gt;Pull requests&lt;/code&gt; / &lt;code&gt;Actions&lt;/code&gt; / &lt;code&gt;Settings&lt;/code&gt;.&lt;br&gt;
Beginners can focus on &lt;code&gt;Code&lt;/code&gt; first; &lt;code&gt;Issues&lt;/code&gt; is for questions/bug reports; &lt;code&gt;Actions&lt;/code&gt; can wait.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Branch&lt;/code&gt; dropdown (usually &lt;code&gt;main&lt;/code&gt;): branch switch entry.&lt;/li&gt;
&lt;li&gt;Green &lt;code&gt;Code&lt;/code&gt; button: common options include &lt;code&gt;HTTPS&lt;/code&gt; / &lt;code&gt;SSH&lt;/code&gt; / &lt;code&gt;Download ZIP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Go to file&lt;/code&gt;: quick jump when repo has many files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Add file&lt;/code&gt;: create/upload entry.&lt;/li&gt;
&lt;li&gt;File list (&lt;code&gt;src/&lt;/code&gt;, &lt;code&gt;README.md&lt;/code&gt;, etc.): main project content.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;README&lt;/code&gt; renders in lower page area: first project description entry.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Commits&lt;/code&gt;: change history timeline and per-commit details.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;45-git-workflow-and-minimal-vocabulary&quot;&gt;4.5 Git Workflow and Minimal Vocabulary&lt;/h3&gt;
&lt;p&gt;Start with five words: &lt;code&gt;commit&lt;/code&gt;, &lt;code&gt;push&lt;/code&gt;, &lt;code&gt;pull&lt;/code&gt;, &lt;code&gt;branch&lt;/code&gt;, &lt;code&gt;merge&lt;/code&gt;. Daily flow is usually: change locally -&gt; &lt;code&gt;commit&lt;/code&gt; -&gt; &lt;code&gt;push&lt;/code&gt;; when syncing use &lt;code&gt;pull&lt;/code&gt;; use &lt;code&gt;branch&lt;/code&gt; for parallel work; merge with &lt;code&gt;merge&lt;/code&gt; at the end. If conflicts happen, don’t panic, inspect both sides and decide what to keep.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Git in VS Code (short version)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Source Control&lt;/code&gt; panel in VS Code can show diffs, stage files, write commit messages, and commit. Very handy for small daily edits.&lt;/p&gt;
&lt;p&gt;But for beginners, using GitHub Desktop for &lt;code&gt;push/publish&lt;/code&gt; is often more stable and more visual. Run through &lt;code&gt;commit/push/pull&lt;/code&gt; with GUI first; command line can come later.&lt;/p&gt;
&lt;h3 id=&quot;46-optional-handling-when-access-is-slow-in-mainland-china&quot;&gt;4.6 Optional Handling When Access Is Slow in Mainland China&lt;/h3&gt;
&lt;p&gt;Under domestic network conditions, GitHub may sometimes be slow in loading, login, or release downloads. Start with no-tool options first: try another time period, and prioritize sync via GitHub Desktop.&lt;/p&gt;
&lt;p&gt;If you frequently get stuck on registration verification pages, login pages, or Desktop authorization callback, then consider this optional route.&lt;/p&gt;
&lt;p&gt;If you need an optional network optimization tool, you can check &lt;strong&gt;Watt Toolkit (Steam++)&lt;/strong&gt;: &lt;a href=&quot;https://steampp.net/&quot;&gt;https://steampp.net/&lt;/a&gt;. This is only a backup option, with no effect guarantees. Tools are just tools; don’t let them distract you from learning goals.&lt;/p&gt;
&lt;h3 id=&quot;47-github-desktop-workflow-from-sign-in-authorization-to-publish&quot;&gt;4.7 GitHub Desktop Workflow: From Sign-in Authorization to Publish&lt;/h3&gt;
&lt;p&gt;GitHub Desktop download: &lt;a href=&quot;https://desktop.github.com/&quot;&gt;https://desktop.github.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Do first-time sign-in/authorization once, then everything after becomes smoother:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open GitHub Desktop.&lt;/li&gt;
&lt;li&gt;On Windows usually go &lt;code&gt;File -&gt; Options -&gt; Accounts&lt;/code&gt;; on macOS usually &lt;code&gt;GitHub Desktop -&gt; Settings -&gt; Accounts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Sign in&lt;/code&gt;, then follow browser authorization flow (you’ll usually see &lt;code&gt;Authorize GitHub Desktop&lt;/code&gt; or similar).&lt;/li&gt;
&lt;li&gt;After authorization, return to Desktop and confirm account is visible (avatar or username).&lt;/li&gt;
&lt;li&gt;If authorization page loads slowly, retry at another time first; if it still frequently blocks, see optional section above.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Expected result: &lt;code&gt;File&lt;/code&gt; menu is available, and after one commit, &lt;code&gt;Publish repository&lt;/code&gt; will appear.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-4-7-github-desktop.png&quot; alt=&quot;GitHub Desktop interface&quot;&gt;&lt;/p&gt;
&lt;p&gt;Make sure you’re already signed into GitHub in Desktop (done above).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a project folder &lt;code&gt;project-hello&lt;/code&gt; on desktop.&lt;/li&gt;
&lt;li&gt;Open it in VS Code, create &lt;code&gt;main.py&lt;/code&gt;, and write: &lt;code&gt;print(&quot;Hello from my first repo&quot;)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In GitHub Desktop:
&lt;ul&gt;
&lt;li&gt;If local folder is not a repository, use &lt;code&gt;File -&gt; New repository...&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If it already is, use &lt;code&gt;File -&gt; Add local repository...&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Fill &lt;code&gt;Summary&lt;/code&gt; in lower-left, click &lt;code&gt;Commit to main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Publish repository&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Go back to GitHub web and confirm repo is created and &lt;code&gt;main.py&lt;/code&gt; is visible.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;State checks after each step:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After repo init/add, changed files appear on left list.&lt;/li&gt;
&lt;li&gt;After commit, changes list becomes empty.&lt;/li&gt;
&lt;li&gt;After publish, web repo is accessible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you get stuck:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Commit&lt;/code&gt; button is gray: usually file not saved or no changes made.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Publish&lt;/code&gt; doesn’t appear: check if you’re logged in.&lt;/li&gt;
&lt;li&gt;Web page won’t open or loads very slowly: finish flow in Desktop first; consider optional tool above only if necessary.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Minimal Git vocabulary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;repo&lt;/code&gt; means repository, &lt;code&gt;commit&lt;/code&gt; is a snapshot, &lt;code&gt;branch&lt;/code&gt; is a parallel line, &lt;code&gt;merge&lt;/code&gt; combines branches, &lt;code&gt;push/pull&lt;/code&gt; sync with remote, and &lt;code&gt;clone&lt;/code&gt; copies remote repo to local.&lt;/p&gt;
&lt;h2 id=&quot;5-in-the-ai-era-you-might-not-need-to-write-every-line-but-you-still-need-engineering-thinking&quot;&gt;5. In the AI Era, You Might Not Need to Write Every Line, But You Still Need Engineering Thinking&lt;/h2&gt;
&lt;p&gt;AI has made coding faster. That’s true. What hasn’t changed is this: to land projects, someone still has to clarify problems and make results reliable.&lt;/p&gt;
&lt;p&gt;What I care about now isn’t how much syntax you memorized. It’s whether you can turn “looks like it works” into “stable and reproducible.” That’s where engineering ability lives.&lt;/p&gt;
&lt;p&gt;Real scenarios are often plain. You copy a code snippet and immediately get &lt;code&gt;ModuleNotFoundError&lt;/code&gt;. First check interpreter, then &lt;code&gt;where python&lt;/code&gt;, then install dependencies into the current environment. Run again, now you get &lt;code&gt;FileNotFoundError&lt;/code&gt;, then go back and check paths. Problems are peeled layer by layer, not solved by one magical answer.&lt;/p&gt;
&lt;p&gt;The one sentence I want to keep is: &lt;strong&gt;“Code you don’t understand is still debt, even if AI wrote it beautifully.”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AI can do a lot: templates, ideas, error explanations, optimization suggestions. What it cannot do is understand your requirements for you, take responsibility for mistakes, or make long-term architecture tradeoffs for you.&lt;/p&gt;
&lt;p&gt;No need to mythologize tool choices either. For beginners, Doubao and DeepSeek are fully enough to start. If you need stronger quality/context handling, then try ChatGPT, Gemini, or Claude.&lt;/p&gt;
&lt;p&gt;Using Codex-like plugins in VS Code is also practical. Completion and explanations can speed you up. It can be a copilot, but you’re still holding the steering wheel.&lt;/p&gt;
&lt;p&gt;I’ll end this part with one line: what you really need to train is turning chaos into clarity. Tools will change, methods will change, but the steering wheel stays in your hands.&lt;/p&gt;
&lt;p&gt;I hope you can build one ability worth having in this era: finding problems and thinking through solutions. When you hit a problem, your first reaction shouldn’t be giving up, but asking “how can I solve this?” Once your brain has at least a rough map, go try. If this software isn’t available, where else can I get it? Has someone met the same issue before? Did they leave a solution? Can I learn from it?&lt;/p&gt;
&lt;p&gt;People who do big things shouldn’t carry psychological burden about tools. Tools are means, not identity. If a tool helps you reach your goal, you don’t need to obsess over whether the method looks elegant enough. I really like this sentence: “&lt;em&gt;&lt;strong&gt;Real masters usually keep an apprentice heart.&lt;/strong&gt;&lt;/em&gt;” When solving engineering problems, use community resources and search engines well. The world is big enough that many problems you face have probably already been recorded somewhere.&lt;/p&gt;
&lt;h2 id=&quot;6-debugging-and-engineering-habits-optional-advanced&quot;&gt;6. Debugging and Engineering Habits (Optional Advanced)&lt;/h2&gt;
&lt;h3 id=&quot;61-error-reading-and-localization-how-to-read-traceback-and-narrow-the-problem&quot;&gt;6.1 Error Reading and Localization: How to Read Traceback and Narrow the Problem&lt;/h3&gt;
&lt;p&gt;It’s normal for beginners to fear errors. I used to get nervous seeing red text too. Later I realized errors are more like navigation: they tell you roughly where the problem is.&lt;/p&gt;
&lt;p&gt;Keep these four questions in mind:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Which Python/program am I actually running? Check &lt;code&gt;where python&lt;/code&gt;, then verify VS Code interpreter is the same environment.&lt;/li&gt;
&lt;li&gt;Which line did the error happen on? The last part of traceback usually gives filename and line number.&lt;/li&gt;
&lt;li&gt;What external dependency does this line rely on? Usually packages, file paths, permissions, or network.&lt;/li&gt;
&lt;li&gt;How do I verify after fixing? Build a minimal repro and rerun after changing one thing at a time.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;ModuleNotFoundError: No module named &apos;xxx&apos;&lt;/code&gt;&lt;br&gt;
Typical causes are missing package or package installed in wrong environment.&lt;br&gt;
Do this: confirm interpreter, install package in current environment, rerun same code.&lt;br&gt;
After fix you should see: this error disappears and execution continues.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;FileNotFoundError: ...&lt;/code&gt;&lt;br&gt;
Most commonly wrong path or wrong startup directory.&lt;br&gt;
Do this: confirm current working directory, run with absolute path first, then switch back to relative path.&lt;br&gt;
After fix you should see: file is read successfully and subsequent logic starts running.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
Most common causes are missing colon, unclosed bracket, or bad indentation.&lt;br&gt;
Do this: jump to error line and inspect previous line, fix symbols and indentation, rerun minimal code.&lt;br&gt;
After fix you should see: interpreter no longer exits immediately.&lt;/p&gt;
&lt;h3 id=&quot;62-breakpoint-debugging-use-vs-code-to-see-variables-and-flow&quot;&gt;6.2 Breakpoint Debugging: Use VS Code to See Variables and Flow&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;code&gt;.py&lt;/code&gt; file you want to run.&lt;/li&gt;
&lt;li&gt;Click left of line number to set a red breakpoint.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Run and Debug&lt;/code&gt; in sidebar, or press &lt;code&gt;F5&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;First run asks for environment; choose &lt;code&gt;Python&lt;/code&gt;. If it asks to create &lt;code&gt;launch.json&lt;/code&gt;, confirm.&lt;/li&gt;
&lt;li&gt;When program pauses at breakpoint, inspect values in &lt;code&gt;Variables&lt;/code&gt; panel.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;F10&lt;/code&gt; step over, &lt;code&gt;F11&lt;/code&gt; step into, &lt;code&gt;Shift+F11&lt;/code&gt; step out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should see: program paused at breakpoint, variables panel updating, and line-by-line execution control.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; total &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hit&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, total)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;        break&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;done&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, total)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Set breakpoint at &lt;code&gt;total += i&lt;/code&gt;, and you’ll see how &lt;code&gt;total&lt;/code&gt; changes each iteration. Debugging isn’t for show, it’s for saving time.&lt;/p&gt;
&lt;h3 id=&quot;63-engineering-habits-directory-structure-markdown-file-types-commits&quot;&gt;6.3 Engineering Habits: Directory Structure, Markdown, File Types, Commits&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-hello/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  src/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  data/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  output/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  README.md&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  .gitignore&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Put code in &lt;code&gt;src/&lt;/code&gt;, input in &lt;code&gt;data/&lt;/code&gt;, output in &lt;code&gt;output/&lt;/code&gt;, usage notes in &lt;code&gt;README.md&lt;/code&gt;, and non-tracked files in &lt;code&gt;.gitignore&lt;/code&gt;. Once structure is clear, debugging gets much easier.&lt;/p&gt;
&lt;p&gt;Try to use English paths and filenames, not for style points, but to reduce weird cross-tool compatibility issues.&lt;/p&gt;
&lt;p&gt;A minimal README can start like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# project-hello&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;项目作用：xxx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;运行方式：python src/main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;依赖：xxx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;输入在 data/，输出在 output/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can think of Markdown as “plain text + lightweight markup.” It’s not a binary format like Word, so it’s great for Git version control and easy cross-platform opening.&lt;/p&gt;
&lt;p&gt;It appears everywhere in engineering: &lt;code&gt;README&lt;/code&gt;, project docs, issue records, blogs, study notes. Once you learn the minimal syntax, you can reuse it across many places.&lt;/p&gt;
&lt;p&gt;Tool-wise, VS Code can edit it directly. A Markdown extension like &lt;code&gt;Markdown All in One&lt;/code&gt; is recommended. Preview is only a display mode; it doesn’t change your file itself.&lt;br&gt;
If you prefer WYSIWYG, Typora is also great. I use it for long writing; the flow feels smoother.&lt;/p&gt;
&lt;p&gt;For minimal syntax, these are enough to remember:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;# 一级标题&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## 二级标题&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; 列表项&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;```python&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;For links, this article prefers angle-bracket style `&amp;#x3C;https://...&gt;`: consistent, direct, and less formatting trouble after copy. (`[text](url)` also works, choose what you prefer.)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Mini README template you can copy directly:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;```markdown&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# project-hello&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;这个项目是做什么的&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## 运行方式&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;python src/main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## 输入输出&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;输入在 data/，输出在 output/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Three common pitfalls: inconsistent list indentation, unclosed triple backticks, and Chinese punctuation in code blocks. Chinese punctuation is usually fine in Markdown prose, but in code it often breaks execution.&lt;/p&gt;
&lt;p&gt;High-frequency file types are enough at first: &lt;code&gt;.py/.md/.txt&lt;/code&gt; are code/text and can be opened directly in editor; &lt;code&gt;.json/.csv/.xlsx&lt;/code&gt; are common data formats, first two are editor-readable and table files can be opened in Excel; &lt;code&gt;.yaml/.yml/.toml&lt;/code&gt; are common config formats, pay attention to indentation and keys; &lt;code&gt;.zip/.7z&lt;/code&gt; should be extracted first; &lt;code&gt;.exe/.msi&lt;/code&gt; are installers, not data files.&lt;/p&gt;
&lt;p&gt;File extension doesn’t define everything, but it’s still a useful first signal for choosing the right tool.&lt;/p&gt;
&lt;p&gt;Habit 1: small commits, one clear change per commit.&lt;br&gt;
Habit 2: commit messages in plain language, use &lt;code&gt;verb + object&lt;/code&gt; like &lt;code&gt;add notes&lt;/code&gt;, &lt;code&gt;fix path&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You’ll probably have a moment where something gets broken badly. If your commit history is clear, you won’t panic and rollback is fast. This habit looks small, but pays off when things go wrong.&lt;/p&gt;
&lt;h2 id=&quot;7-hardware-basics-understand-what-your-computer-is-doing&quot;&gt;7. Hardware Basics: Understand What Your Computer Is Doing&lt;/h2&gt;
&lt;h3 id=&quot;71-the-four-hardware-pieces-cpu-gpu-ram-storage&quot;&gt;7.1 The Four Hardware Pieces: CPU, GPU, RAM, Storage&lt;/h3&gt;
&lt;p&gt;First separate these four terms, and configuration sheets become much easier to read. CPU is like the command center, good at general-purpose computation and complex branching, so single-thread performance is often important. GPU is more like many workers doing tasks together, great at parallel workloads like graphics rendering and matrix-heavy deep learning.&lt;/p&gt;
&lt;p&gt;RAM is your “workbench,” where runtime data is kept temporarily. The bigger the bench, the more things you can spread out at once. In phone communities, ROM is often casually used to mean “storage,” but in PC context, what people call “ROM/storage” is usually persistent storage like SSD/HDD, not strict read-only ROM.&lt;/p&gt;
&lt;p&gt;One more practical layer: RAM is volatile temporary space. While programs run, variables and caches stay on this workbench. Once program exits, computer restarts, or power is cut, this data is cleared. Values you see during breakpoint debugging are also runtime state in RAM, and they disappear when process stops. That’s why reopening a program often loses half-computed intermediate results unless they were written to disk.&lt;/p&gt;
&lt;p&gt;Most common misconception in one sentence: memory (RAM) is not the same as storage (SSD/HDD). One is temporary runtime space, the other is long-term file storage.&lt;/p&gt;
&lt;p&gt;Many laptops show both iGPU and dGPU, and that’s normal. Integrated GPU (iGPU) is inside CPU: power-saving, cooler, and enough for coding/docs/daily dev. Dedicated GPU (dGPU) is separate silicon: stronger for graphics and parallel compute, suitable for gaming, 3D rendering, video export, and model training.&lt;/p&gt;
&lt;p&gt;Automatic switching is the system balancing power and performance: light tasks on iGPU, heavy tasks on dGPU. Practical note for beginners: learning programming itself doesn’t require a dGPU. But if you’re heading into deep learning, NVIDIA CUDA ecosystem is more common. You can still learn without dGPU; training is just slower.&lt;/p&gt;
&lt;h3 id=&quot;72-storage-and-interfaces-hddssd-satam2nvme&quot;&gt;7.2 Storage and Interfaces: HDD/SSD, SATA/M.2/NVMe&lt;/h3&gt;
&lt;p&gt;One sentence to remember first: both HDD and SSD are for long-term storage, not RAM. HDD is like an old warehouse: large capacity and cheaper, but slower, noisier, and more sensitive to shock. SSD is a modern warehouse: faster, quieter, and shock-resistant. Booting, package install, and opening projects all feel snappier.&lt;/p&gt;
&lt;p&gt;Beginners most commonly mix up three things: form factor, interface, and protocol. &lt;code&gt;2.5-inch SATA&lt;/code&gt; is typically cable-connected; &lt;code&gt;M.2&lt;/code&gt; is the card-like form factor; &lt;code&gt;NVMe&lt;/code&gt; is a protocol usually running on PCIe. If two drives look like M.2 but speed differs a lot, protocol differences are often the reason.&lt;/p&gt;
&lt;p&gt;Before buying/installing, check specs in three steps to avoid pitfalls:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check motherboard/laptop spec page first: confirm whether it supports &lt;code&gt;SATA&lt;/code&gt; or &lt;code&gt;M.2&lt;/code&gt; before purchasing.&lt;/li&gt;
&lt;li&gt;Check details: M.2 length (e.g. &lt;code&gt;2280&lt;/code&gt;) and slot protocol (SATA/NVMe) must match.&lt;/li&gt;
&lt;li&gt;Check resource sharing: some M.2 slots may disable SATA channels; on laptops confirm expansion support first.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;One language detail: when people say “my phone’s 256G memory is full,” they usually mean storage space is full. Just understand the meaning; no need to argue terminology.&lt;/p&gt;
&lt;h3 id=&quot;73-ram-sticks-and-frequency-ddr4ddr5-and-speed-indicators&quot;&gt;7.3 RAM Sticks and Frequency: DDR4/DDR5 and Speed Indicators&lt;/h3&gt;
&lt;p&gt;In real scenarios like “browser + VS Code + Python + spreadsheets,” 8GB can run but fills up quickly with many tabs. 16GB is the current sweet spot for learning and moderate development. 32GB gives more headroom for VMs, data processing, and video editing.&lt;/p&gt;
&lt;p&gt;For SSD, at least 512GB is usually more comfortable. Reason is practical: development environments, package caches, project files, and datasets keep growing. 256GB gets tight quickly. Don’t stare only at CPU; a strong CPU with tiny RAM still feels constrained.&lt;/p&gt;
&lt;p&gt;DDR4 and DDR5 are memory generations. They are not freely mixable; compatibility depends on motherboard and CPU platform. Check compatibility first, then parameters. “Newer generation” doesn’t mean every machine can upgrade directly.&lt;/p&gt;
&lt;p&gt;For frequency labels, vendors may use &lt;code&gt;MHz&lt;/code&gt;, &lt;code&gt;MT/s&lt;/code&gt;, or casually &lt;code&gt;Hz&lt;/code&gt;. Treat it as speed tier. Higher frequency can help, but perceived performance won’t always double because bottlenecks may be CPU, disk, or program design itself.&lt;/p&gt;
&lt;p&gt;A practical order for beginners:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compatibility first: does motherboard/CPU support DDR4 or DDR5?&lt;/li&gt;
&lt;li&gt;Capacity second: secure &lt;code&gt;16GB&lt;/code&gt; baseline, then &lt;code&gt;32GB&lt;/code&gt; if needed.&lt;/li&gt;
&lt;li&gt;Frequency last: increase one tier if budget allows; dual-channel (two matching sticks) is usually more stable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In real development, browser + VS Code + Python + spreadsheets usually hit capacity limits before extreme frequency limits, so capacity often impacts experience more.&lt;/p&gt;
&lt;h3 id=&quot;74-quick-model-reading-intel--amd--nvidia&quot;&gt;7.4 Quick Model Reading: Intel / AMD / NVIDIA&lt;/h3&gt;
&lt;p&gt;One overall rule first: naming conventions change with each year, suffixes evolve too. If you see a new suffix, check official docs instead of guessing.&lt;/p&gt;
&lt;p&gt;For Intel CPU, read three parts: series, generation, suffix. &lt;code&gt;i3/i5/i7/i9&lt;/code&gt; are broad positioning, but the same i7 across generations can differ a lot. In examples like &lt;code&gt;i5-12400&lt;/code&gt;, &lt;code&gt;i7-13700K&lt;/code&gt;, &lt;code&gt;i7-13620H&lt;/code&gt;, &lt;code&gt;i5-1340P&lt;/code&gt;, check generation first, then suffix: &lt;code&gt;K&lt;/code&gt; often means unlocked overclocking, &lt;code&gt;F&lt;/code&gt; often means no iGPU, laptop &lt;code&gt;H/HX&lt;/code&gt; usually performance-focused, &lt;code&gt;U&lt;/code&gt; low-power, &lt;code&gt;P&lt;/code&gt; in-between.&lt;/p&gt;
&lt;p&gt;AMD CPU is similar: start with &lt;code&gt;Ryzen 3/5/7/9&lt;/code&gt; positioning, then generation numbers. For models like &lt;code&gt;Ryzen 5 5600&lt;/code&gt;, &lt;code&gt;Ryzen 7 7700X&lt;/code&gt;, &lt;code&gt;Ryzen 7 7840HS&lt;/code&gt;, &lt;code&gt;Ryzen 5 7530U&lt;/code&gt;, numbers broadly represent generation and class; laptop suffixes often include &lt;code&gt;H/HS/U&lt;/code&gt;. Also know APU (stronger integrated graphics) exists; it helps with light graphics and light editing tasks.&lt;/p&gt;
&lt;p&gt;For NVIDIA GPU, the easiest mistake is this: bigger number isn’t always stronger unless you compare generation first. &lt;code&gt;GTX&lt;/code&gt; is generally older generation, &lt;code&gt;RTX&lt;/code&gt; usually includes newer feature sets. Example &lt;code&gt;RTX 3060&lt;/code&gt; vs &lt;code&gt;RTX 4060&lt;/code&gt;: identify generation first, then compare &lt;code&gt;60/70/80/90&lt;/code&gt; tiers within the same generation. &lt;code&gt;Ti/SUPER&lt;/code&gt; are usually enhanced variants in that generation. Also remember &lt;code&gt;Laptop GPU&lt;/code&gt; with same name is not equal to desktop performance. For AI, VRAM matters a lot: 8GB is entry level, 12GB is much more comfortable, and 16GB+ gives better room for larger models/images.&lt;/p&gt;
&lt;h3 id=&quot;75-self-check-and-remote-use-task-manager-device-manager-rdp-server&quot;&gt;7.5 Self-check and Remote Use: Task Manager, Device Manager, RDP, Server&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Check memory and storage first: &lt;code&gt;16GB RAM + 512GB SSD&lt;/code&gt; is a stable baseline.&lt;/li&gt;
&lt;li&gt;Then check CPU generation and class: don’t judge by &lt;code&gt;i7/i9&lt;/code&gt; label alone.&lt;/li&gt;
&lt;li&gt;Only if your tasks are AI/gaming/rendering, prioritize dGPU; NVIDIA ecosystem is often more convenient.&lt;/li&gt;
&lt;li&gt;If portability and battery matter more, iGPU laptops can absolutely handle programming study.&lt;/li&gt;
&lt;li&gt;Finally check display, ports, and weight based on your usage scenario.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Your current computer is very likely enough to start learning. No need to wait for a “perfect machine” to begin.&lt;/p&gt;
&lt;p&gt;Now that you’ve learned CPU/GPU/memory/storage concepts, next step is mapping them on your own machine. It’s not complicated. Three entry paths are enough.&lt;/p&gt;
&lt;p&gt;A) Task Manager -&gt; Performance (most common)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Method A: right-click Start menu, open Task Manager.&lt;/li&gt;
&lt;li&gt;Method B: &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;taskmgr&lt;/code&gt;, press Enter.&lt;/li&gt;
&lt;li&gt;If you only see simplified view, click “More details” first.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Performance&lt;/code&gt;, then click &lt;code&gt;CPU / Memory / Disk / GPU&lt;/code&gt; one by one.&lt;/li&gt;
&lt;li&gt;You’ll see: CPU model and base speed, total memory capacity, disk model and active time, GPU name and VRAM usage.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/programming-7-4-performance.png&quot; alt=&quot;Task Manager performance page&quot;&gt;&lt;/p&gt;
&lt;p&gt;B) Device Manager (hardware list and driver state)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Method A: &lt;code&gt;Win + X&lt;/code&gt; menu -&gt; Device Manager.&lt;/li&gt;
&lt;li&gt;Method B: &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;devmgmt.msc&lt;/code&gt;, press Enter.&lt;/li&gt;
&lt;li&gt;Expand &lt;code&gt;Display adapters / Processors / Disk drives / Network adapters&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You’ll see device name lists; yellow exclamation usually means abnormal status.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;C) Third-party tool: TUZB Toolbox (optional)&lt;/p&gt;
&lt;p&gt;If you want one-screen overview, use it as supplementary tool. Download: &lt;a href=&quot;https://www.tbtool.cn/&quot;&gt;https://www.tbtool.cn/&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Method A: open browser and visit the official URL above.&lt;/li&gt;
&lt;li&gt;Method B: &lt;code&gt;Win + R&lt;/code&gt;, directly enter &lt;code&gt;https://www.tbtool.cn/&lt;/code&gt;, press Enter.&lt;/li&gt;
&lt;li&gt;After opening, check pages like hardware overview/sensors to compare CPU, memory, disk, and GPU.&lt;/li&gt;
&lt;li&gt;If values differ slightly from Task Manager, trust system entries first and use third-party data as cross-check.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Display details vary by brand/device, but entry path is stable: check performance page first, then hardware list, then optional third-party cross-check.&lt;/p&gt;
&lt;p&gt;First skill: open it. Three methods, pick one:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Ctrl + Shift + Esc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Right-click taskbar -&gt; Task Manager.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;taskmgr&lt;/code&gt;, Enter.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Second skill: know which tabs to read:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Processes&lt;/code&gt;: sort by CPU/memory to find what’s consuming resources.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Performance&lt;/code&gt;: watch real-time CPU/memory/disk/GPU usage.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Startup&lt;/code&gt;: startup apps (name may vary slightly by Windows version).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Third skill: end frozen apps correctly:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Confirm it’s an app you recognize and it’s frozen (e.g. browser/editor).&lt;/li&gt;
&lt;li&gt;Select the process.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;End task&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You should see app window disappear and CPU/memory usage drop.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;One safety line: don’t end unknown system processes casually, like &lt;code&gt;System&lt;/code&gt;, &lt;code&gt;Service Host&lt;/code&gt;, &lt;code&gt;Windows Explorer&lt;/code&gt;. If unsure, search process name first or take a screenshot for record. A process is basically an “instance of a running program.”
If you’re not sure whether it’s a system process, don’t end it first; copy process name and search it, you can usually judge in 30 seconds.&lt;/p&gt;
&lt;p&gt;A common scene: PC suddenly becomes very laggy. Open &lt;code&gt;Processes&lt;/code&gt;, sort by CPU, find one process staying above 90%. Save your current work first, then end that process. Usually this brings the machine back to usable.&lt;/p&gt;
&lt;p&gt;Device Manager is not a “magic driver installer.” Its first value is helping you verify whether hardware state is normal.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Method A: &lt;code&gt;Win + X&lt;/code&gt; -&gt; Device Manager.&lt;/li&gt;
&lt;li&gt;Method B: &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;devmgmt.msc&lt;/code&gt;, press Enter.&lt;/li&gt;
&lt;li&gt;Focus on four categories: &lt;code&gt;Display adapters&lt;/code&gt; (GPU), &lt;code&gt;Processors&lt;/code&gt; (CPU), &lt;code&gt;Disk drives&lt;/code&gt; (storage), &lt;code&gt;Network adapters&lt;/code&gt; (network card).&lt;/li&gt;
&lt;li&gt;If you see a yellow exclamation mark: right-click device -&gt; &lt;code&gt;Properties&lt;/code&gt; -&gt; &lt;code&gt;Device status&lt;/code&gt;, read system-provided cause first.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Beginner-safe order for driver updates:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get drivers from hardware vendor or laptop OEM official site first.&lt;/li&gt;
&lt;li&gt;Avoid unknown third-party driver packages.&lt;/li&gt;
&lt;li&gt;Windows Update may provide drivers too, but not always the latest.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you see two GPUs (iGPU + dGPU), in most cases that’s normal and aligns with automatic switching logic discussed above.&lt;/p&gt;
&lt;p&gt;One-sentence definition: remote desktop means “use another computer as if it were your own,” with display/keyboard/mouse behavior similar to local operation.&lt;br&gt;
Typical use cases: connect to home/company PC for files, connect to lab machine for tasks, connect to cloud server for deployment and maintenance.&lt;/p&gt;
&lt;p&gt;Most common Windows connection steps are straightforward:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;Win + R&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;mstsc&lt;/code&gt;, press Enter to open Remote Desktop Connection.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Computer&lt;/code&gt;, enter target machine IP or hostname.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Show Options&lt;/code&gt; (optional) to fill username and avoid retyping.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Connect&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enter password and confirm certificate prompt on first connection.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should see: a new window pops up, showing the other machine’s desktop, where you can open apps/files like local.&lt;/p&gt;
&lt;p&gt;Four common pitfalls:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Target machine is off or asleep: connection fails directly.&lt;/li&gt;
&lt;li&gt;Remote Desktop not enabled on target: enable it in “Settings -&gt; System -&gt; Remote Desktop.”&lt;/li&gt;
&lt;li&gt;Network unreachable causes timeout; in public network, port forwarding/tunneling may be needed.&lt;/li&gt;
&lt;li&gt;Account permission insufficient can also deny access; not all Windows editions are suitable as remote host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Security-wise, keep it simple: don’t store passwords everywhere, and use strong passwords whenever possible.&lt;/p&gt;
&lt;p&gt;You can think of a server as a “24/7 working machine.” It prioritizes stability, continuous operation, and remote maintainability, not direct sitting-in-front interaction experience.&lt;/p&gt;
&lt;p&gt;The easiest beginner misunderstanding: servers are not mysterious. At core they are still CPU + memory + storage computers. Difference is mainly usage and operation mode. Your laptop is a personal workstation; a server is a long-running production machine.&lt;/p&gt;
&lt;p&gt;Many servers have no monitor/keyboard attached, not because they can’t, but because daily operations don’t need it. Admins typically use SSH or RDP for config, deployment, and logs.&lt;/p&gt;
&lt;p&gt;Once you connect the full flow, it’s clear: write code locally -&gt; push to GitHub -&gt; deploy to server. You’re moving a program from your dev machine to another machine that runs continuously.&lt;/p&gt;
&lt;p&gt;Desktop PC keywords are expandability, cooling, and cost efficiency. Great for fixed long-term development, multi-monitor setup, and gradual hardware upgrades.&lt;br&gt;
Laptops emphasize portability, with a balance between performance and battery life. Suitable for study, classes, and mobile work.&lt;br&gt;
Phones are mostly ARM-based and better for “using services” than as primary dev devices. They work well as auxiliary terminals via remote control/cloud services.&lt;br&gt;
Workstations target professional loads like rendering, simulation, and AI, where stability and expansion matter more. Don’t be intimidated by the name; match it to your actual tasks.&lt;br&gt;
Servers are about long uptime, remote administration, and stability. Many scenarios use Linux, often without GUI or with minimal graphical environment.&lt;/p&gt;
&lt;p&gt;A practical decision framework for beginners:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ask first: am I learning programming, or already doing heavy rendering/training tasks?&lt;/li&gt;
&lt;li&gt;For study and daily projects, prioritize usability: &lt;code&gt;16GB&lt;/code&gt; RAM + enough SSD usually matters more than chasing top-tier model names.&lt;/li&gt;
&lt;li&gt;If you need fixed desk and multi-monitor setup, lean desktop; if you move often, lean laptop.&lt;/li&gt;
&lt;li&gt;Only consider workstation/server when your task clearly requires them.&lt;/li&gt;
&lt;li&gt;In most cases, the computer you already have is enough to start building projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;If you can follow this article once from start to finish — even just once — set up your environment, run &lt;code&gt;python&lt;/code&gt; in terminal, write a loop in VS Code, create a repository on GitHub, and submit successfully, then you’ve already completed the core of “getting started.”&lt;/p&gt;
&lt;p&gt;Many people think programming entry means “memorizing syntax,” but I prefer seeing it as a practical life skill: can you break down a problem, find references, verify attempts, stay calm with errors, and finally reproduce results? You’ll find that real gap usually comes not from raw cleverness, but from whether this workflow is stable.&lt;/p&gt;
&lt;p&gt;One final line: tools are means. Using Python, VS Code, GitHub, or AI plugins is all fine. The key is not “what tool I used,” but “did I understand the problem clearly and build a working result.”&lt;/p&gt;
&lt;p&gt;To reduce your psychological burden, I want to be direct: this blog site and this article were also heavily AI-assisted. ChatGPT helped me write a lot, and it worked very well. It saved me significant time that I could spend on other things, and it improved my efficiency in a very direct way.&lt;/p&gt;</content:encoded><category>code</category><category>guide</category><category>EN</category></item><item><title>How I Turned My Tablet into a Second Monitor with Sunshine</title><link>https://danarnoux.com/blog/how-i-turned-my-tablet-into-a-second-monitor-with-sunshine-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-i-turned-my-tablet-into-a-second-monitor-with-sunshine-en/</guid><description>A practical guide and troubleshooting notes on building a tablet-as-second-monitor setup using Sunshine streaming and a virtual display driver.</description><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;preface&quot;&gt;Preface&lt;/h2&gt;
&lt;p&gt;I have been using a laptop for both work and entertainment for years. Because I move between places a lot, I never bought a dedicated external monitor. Part of it was me being picky, and part of it was the classic “if I buy one, I probably need two” dilemma.&lt;/p&gt;
&lt;p&gt;At some point, the single-screen setup just became annoying. Gaming felt cramped, coding felt cramped, everything felt cramped. I started regretting not buying a monitor earlier.&lt;/p&gt;
&lt;p&gt;I only took this seriously after trying Apple Vision Pro and learning what Sunshine could do for low-latency streaming. I still did not want to overcomplicate things, but the idea stayed in my head.&lt;/p&gt;
&lt;p&gt;My tablet is a Huawei MatePad 11, with a 2560x1600 panel, close enough to my laptop’s workflow needs. I tested 90Hz streaming at that resolution and saw around 6ms delay in the path I measured. In real use it felt smooth enough to be useful, not just “tech demo smooth.”&lt;/p&gt;
&lt;p&gt;I do not use this setup every single day, but if you want a portable second screen without adding more cables to your desk, it is a very practical option.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;what-i-want-from-a-second-screen-experience&quot;&gt;What I Want from a Second-Screen Experience&lt;/h2&gt;
&lt;p&gt;I wanted a true extended screen, not a remote-control mirror. I did not want accidental touches on the tablet to mess with my main cursor. I wanted the tablet to sit on my left side and behave like a natural extension of my desktop space.&lt;/p&gt;
&lt;p&gt;The ideal use case for me is simple: the main screen for active work, the side screen for docs, serial logs, dashboards, or reference windows. Since it is an actual extended display, dragging content across is fast and natural.&lt;/p&gt;
&lt;p&gt;I also wanted it wireless. I like being able to pick up the tablet and move around when needed. A cable works, but for this use case it quickly becomes visual and practical clutter.&lt;/p&gt;
&lt;h2 id=&quot;solution-overview&quot;&gt;Solution Overview&lt;/h2&gt;
&lt;p&gt;One-line topology:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;PC -&gt; Sunshine (encoding) -&gt; LAN -&gt; Moonlight -&gt; Tablet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        Parsec-VDD (virtual display)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Role split:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parsec-VDD: creates the second display target&lt;/li&gt;
&lt;li&gt;Sunshine: captures and encodes that display&lt;/li&gt;
&lt;li&gt;Moonlight: decodes and shows it on the tablet&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;preparation&quot;&gt;Preparation&lt;/h2&gt;
&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;A GPU that supports hardware encoding&lt;/li&gt;
&lt;li&gt;A local network (5GHz recommended)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;software-list&quot;&gt;Software List&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Sunshine&lt;/li&gt;
&lt;li&gt;Moonlight&lt;/li&gt;
&lt;li&gt;Parsec-VDD&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once your hardware is ready, the rest is mostly configuration and a bit of verification.&lt;/p&gt;
&lt;h3 id=&quot;how-to-install-and-configure-sunshine&quot;&gt;How to Install and Configure Sunshine&lt;/h3&gt;
&lt;p&gt;I use Windows for this setup, so these are Windows-first steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Sunshine from the official release.&lt;/li&gt;
&lt;li&gt;Launch Sunshine. The first-time WebUI is usually at &lt;a href=&quot;https://localhost:47990&quot;&gt;&lt;code&gt;https://localhost:47990&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create your admin account on first login.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;Settings&lt;/code&gt; / &lt;code&gt;Configuration&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;General&lt;/code&gt;, confirm the service is running and enable start-with-system if you want auto-start.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Video&lt;/code&gt; / &lt;code&gt;Encoder&lt;/code&gt;, choose your encoder backend.&lt;/li&gt;
&lt;li&gt;Keep default ports until the full chain is stable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;Applications&lt;/code&gt;, click &lt;code&gt;Add&lt;/code&gt; / &lt;code&gt;New&lt;/code&gt; / &lt;code&gt;+&lt;/code&gt;, add &lt;code&gt;Desktop&lt;/code&gt;, then save.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Useful links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/LizardByte/Sunshine&quot;&gt;Sunshine GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/LizardByte/Sunshine/releases&quot;&gt;Sunshine Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Build choice on Windows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Installer&lt;/code&gt;: best default choice. Easier service setup and easier updates.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Portable&lt;/code&gt;: useful for no-install environments, but you manage more manually.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Service mode in plain terms: Sunshine keeps running in the background as a service, so Moonlight can connect without you re-opening the UI every time.&lt;/p&gt;
&lt;p&gt;WebUI and ports:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Default WebUI is &lt;code&gt;47990&lt;/code&gt; (HTTPS).&lt;/li&gt;
&lt;li&gt;If you change ports later, update firewall rules accordingly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Encoder choice:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;NVENC&lt;/code&gt; (NVIDIA hardware video encoder)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AMF&lt;/code&gt; (AMD media framework encoder path)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;QSV&lt;/code&gt; (Intel Quick Sync Video encoder path)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After selecting encoder settings, click &lt;code&gt;Save&lt;/code&gt; / &lt;code&gt;Apply&lt;/code&gt;. Do not leave the page without saving.&lt;/p&gt;
&lt;p&gt;NVENC preset:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start with low-latency presets.&lt;/li&gt;
&lt;li&gt;Move toward higher quality only after stability is good.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Bitrate baseline I use:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;1080p60: 20-35 Mbps&lt;/li&gt;
&lt;li&gt;1440p60: 35-55 Mbps&lt;/li&gt;
&lt;li&gt;1600p90: 45-75 Mbps&lt;/li&gt;
&lt;li&gt;4K60: 60-100+ Mbps&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Practical codec pick:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;HEVC / H.265 for better compression efficiency at the same quality.&lt;/li&gt;
&lt;li&gt;H.264 when compatibility or decode stability matters more.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Audio setup (important):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Sunshine &lt;code&gt;Audio&lt;/code&gt;, set output device explicitly (avoid auto if you want predictable routing).&lt;/li&gt;
&lt;li&gt;If you want sound only on the PC, disable audio redirection.&lt;/li&gt;
&lt;li&gt;On Moonlight, go to &lt;code&gt;Settings -&gt; Audio Playback&lt;/code&gt; and disable playback there.&lt;/li&gt;
&lt;li&gt;In Windows, verify your default playback device is still the local speaker/headphone you want.&lt;/li&gt;
&lt;li&gt;Save/Apply Sunshine audio settings after each change.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This avoids the common issue where both PC and tablet play sound at the same time.&lt;/p&gt;
&lt;h3 id=&quot;how-to-install-and-configure-moonlight&quot;&gt;How to Install and Configure Moonlight&lt;/h3&gt;
&lt;p&gt;Moonlight setup is lightweight. Pairing and network correctness are the main points.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Moonlight on the tablet.&lt;/li&gt;
&lt;li&gt;Make sure tablet and PC are on the same LAN.&lt;/li&gt;
&lt;li&gt;Open Moonlight and let it auto-discover the host.&lt;/li&gt;
&lt;li&gt;If auto-discovery fails, add host manually with your PC IPv4 address.&lt;/li&gt;
&lt;li&gt;Enter the pairing PIN in Sunshine WebUI.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Manual IP steps on Windows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;Win + R&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;cmd&lt;/code&gt;, press Enter.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;ipconfig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Find the active adapter and read &lt;code&gt;IPv4 Address&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use that IPv4 address in Moonlight &lt;code&gt;Add Host&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Moonlight links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream/moonlight-qt&quot;&gt;Moonlight-qt Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream&quot;&gt;Moonlight Organization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream/moonlight-qt/releases&quot;&gt;Moonlight-qt Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First-pass stream settings:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start at 1080p, 60fps, moderate bitrate.&lt;/li&gt;
&lt;li&gt;Scale up after it is stable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Parameter behavior that matters:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Keep source/output/client resolution aligned when possible.&lt;/li&gt;
&lt;li&gt;Keep refresh rates aligned (or integer-related) to avoid uneven cadence.&lt;/li&gt;
&lt;li&gt;Watch frame pacing (frame time consistency), not just average FPS.&lt;/li&gt;
&lt;li&gt;If bandwidth is tight, reduce resolution/FPS before crushing bitrate.&lt;/li&gt;
&lt;li&gt;V-Sync on for smooth office-style use, off for lower interactive latency if needed.&lt;/li&gt;
&lt;li&gt;HDR is optional; keep SDR first until the chain is stable.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;how-to-install-and-configure-parsec-vdd&quot;&gt;How to Install and Configure Parsec-VDD&lt;/h3&gt;
&lt;p&gt;Parsec-VDD is the piece that makes Windows think a second display exists.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Parsec-VDD.&lt;/li&gt;
&lt;li&gt;Reboot the PC (important: driver enumeration is cleaner after reboot).&lt;/li&gt;
&lt;li&gt;Open Windows Display Settings and confirm a new display appears.&lt;/li&gt;
&lt;li&gt;Switch display mode to &lt;code&gt;Extend these displays&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set resolution and refresh rate on the virtual display.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Useful link:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/nomi-san/parsec-vdd&quot;&gt;Parsec-VDD Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How the virtual display appears:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After driver install + reboot, Windows display stack enumerates it as an available display output.&lt;/li&gt;
&lt;li&gt;If your VDD build has an enable toggle/tool, enable the virtual screen there first, then return to Windows Display Settings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now the important part: mapping Windows display to Sunshine display ID.&lt;/p&gt;
&lt;p&gt;Windows numbers (&lt;code&gt;1/2/3&lt;/code&gt;) are logical labels. Sunshine often lists outputs by its own enumeration order (for example &lt;code&gt;Display 0/1/2&lt;/code&gt; or &lt;code&gt;\\.\\DISPLAY1/2&lt;/code&gt;). They are often related, but not guaranteed to match one-to-one.&lt;/p&gt;
&lt;p&gt;Reliable mapping workflow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Windows, make the virtual display easy to recognize:
&lt;ul&gt;
&lt;li&gt;set a unique resolution (for example 1280x720), or&lt;/li&gt;
&lt;li&gt;switch it to portrait, or&lt;/li&gt;
&lt;li&gt;drag it to the far left in display arrangement.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In Sunshine WebUI, go to &lt;code&gt;Settings/Configuration -&gt; Video/Display/Capture&lt;/code&gt; (wording may vary by version).&lt;/li&gt;
&lt;li&gt;Find the target selector (&lt;code&gt;Display&lt;/code&gt; / &lt;code&gt;Monitor&lt;/code&gt; / &lt;code&gt;Output&lt;/code&gt;) and pick one display ID.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Save&lt;/code&gt; / &lt;code&gt;Apply&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Connect from Moonlight and verify what you see.&lt;/li&gt;
&lt;li&gt;If it is the wrong screen, switch to the next display ID in Sunshine, save again, reconnect, and verify again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This takes a minute once, then stays stable.&lt;/p&gt;
&lt;p&gt;Known recovery trick when extend mode does not react:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Windows Display Settings, switch to &lt;code&gt;Show only on 2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click Apply.&lt;/li&gt;
&lt;li&gt;Switch back to &lt;code&gt;Extend these displays&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This often refreshes display state and brings the virtual output back into a usable state.&lt;/p&gt;
&lt;p&gt;If still broken, check:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You rebooted after VDD install.&lt;/li&gt;
&lt;li&gt;Virtual display is not disabled.&lt;/li&gt;
&lt;li&gt;Advanced display settings show valid refresh modes.&lt;/li&gt;
&lt;li&gt;Manually disable/re-enable the virtual screen once.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;performance-tuning-notes&quot;&gt;Performance Tuning Notes&lt;/h3&gt;
&lt;p&gt;The goal is stable low latency, not maximum numbers on paper.&lt;/p&gt;
&lt;p&gt;Tuning order I use:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Network first
&lt;ul&gt;
&lt;li&gt;PC on Ethernet if possible.&lt;/li&gt;
&lt;li&gt;Tablet on 5GHz/6GHz Wi-Fi.&lt;/li&gt;
&lt;li&gt;Avoid heavy transfers on the same LAN while streaming.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Stream parameters second
&lt;ul&gt;
&lt;li&gt;Lock stable 60fps first, then push 90/120.&lt;/li&gt;
&lt;li&gt;Raise bitrate gradually.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Encoding path third
&lt;ul&gt;
&lt;li&gt;Prefer hardware encoding.&lt;/li&gt;
&lt;li&gt;Avoid software encoding (CPU path) for this use case.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;System power and load
&lt;ul&gt;
&lt;li&gt;Keep laptop plugged in.&lt;/li&gt;
&lt;li&gt;Use high-performance power mode.&lt;/li&gt;
&lt;li&gt;Close heavy background workloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Bandwidth reality:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Codec bitrate is baseline demand, not total overhead-inclusive traffic.&lt;/li&gt;
&lt;li&gt;Keep practical throughput headroom (around 25%-40%).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Latency usually accumulates from:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Encode queue&lt;/li&gt;
&lt;li&gt;Wireless contention&lt;/li&gt;
&lt;li&gt;Router queueing/forwarding&lt;/li&gt;
&lt;li&gt;Decode + display sync&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Wi-Fi 5 vs Wi-Fi 6 in this use case:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wi-Fi 5 can be enough.&lt;/li&gt;
&lt;li&gt;Wi-Fi 6 tends to reduce jitter under multi-device load.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Monitor GPU correctly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Watch &lt;code&gt;Video Encode&lt;/code&gt; engine utilization, not only 3D usage.&lt;/li&gt;
&lt;li&gt;If encode is saturated, lower resolution/FPS/bitrate before anything else.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;technical-notes-optional-read&quot;&gt;Technical Notes (Optional Read)&lt;/h2&gt;
&lt;h3 id=&quot;why-this-feels-lower-latency&quot;&gt;Why This Feels Lower-Latency&lt;/h3&gt;
&lt;p&gt;The path is designed for real-time frame delivery.&lt;/p&gt;
&lt;p&gt;High-level flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;App renders frame.&lt;/li&gt;
&lt;li&gt;Compositor outputs to target display surface.&lt;/li&gt;
&lt;li&gt;Sunshine captures that frame buffer.&lt;/li&gt;
&lt;li&gt;Hardware encoder (NVENC/AMF/QSV) compresses the frame.&lt;/li&gt;
&lt;li&gt;Stream crosses LAN.&lt;/li&gt;
&lt;li&gt;Moonlight decodes and presents.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Latency behavior comes from each queue in that path.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lower-latency encoder presets reduce internal buffering and lookahead.&lt;/li&gt;
&lt;li&gt;Network jitter is handled by a jitter buffer on the client side.&lt;/li&gt;
&lt;li&gt;Bigger jitter buffer improves stability but adds delay.&lt;/li&gt;
&lt;li&gt;Smaller jitter buffer cuts delay but can increase visible hiccups.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Why traditional remote desktop paths often feel slower in this context:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They are generally optimized for desktop readability, reliability, and compatibility.&lt;/li&gt;
&lt;li&gt;Their buffering/retransmission behavior is usually more conservative.&lt;/li&gt;
&lt;li&gt;That helps office remoting quality, but it is not tuned for minimum interactive frame latency.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;wrap-up&quot;&gt;Wrap-up&lt;/h3&gt;
&lt;p&gt;For me, this setup is not a gimmick. It is a practical second screen that I can carry around.&lt;/p&gt;
&lt;p&gt;The upside is clear: wireless workflow, low-latency feel, and enough control to tune for your own network and hardware.&lt;/p&gt;
&lt;p&gt;It works especially well if you move between places and do not want to buy duplicate monitor setups.&lt;/p&gt;
&lt;p&gt;The main thing to remember is that stability comes from process: get the virtual display right, map display ID correctly, then tune bitrate/FPS step by step.&lt;/p&gt;
&lt;p&gt;Once configured properly, daily use is mostly just connect and go.&lt;/p&gt;</content:encoded><category>sunshine</category><category>tools</category><category>guide</category><category>screen-streaming</category><category>virtual-display</category><category>EN</category></item><item><title>我用 Sunshine 把平板改造成电脑副屏：一套稳定可用的方案</title><link>https://danarnoux.com/blog/how-i-turned-my-tablet-into-a-second-monitor-with-sunshine-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-i-turned-my-tablet-into-a-second-monitor-with-sunshine-cn/</guid><description>一套基于 Sunshine 串流与虚拟显示器驱动的副屏搭建方案与踩坑记录。</description><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;我一直用着一个笔记本电脑，负责我的工作和娱乐需求。但由于我经常有多地周转的原因，我到现在也没给我的笔记本电脑配一个显示器，说实话是我有点太挑了，而且我一想要买两个家里和宿舍都要有一个就干脆不买先了，这样一纠结就以至于我大学快毕业了还没买。&lt;/p&gt;
&lt;p&gt;说实在的实在忍受不了我的电脑屏幕不够大，打游戏又不够爽，写代码这块屏幕上能放的窗口又有限。反正我是有点后悔我当初没下定决心整个显示器的，贵点就贵点吧，我就算再挑剔也能爽爽几年。&lt;/p&gt;
&lt;p&gt;后来直到我玩上了Apple vision Pro的时候，我才知道有sunshine这种东西，可以将电脑上的游戏画面串流上去。但是我还是不想折腾，他的好处我倒是记住了，于是我最近折腾了一下，为我的电脑用，至于avp？吃灰吧他。&lt;/p&gt;
&lt;p&gt;我的平板是华为matepad 11，分辨率是2560*1600，和我的电脑屏幕一样。我试过以该画质 90hz串流，注意到延迟为6ms，体感上也不卡，所以我觉得这套方案是还不错的。&lt;/p&gt;
&lt;p&gt;尽管我本人也不是最近天天用这套方案，但是如果你想要拓展出一块副屏，倒是可以考虑一下。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;我想要什么样的副屏体验&quot;&gt;我想要什么样的副屏体验&lt;/h2&gt;
&lt;p&gt;首先我是要一块拓展的副屏，而不是一块远程控制的屏幕，我不希望平板被误触什么的导致我的鼠标动了，我希望平板放在我的左边，很自然成为我屏幕的衍生。我可以在这边拖放一些串口什么的。这样我可以在主屏幕工作的时候不急着调出来。&lt;/p&gt;
&lt;p&gt;其实最好的是那种，主屏幕负责操作，副屏给我放着教程。因为是副屏，所以我可以鼠标拖过去很方便的就可以复制了。我不希望有线，因为我希望我的平板自由点，有时候我需要带着他去别的地方玩金铲铲之战，例如床上。多一根线我感觉也蛮丑的。&lt;/p&gt;
&lt;h2 id=&quot;整体方案概览&quot;&gt;整体方案概览&lt;/h2&gt;
&lt;p&gt;用一张逻辑说明&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;电脑 → Sunshine（编码） → 局域网 → Moonlight → 平板&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;               ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        Parsec-VDD（虚拟显示器）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一句话说明三者分工：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parsec-VDD：创造“第二块屏”&lt;/li&gt;
&lt;li&gt;Sunshine：把这块屏编码推送&lt;/li&gt;
&lt;li&gt;Moonlight：在平板上显示&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;准备工作&quot;&gt;准备工作&lt;/h2&gt;
&lt;h3 id=&quot;设备要求&quot;&gt;设备要求&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;支持硬件编码（用显卡或核显专用编码单元做视频压缩）的 GPU&lt;/li&gt;
&lt;li&gt;局域网（建议 5GHz，频段更高、同环境下通常干扰更少）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;软件列表&quot;&gt;软件列表&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Sunshine&lt;/li&gt;
&lt;li&gt;Moonlight&lt;/li&gt;
&lt;li&gt;Parsec-VDD&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;那么，在确定你的设备符合标准，接下来我们来讲解一下，如何安装配置这些软件&lt;/p&gt;
&lt;h3 id=&quot;如何安装配置sunshine&quot;&gt;如何安装配置Sunshine&lt;/h3&gt;
&lt;p&gt;我这边按 Windows 来写，先给一套能快速跑通的步骤。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;下载并安装 Sunshine（建议用官方发布版）。&lt;/li&gt;
&lt;li&gt;安装后启动 Sunshine，第一次会提示本地管理页，通常是：&lt;a href=&quot;https://localhost:47990&quot;&gt;&lt;code&gt;https://localhost:47990&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;首次进入先创建管理员账号和密码。&lt;/li&gt;
&lt;li&gt;进入设置后先做三件事：
&lt;ul&gt;
&lt;li&gt;确认服务已运行（可按需开机自启）。&lt;/li&gt;
&lt;li&gt;选择对应显卡的硬件编码器（NVIDIA/AMD/Intel）。&lt;/li&gt;
&lt;li&gt;端口先保持默认，先跑通再调，避免排错复杂化。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;在 Applications 里添加一个 &lt;code&gt;Desktop&lt;/code&gt; 项，方便后续直接串流桌面。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;把这几步点实一点，第一次配置会省很多时间：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;建完 WebUI 账号后，进 &lt;code&gt;Settings&lt;/code&gt; / &lt;code&gt;Configuration&lt;/code&gt;，在 &lt;code&gt;General&lt;/code&gt; 里确认服务状态是 &lt;code&gt;Running&lt;/code&gt;，并把 &lt;code&gt;Start with system&lt;/code&gt;（或同类开机启动选项）打开。&lt;/li&gt;
&lt;li&gt;进 &lt;code&gt;Video&lt;/code&gt; / &lt;code&gt;Encoder&lt;/code&gt;，按显卡选 &lt;code&gt;NVENC&lt;/code&gt; / &lt;code&gt;AMF&lt;/code&gt; / &lt;code&gt;QSV&lt;/code&gt;，选完点击页面底部 &lt;code&gt;Save&lt;/code&gt; 或 &lt;code&gt;Apply&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;进 &lt;code&gt;Applications&lt;/code&gt;，点击 &lt;code&gt;Add&lt;/code&gt; / &lt;code&gt;New&lt;/code&gt; / &lt;code&gt;+&lt;/code&gt;，添加 &lt;code&gt;Desktop&lt;/code&gt;（不同版本可能叫 Desktop/Command），保存后确认它出现在应用列表里。&lt;/li&gt;
&lt;li&gt;音频改完后同样要点 &lt;code&gt;Save&lt;/code&gt; / &lt;code&gt;Apply&lt;/code&gt;，不保存切页会丢配置。&lt;/li&gt;
&lt;li&gt;Moonlight 端关闭声音的位置通常在 &lt;code&gt;Settings -&gt; Audio Playback&lt;/code&gt;，关掉后再重连一次让配置生效。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;建议先做一次基础验证：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sunshine 状态是运行中。&lt;/li&gt;
&lt;li&gt;Windows 防火墙已允许 Sunshine。&lt;/li&gt;
&lt;li&gt;局域网内设备可以发现这台主机。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这一步的目标不是“拉满参数”，而是先把连接稳定建立起来。&lt;/p&gt;
&lt;p&gt;下面是我自己长期用下来的进阶安装和参数习惯。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/LizardByte/Sunshine&quot;&gt;Sunshine 官方仓库&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/LizardByte/Sunshine/releases&quot;&gt;Sunshine 官方 Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Windows 版本怎么选：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Installer&lt;/code&gt;：推荐大多数人用，自动注册服务、自动写必要依赖，后续升级也省心。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Portable&lt;/code&gt;：适合你想放在移动硬盘或无安装权限环境，但服务和路径都要自己管。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;首次启动的“服务模式”怎么理解：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sunshine 作为后台服务运行后，即使你没打开主界面，它也能响应 Moonlight 连接。&lt;/li&gt;
&lt;li&gt;这对副屏场景很关键，因为你不想每次手动开一堆窗口。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;WebUI 端口解释（默认）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;47990&lt;/code&gt;：管理页面（HTTPS）。&lt;/li&gt;
&lt;li&gt;你改端口可以，但建议先默认跑通，再改；改完记得同步放行防火墙。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;防火墙和端口我自己的做法：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;首先放行 Sunshine 程序本身（入站/专用网络）。&lt;/li&gt;
&lt;li&gt;如果你是手动端口策略，保证 Sunshine 使用端口不被拦截。&lt;/li&gt;
&lt;li&gt;跑不通时先回到“同网段 + 默认端口 + 程序放行”这个最小可行组合。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;音频这块如果不提前配好，很容易出现“电脑和平板同时出声”或者“声音跑到平板去了”的情况。我自己的做法是先固定音频策略：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在 Sunshine 设置里找到 &lt;code&gt;Audio&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;输出设备优先手动指定为你电脑正在用的默认扬声器/耳机，不要放自动。&lt;/li&gt;
&lt;li&gt;如果你只想声音留在电脑本机，优先关闭音频重定向（不同版本文案可能是 &lt;code&gt;Do not redirect audio&lt;/code&gt; 或类似选项）。&lt;/li&gt;
&lt;li&gt;在 Moonlight 客户端里把 &lt;code&gt;Audio Playback&lt;/code&gt; 关闭，避免平板端也播放声音。&lt;/li&gt;
&lt;li&gt;Windows 里再确认一次“默认播放设备”就是你主机本地设备，避免应用切设备后串流端跟着跑偏。&lt;/li&gt;
&lt;li&gt;虚拟音频设备不是必须项，除非你有录制、混音或多路音频路由需求；普通副屏场景不用额外上虚拟声卡。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我一般按这个顺序排错：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先关 Moonlight 音频播放。&lt;/li&gt;
&lt;li&gt;再看 Sunshine 是否指定到正确输出设备。&lt;/li&gt;
&lt;li&gt;最后在 Windows 声音设置里确认默认设备没有被改。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;编码器指定建议（按显卡）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;NVIDIA：优先 &lt;code&gt;NVENC&lt;/code&gt;（NVIDIA 显卡自带的视频硬件编码单元）&lt;/li&gt;
&lt;li&gt;AMD：优先 &lt;code&gt;AMF&lt;/code&gt;（AMD 显卡的视频编码接口）&lt;/li&gt;
&lt;li&gt;Intel：优先 &lt;code&gt;QSV&lt;/code&gt;（Intel 核显/独显的视频硬件编码路径）&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;NVENC preset 我建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先选低延迟档（Low Latency / P1-P3 这类偏低延迟预设）。&lt;/li&gt;
&lt;li&gt;画质不够再一点点往高质量预设调，不要一上来就高画质高缓存。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;码率估算我一般用这个粗算方法：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;1080p60：&lt;code&gt;20-35 Mbps&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;1440p60：&lt;code&gt;35-55 Mbps&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;1600p90（你这种平板常见）：&lt;code&gt;45-75 Mbps&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;4K60：&lt;code&gt;60-100+ Mbps&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;一个简单经验公式（仅做起点）：
&lt;code&gt;参考码率(Mbps) ≈ 分辨率像素数 × 帧率 ÷ 5,000,000&lt;/code&gt;&lt;br&gt;
然后根据画面复杂度上下浮动 20%-40%。&lt;/p&gt;
&lt;p&gt;HEVC vs H.264 怎么选：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;优先 HEVC（H.265，压缩效率更高的编码标准）：同画质下码率更低，Wi-Fi 压力小。&lt;/li&gt;
&lt;li&gt;兼容或延迟异常时切 H.264（更普及、设备兼容性更高的编码标准）：解码压力更低，老设备更稳。&lt;/li&gt;
&lt;li&gt;原则是“先稳定，再压榨画质”。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;如何安装配置moonlight&quot;&gt;如何安装配置Moonlight&lt;/h3&gt;
&lt;p&gt;Moonlight 端配置很轻量，重点是配对和参数起步。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在平板安装 Moonlight（Android/iPadOS 都有版本）。&lt;/li&gt;
&lt;li&gt;确保平板和电脑在同一局域网（建议 5GHz）。&lt;/li&gt;
&lt;li&gt;打开 Moonlight，等待自动扫描主机；若未扫描到，手动输入电脑 IP。&lt;/li&gt;
&lt;li&gt;点击主机后会显示配对码。&lt;/li&gt;
&lt;li&gt;回到 Sunshine 管理页输入配对码，完成绑定。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;手动输入主机 IP 我自己就按这一套：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在 Windows 按 &lt;code&gt;Win + R&lt;/code&gt;，输入 &lt;code&gt;cmd&lt;/code&gt; 回车。&lt;/li&gt;
&lt;li&gt;在命令行输入 &lt;code&gt;ipconfig&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;找你当前正在用的网卡（Wi-Fi 或 以太网），记录 &lt;code&gt;IPv4 地址&lt;/code&gt;（例如 &lt;code&gt;192.168.1.23&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;在 Moonlight 里点 &lt;code&gt;Add Host&lt;/code&gt;（或手动添加主机），填这个 IPv4 地址。&lt;/li&gt;
&lt;li&gt;确保平板和电脑在同一局域网，否则能填上也连不上。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;第一次串流建议参数：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;分辨率先用 1920x1080。&lt;/li&gt;
&lt;li&gt;帧率先 60fps。&lt;/li&gt;
&lt;li&gt;码率先中档（例如 20-30 Mbps）。&lt;/li&gt;
&lt;li&gt;链路稳定后，再逐步提高分辨率和刷新率。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;常见问题处理顺序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;黑屏或闪退：先降分辨率和帧率，再检查 Sunshine 编码器。&lt;/li&gt;
&lt;li&gt;卡顿：先降码率看是否立刻改善。&lt;/li&gt;
&lt;li&gt;连不上：先确认同网段，再看防火墙放行。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Moonlight 这边我平时会额外盯一组参数，能连上和用得稳是两回事。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream/moonlight-qt&quot;&gt;Moonlight 官方客户端仓库（桌面）&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream&quot;&gt;Moonlight 官方组织页（各平台客户端）&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/moonlight-stream/moonlight-qt/releases&quot;&gt;Moonlight-qt Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;分辨率匹配策略：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;最稳做法是：虚拟屏分辨率 = Sunshine 输出分辨率 = Moonlight 接收分辨率。&lt;/li&gt;
&lt;li&gt;三端不一致会触发额外缩放，直接增加延迟和模糊感。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;刷新率同步问题：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;主机输出 90Hz，但客户端锁 60Hz，会出现节奏不均匀（体感像轻微顿挫）。&lt;/li&gt;
&lt;li&gt;最好让源端和收端刷新率成整数关系或一致（60/60、90/90、120/120）。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Frame pacing（帧节奏，指每一帧输出时间间隔是否均匀）建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;优先稳定帧间隔，而不是追求瞬时高帧。&lt;/li&gt;
&lt;li&gt;如果你看到“平均帧率高但体感抖”，通常是 pacing 问题，不只是码率问题。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Bitrate 控制逻辑：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先给足最低稳定码率，避免编码器频繁大幅压缩。&lt;/li&gt;
&lt;li&gt;网络余量不够时，先降分辨率或帧率，再降码率，画面会更可控。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;V-Sync 建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;副屏办公/浏览为主：可开，画面更平顺。&lt;/li&gt;
&lt;li&gt;极限低延迟交互：可关，减少等待垂直同步带来的附加延迟。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;HDR 建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;默认不建议一上来开启。&lt;/li&gt;
&lt;li&gt;HDR 会引入额外色彩链路与带宽压力，先 SDR 跑稳，再评估是否值得开。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;如何安装配置parsec-vdd&quot;&gt;如何安装配置Parsec-VDD&lt;/h3&gt;
&lt;p&gt;Parsec-VDD 的作用是给系统“虚拟出一块显示器”，这是副屏模式的关键。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;下载并安装 Parsec-VDD 驱动。&lt;/li&gt;
&lt;li&gt;安装完成后重启电脑（不重启经常不生效）。&lt;/li&gt;
&lt;li&gt;打开 Windows 显示设置，确认出现新的显示器编号。&lt;/li&gt;
&lt;li&gt;显示模式选择“扩展这些显示器”，不要镜像。&lt;/li&gt;
&lt;li&gt;给虚拟屏设置分辨率和刷新率（先 1080p/60，再逐步拉高）。&lt;/li&gt;
&lt;li&gt;打开 Sunshine WebUI，进入 Display / Video / Capture 相关设置，选择要推送的目标显示器。&lt;/li&gt;
&lt;li&gt;在 Moonlight 发起连接，确认平板端画面是否来自你刚才设置的那块虚拟屏。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Sunshine 里“显示器 ID”建议按这个路径操作：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 Sunshine WebUI。&lt;/li&gt;
&lt;li&gt;进入 &lt;code&gt;Settings/Configuration -&gt; Video/Display/Capture&lt;/code&gt;（具体名称按版本文案，找 Display/Monitor/Output 相关项）。&lt;/li&gt;
&lt;li&gt;在目标显示器下拉框里选择一个显示输出（常见是 &lt;code&gt;Display 0/1/2&lt;/code&gt; 或 &lt;code&gt;\\.\DISPLAY1/\\.\DISPLAY2&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;选完点击 &lt;code&gt;Save&lt;/code&gt; / &lt;code&gt;Apply&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;回 Moonlight 连接验证画面；如果不是虚拟屏，就回 Sunshine 切换到下一个 ID，再保存再验证。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;建议的稳定顺序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先确认虚拟屏能正常显示桌面。&lt;/li&gt;
&lt;li&gt;再让 Sunshine 推送这块虚拟屏。&lt;/li&gt;
&lt;li&gt;最后在 Moonlight 对齐分辨率和帧率参数。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;实用细节：把虚拟屏在系统中的位置放到主屏左侧或右侧，和你平板真实摆放一致，鼠标跨屏会更自然。&lt;/p&gt;
&lt;p&gt;关于“显示器 ID”这件事，我自己踩过的结论是：Windows 里的 1/2/3 和 Sunshine 列表里的索引不一定一一对应。Windows 这个编号更偏逻辑位置，Sunshine 通常按当前枚举到的显示输出顺序列出。&lt;/p&gt;
&lt;p&gt;所以我一般不硬猜编号，直接做一个 30 秒确认流程：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先在 Windows 里把虚拟屏拖到一个很明显的位置（比如主屏最左侧）。&lt;/li&gt;
&lt;li&gt;在 Sunshine 里先选一个显示器 ID 推送。&lt;/li&gt;
&lt;li&gt;平板端看画面是不是那块虚拟屏（窗口、壁纸、鼠标跨屏方向都能很快判断）。&lt;/li&gt;
&lt;li&gt;如果推错屏，回 Sunshine 切换到下一个显示器 ID，再验证一次。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我还会再加一个识别标记：在 Windows 先把虚拟屏临时改成一个很容易辨认的参数（例如 &lt;code&gt;1280x720&lt;/code&gt; 或竖屏方向），这样 Moonlight 一连上就能立刻看出来是不是选对了那块屏。&lt;/p&gt;
&lt;p&gt;为了更快定位，我会临时切到“仅在 2 上显示”，应用后再切回“扩展这些显示器”；很多时候这一来一回能把显示状态直接刷出来。确认完 ID 后再按正常扩展模式使用，后面就不用反复猜。&lt;/p&gt;
&lt;p&gt;这块原理了解一下，后面排错会快很多。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/nomi-san/parsec-vdd&quot;&gt;Parsec-VDD 官方仓库&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;虚拟显示器驱动工作原理（简化版）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;驱动向 Windows 显示子系统注册一个“可用显示输出”。&lt;/li&gt;
&lt;li&gt;系统拿到这个显示设备后，就能给它分配桌面空间和渲染目标。&lt;/li&gt;
&lt;li&gt;Sunshine 再去抓取这个渲染目标并编码推流。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;为什么安装后通常必须重启：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;显示类驱动加载和设备枚举通常在系统启动阶段完成。&lt;/li&gt;
&lt;li&gt;不重启时，驱动文件在，但设备树里可能还没完成重建。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Windows 为什么会把它当“像物理屏”：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;关键是驱动提供了显示设备描述信息（含模式能力）。&lt;/li&gt;
&lt;li&gt;系统关心的是“有没有合法显示输出接口”，不关心它是不是一根真线插着。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;EDID 模拟的意义：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;EDID（显示设备能力描述数据）相当于显示器“自我介绍”：支持哪些分辨率、刷新率、色彩能力。&lt;/li&gt;
&lt;li&gt;虚拟驱动通过模拟 EDID，让系统相信这块屏支持你配置的模式。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;90Hz/120Hz 设置方法（常用路径）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先在 Windows 显示设置里选中虚拟屏，进入高级显示设置。&lt;/li&gt;
&lt;li&gt;在刷新率列表里选择 90Hz/120Hz（前提是驱动声明支持该模式）。&lt;/li&gt;
&lt;li&gt;如果列表没有高刷，先确认驱动版本、重启状态、以及该分辨率下是否声明高刷。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我自己踩过一个很典型的坑：驱动装好了，但扩展显示就是没反应。这个时候别急着重装，先按下面顺序试：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在 Windows 显示设置里先切到“仅在 2 上显示”。&lt;/li&gt;
&lt;li&gt;点击应用后，再切回“扩展这些显示器”。&lt;/li&gt;
&lt;li&gt;如果还是没反应，再逐项确认：
&lt;ul&gt;
&lt;li&gt;机器是否已经重启过；&lt;/li&gt;
&lt;li&gt;虚拟屏是否被系统禁用；&lt;/li&gt;
&lt;li&gt;高级显示设置里是否能识别到刷新率条目。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;还有一种情况是虚拟屏状态卡住，这时手动断开再重新启用虚拟屏通常能恢复。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;性能优化建议&quot;&gt;性能优化建议&lt;/h3&gt;
&lt;p&gt;这套方案的核心是“稳定低延迟”，不是盲目拉满画质。&lt;/p&gt;
&lt;p&gt;建议按下面优先级调：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;网络优先：
&lt;ul&gt;
&lt;li&gt;电脑尽量有线连路由器。&lt;/li&gt;
&lt;li&gt;平板走 5GHz/6GHz Wi-Fi，尽量避免 2.4GHz（低频段覆盖广但拥挤时更容易干扰）。&lt;/li&gt;
&lt;li&gt;串流时减少同网段大流量下载。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;参数优先：
&lt;ul&gt;
&lt;li&gt;先稳定 60fps，再尝试 90/120fps。&lt;/li&gt;
&lt;li&gt;先中码率，再逐步上调。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;编码优先：
&lt;ul&gt;
&lt;li&gt;优先硬件编码（NVENC/AMF/QuickSync）。&lt;/li&gt;
&lt;li&gt;避免软件编码（由 CPU 通用计算完成编码），CPU 抖动会更明显。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;系统优先：
&lt;ul&gt;
&lt;li&gt;笔记本插电并切高性能模式。&lt;/li&gt;
&lt;li&gt;关闭高占用后台任务。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;一个实用排错流程：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先把分辨率、帧率、码率各降一档。&lt;/li&gt;
&lt;li&gt;看是否立即稳定。&lt;/li&gt;
&lt;li&gt;若有效，再逐项回调，找到设备上限。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这个流程比一次性拉满再盲调更省时间。&lt;/p&gt;
&lt;p&gt;下面这套工程化观察指标是我日常排错时最常用的。&lt;/p&gt;
&lt;p&gt;带宽与码率关系（实操版）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;编码码率是“最低网络需求”，不是“总网络占用上限”。&lt;/li&gt;
&lt;li&gt;真实链路要留 25%-40% 余量给协议开销和波动。&lt;/li&gt;
&lt;li&gt;例如你计划 50 Mbps 码率，实际最好有至少 70 Mbps 的稳定可用吞吐。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;局域网延迟主要来自四段：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;编码等待（GPU 编码队列）&lt;/li&gt;
&lt;li&gt;无线介质争用（Wi-Fi 空口竞争）&lt;/li&gt;
&lt;li&gt;路由转发/排队&lt;/li&gt;
&lt;li&gt;解码与显示同步&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Wi-Fi 5 vs Wi-Fi 6（两代无线协议标准）体感差异（副屏场景）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Wi-Fi 5 在单设备下也够用，但高并发时抖动更明显。&lt;/li&gt;
&lt;li&gt;Wi-Fi 6 的调度机制更好，多个设备同时在线时延迟波动通常更小。&lt;/li&gt;
&lt;li&gt;你如果追求稳定高刷，Wi-Fi 6 往往更容易“稳住下限”。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;笔记本插电的重要性：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;不插电时很多机型会限制 CPU/GPU 功耗墙。&lt;/li&gt;
&lt;li&gt;编码器频率一旦被压，延迟和帧时间稳定性都会掉。&lt;/li&gt;
&lt;li&gt;所以调性能前先插电，这个收益通常比你调半天参数还大。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;GPU 占用监控建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;重点看 &lt;code&gt;Video Encode&lt;/code&gt; 引擎占用（GPU 里专门负责视频编码的硬件模块），不只是 3D 占用。&lt;/li&gt;
&lt;li&gt;如果编码占用长期顶满，先降分辨率/帧率/码率。&lt;/li&gt;
&lt;li&gt;同时看显存和温度，热降频会直接体现在“偶发卡顿”上。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;技术原理可选阅读&quot;&gt;技术原理（可选阅读）&lt;/h2&gt;
&lt;h3 id=&quot;为什么这种方式延迟更低&quot;&gt;为什么这种方式延迟更低？&lt;/h3&gt;
&lt;p&gt;核心原因是：这条链路本身就是为“实时画面传输”设计的。&lt;/p&gt;
&lt;p&gt;实际体验里，主要是下面这几段在决定延迟上限：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sunshine 走低延迟串流路径，编码缓冲更小。&lt;/li&gt;
&lt;li&gt;编码与解码都可走硬件加速，单帧处理时间更短。&lt;/li&gt;
&lt;li&gt;Moonlight 客户端对实时显示做了优化，输入到显示路径更短。&lt;/li&gt;
&lt;li&gt;全程局域网传输，网络路径短、抖动小、无需公网中转。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;所以体感上会更“跟手”，更接近真实副屏，而不是传统远程控制窗口。&lt;/p&gt;
&lt;p&gt;把整条延迟链路按工程视角拉开看，会更容易理解为什么参数要那样配。&lt;/p&gt;
&lt;p&gt;帧缓冲抓取流程（简化）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;应用把画面提交给系统合成器。&lt;/li&gt;
&lt;li&gt;Sunshine 从目标显示输出抓取当前帧缓冲（当前时刻准备送到屏幕的图像数据）。&lt;/li&gt;
&lt;li&gt;抓到的帧进入编码队列，等待硬件编码。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;GPU 硬件编码 pipeline：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;帧数据进入 NVENC/AMF/QSV 编码单元。&lt;/li&gt;
&lt;li&gt;编码单元按预设做帧内/帧间压缩。&lt;/li&gt;
&lt;li&gt;输出码流后交给网络发送线程。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;NVENC 的低延迟路径怎么理解：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;低延迟 preset 会减少缓存深度和前瞻处理。&lt;/li&gt;
&lt;li&gt;代价是同码率下画质可能略差，但交互延迟更短、更稳定。&lt;/li&gt;
&lt;li&gt;副屏交互场景通常更吃“响应速度”，所以这笔交换很值。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;网络传输中的 jitter buffer（用于吸收网络抖动的小缓冲区）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;客户端会保留一小段缓冲来对抗网络抖动。&lt;/li&gt;
&lt;li&gt;缓冲太大，稳定但延迟高；缓冲太小，延迟低但容易抖。&lt;/li&gt;
&lt;li&gt;实际调参就是在“稳定性”和“绝对低延迟”之间找平衡点。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;为什么传统远程桌面协议延迟通常更高（只讲原理）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;它更偏“桌面可读性与兼容性”目标，不是为高帧实时画面设计。&lt;/li&gt;
&lt;li&gt;编码策略常更强调压缩效率和可靠传输，缓冲和重传策略更保守。&lt;/li&gt;
&lt;li&gt;输入、编码、传输、合成链路里的安全冗余更多，换来的是更稳定的远程办公体验，但不是最低交互延迟。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;小结&quot;&gt;小结&lt;/h3&gt;
&lt;p&gt;这套方案我用下来，把平板真的变成了一块可长期使用的副屏。写代码、查文档、看监控面板这种场景，体验已经非常接近实体第二屏。&lt;/p&gt;
&lt;p&gt;它的优点很明确：无线、低延迟、参数可控，而且成本比再买一套固定显示器低不少。尤其是你本来就有平板，改造成本几乎只剩时间。&lt;/p&gt;
&lt;p&gt;适用场景我觉得也很清楚：宿舍党、经常搬地方办公的人、临时搭建双屏环境的人，都会明显受益。固定工位党当然也能用，但固定显示器依然是最省心的终点方案。&lt;/p&gt;
&lt;p&gt;要注意的地方也就几件：网络质量、编码设置、虚拟屏参数一致性。前面这些步骤看起来多，其实第一次配好后，后面基本就是“打开就用”。&lt;/p&gt;
&lt;p&gt;如果你是第一次折腾这类串流副屏，我建议先按保守参数跑稳，再一点点加画质和刷新率。别一上来拉满，先稳定，体感会好很多。&lt;/p&gt;
&lt;p&gt;其实也不止可以用来做副屏，sunshine你也可以后面配置好，平板串流你电脑上的游戏，然后你在床上，平板放腿上，接个手柄玩什么的。&lt;/p&gt;</content:encoded><category>sunshine</category><category>tools</category><category>guide</category><category>screen-streaming</category><category>virtual-display</category><category>CN</category></item><item><title>我是如何稳定追番的</title><link>https://danarnoux.com/blog/how-i-keep-my-anime-watching-stable-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-i-keep-my-anime-watching-stable-cn/</guid><description>这篇就讲人话：怎么稳定看番、用什么软件、从哪里开始看。</description><pubDate>Sat, 14 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;引言&quot;&gt;引言&lt;/h2&gt;
&lt;p&gt;如何追番，或者说如何稳定地追番？&lt;/p&gt;
&lt;p&gt;当你想追一部新番时，有可能这个番需要某个 app 会员，也可能国内还没引进。就算引进了，也得等几周审核延迟。经典如 Lycoris 这部原创动画，在“无法预测的命运之舞台”里，我们每周都在等下一集到底讲什么。&lt;/p&gt;
&lt;p&gt;我也试过直接看日本电视台放映，靠我那点蹩脚日语硬啃，结果看得一脸懵。真的很急。所以当时 B 站虽然也能看，但进度比官方晚了好几周。后面剧情大家都知道，我那会儿追到后面，感觉自己简直是小丑。&lt;/p&gt;
&lt;p&gt;你有没有想过，你随便搜个番名，找到一个网站就看了，但资源其实并不稳定，有时候画质糊得离谱；有些番你也不想看和谐版；而且我自己还希望看番能有弹幕。其实这些需求是可以被满足的，这篇文章就聊聊，我是怎么把“追番”这件事，慢慢做成一个稳定流程的。&lt;/p&gt;
&lt;hr&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-warning&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;warning&lt;/p&gt;
&lt;p&gt;本文仅用于分享个人观影流程与工具使用经验。请根据你所在地区的法律法规与平台条款，合法观看与使用相关软件。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;1-如何获取资源&quot;&gt;1. 如何获取资源&lt;/h2&gt;
&lt;p&gt;先把话说清楚：我这篇不是教你“去哪里找盗版”，而是教你怎么少踩坑、稳定看番。我的做法是先看本地区可用的合法平台，再决定要不要做本地播放和订阅（疯狂叠甲）。&lt;/p&gt;
&lt;h3 id=&quot;为什么我要下载到本地播放&quot;&gt;为什么我要下载到本地播放？&lt;/h3&gt;
&lt;p&gt;不是每个人都必须本地播放，但如果你对画质、字幕、进度和弹幕有要求，本地播放通常更稳。平台端胜在方便，本地端胜在可控，我自己是两套并行。&lt;/p&gt;
&lt;p&gt;你可以理解成：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;平台端：适合快速开看、补番、跨设备。&lt;/li&gt;
&lt;li&gt;本地端：适合高画质、字幕控制、收藏归档。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你只是轻度追更，平台端就够。如果你跟我一样会在意字幕和解码，那本地端会更舒服。例如，对我来说，我国漫和日漫都看，像凸变英雄X这种番我是每周更新那天12点蹲着看，一刻都不想等。而超时空辉夜姬这种番，我更注重我极限的观影环境，我必须搞到最清晰的片源之类爽爽看。&lt;/p&gt;
&lt;h3 id=&quot;什么是磁力链&quot;&gt;什么是磁力链？&lt;/h3&gt;
&lt;p&gt;磁力链（Magnet URI）是一个技术标识，本质上是“告诉下载器这是什么内容”，不是“告诉你去哪个网站拿内容”。&lt;/p&gt;
&lt;p&gt;它常见于 P2P 场景。P2P（Peer-to-Peer）可以简单理解成“大家互相传数据”，不是完全依赖单一服务器，所以速度会受在线节点、网络质量、做种数量影响。&lt;/p&gt;
&lt;p&gt;这里还是那句话：技术是中性的，使用必须合法。在某些国家，例如德国，通过 BitTorrent 等 P2P 技术下载受版权保护的内容可能会面临法律风险，因为此类协议通常同时涉及文件上传（分发）。现实中确实存在因版权侵权而收到律师函与罚款的案例，因此在使用此类技术前，应充分了解当地法律环境。(你也不想看个番被罚款一堆欧元吧)&lt;/p&gt;
&lt;h3 id=&quot;那我要如何获取番剧资源的磁力链呢&quot;&gt;那我要如何获取番剧资源的磁力链呢？&lt;/h3&gt;
&lt;p&gt;我不在这里提供任何未授权来源路径。你要做的是先确认作品在你地区的授权状态，再从合法渠道观看或获取你有权使用的内容。&lt;/p&gt;
&lt;p&gt;如果你只是想先开始看，建议先用下面这些正规平台试着追：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.bilibili.com/anime/&quot;&gt;哔哩哔哩番剧&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://v.qq.com/channel/cartoon&quot;&gt;腾讯视频动漫&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.iqiyi.com/dongman/&quot;&gt;爱奇艺动漫&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youku.com/channel/webcomic&quot;&gt;优酷动漫&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.netflix.com/browse/genre/7424&quot;&gt;Netflix 动漫分类&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.crunchyroll.com/&quot;&gt;Crunchyroll&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;但是这毕竟不是你想看到的内容，所以我为你推荐一个获取番剧磁力链的网站&lt;a href=&quot;https://mikanani.me/&quot;&gt;Mikan&lt;/a&gt;，接下来的教程我们会议电锯人蕾塞篇的下载为例。
你进入网站后直接搜就行了，能搜到后挑选一个你可以接受的画质和字幕类型的资源复制磁链。&lt;/p&gt;
&lt;h4 id=&quot;什么是字幕组简繁内封又是什么&quot;&gt;什么是字幕组？简繁内封又是什么？&lt;/h4&gt;
&lt;p&gt;这些词你迟早会遇到，提前知道能省很多时间。&lt;/p&gt;
&lt;p&gt;字幕组你可以理解成“做翻译、时间轴、校对、压制”的团队。简繁内封一般是指字幕在文件里已经封装好，同时带简体和繁体轨道。&lt;/p&gt;
&lt;p&gt;如果你遇到“字幕有但显示效果很差”，先查三件事：播放器字幕引擎、字体是否缺失、字幕轨是否选对。
字幕组很多时候是为爱发电，他们也不容易，每当有新番更新，你不能第一时间在这些番剧资源网站获取到熟肉是正常的，毕竟人家也需要时间做对吧。基本等个第二天就应该能看到了。&lt;/p&gt;
&lt;h3 id=&quot;磁力链资源要怎么下&quot;&gt;磁力链资源要怎么下？&lt;/h3&gt;
&lt;p&gt;我的建议是：先装一个稳定下载器，路径一次配好，不要每次临时改。这样后面播放器、弹幕、RSS 才能串起来。&lt;/p&gt;
&lt;h4 id=&quot;qbittorrent&quot;&gt;qbittorrent&lt;/h4&gt;
&lt;p&gt;我目前主力就是 qBittorrent，最大的原因是它很“纯工具”：干净、没那么花里胡哨，而且你拿到磁力链接后操作非常直接。&lt;/p&gt;
&lt;p&gt;官方下载：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.qbittorrent.org/&quot;&gt;qBittorrent 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.qbittorrent.org/download&quot;&gt;qBittorrent 下载页&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/qbittorrent/qBittorrent/releases&quot;&gt;qBittorrent GitHub Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你官网打不开，可以直接用 GitHub 下载，Windows 按这个选就行：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开 &lt;code&gt;qBittorrent GitHub Releases&lt;/code&gt; 页面，选最新稳定版本（不要选 pre-release）。&lt;/li&gt;
&lt;li&gt;点开该版本的 &lt;code&gt;Assets&lt;/code&gt; 列表。&lt;/li&gt;
&lt;li&gt;Windows 用户优先下载安装包：文件名通常是 &lt;code&gt;qbittorrent_版本号_x64_setup.exe&lt;/code&gt;（64 位系统）。&lt;/li&gt;
&lt;li&gt;如果你只想便携版，不想安装，选 &lt;code&gt;x64.zip&lt;/code&gt; 这类压缩包，解压后运行 &lt;code&gt;qbittorrent.exe&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;不要下载 &lt;code&gt;Source code (zip)&lt;/code&gt; 或 &lt;code&gt;Source code (tar.gz)&lt;/code&gt;，那是源码，不是给普通用户直接安装的。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你是第一次用，我建议你就按下面这套来，基本不会迷路。&lt;/p&gt;
&lt;p&gt;第一步，先装好 qBittorrent，打开后进 &lt;code&gt;工具 -&gt; 选项 -&gt; 下载&lt;/code&gt;，把默认保存路径设置好，比如 &lt;code&gt;AnimeWorkspace/_incoming&lt;/code&gt;。&lt;br&gt;
第二步，拿到磁力链接后，直接复制。qBittorrent 一般会自动弹出“添加种子”窗口；如果没弹出，就手动点左上角“添加链接”（链条图标）把磁力贴进去。&lt;br&gt;
第三步，在“添加种子”窗口里重点看三件事：保存路径、文件列表、是否“立即开始”。确认没问题再点“确定”。&lt;br&gt;
第四步，回到主界面看状态。状态从“正在下载”变成“正在做种”就说明文件已经下完了。&lt;/p&gt;
&lt;p&gt;你真正关心的“下完之后怎么看对不对”，我建议就查这几项：文件大小是否异常、视频时长是否正常、字幕轨是否存在。没问题再挪到你正式看片目录。&lt;/p&gt;
&lt;p&gt;它的优点我用人话总结就是三条：&lt;br&gt;
第一，稳定，长时间挂着也不太容易抽风。&lt;br&gt;
第二，可控，你要存哪、怎么分类都能自己定。&lt;br&gt;
第三，对 RSS 和自动化规则支持好，后续追更省心。&lt;/p&gt;
&lt;p&gt;缺点也有：&lt;br&gt;
第一，界面偏朴素，新手第一次看会觉得信息很多。&lt;br&gt;
第二，速度不一定一直快，受做种人数和网络环境影响很大。&lt;br&gt;
第三，你如果完全不想折腾任何设置，会觉得它“没那么傻瓜”。&lt;/p&gt;
&lt;p&gt;你提到“下载时看到各个国家的国旗是什么意思”，这个很多人第一次都会问。&lt;br&gt;
在 qBittorrent 里，国旗一般表示当前连接到的 Peer（节点）IP 归属地。简单理解就是：你正在和哪些国家/地区的节点交换数据。&lt;br&gt;
它不是内容来源的法律背书，也不是质量保证，只是一个网络地理信息参考。&lt;br&gt;
另外这类标记基于 IP 数据库，会有误差，所以你看到国旗和你想象不一样也很正常。&lt;/p&gt;
&lt;h4 id=&quot;夸克网盘非广告&quot;&gt;夸克网盘（非广告）&lt;/h4&gt;
&lt;p&gt;我会把夸克当成磁力下载的一种“加速方案”，核心原因就是速度体感确实快。&lt;br&gt;
按我自己的网络环境（家里千兆宽带）来看，夸克网盘在会员状态下，很多任务能跑到 &lt;code&gt;50-60 MB/s&lt;/code&gt;，这在日常使用里已经很舒服了。&lt;/p&gt;
&lt;p&gt;和 qBittorrent 对比的话，差别不一定是“软件谁更强”，而是下载模式不同。&lt;br&gt;
夸克更像“先让平台服务器把资源拉好，再给你下”，所以速度表现常常更稳定。&lt;br&gt;
qBittorrent 是典型 P2P 直连模式，速度会更依赖当时在线节点数量、对端上传能力和你的网络连通性。节点好时它也能很快，节点差时就会掉速。&lt;/p&gt;
&lt;p&gt;所以更准确的说法是：夸克在会员前提下，速度上限和稳定性通常更容易跑出来；qBittorrent 的速度波动更大，但透明度和可控性更高。&lt;/p&gt;
&lt;p&gt;下载入口：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.quark.cn/&quot;&gt;夸克官网&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;它的优点是跨设备方便，磁力资源下载快。而且你只要复制磁力链接了他就能给你弹出一个下载窗口。&lt;/p&gt;
&lt;h4 id=&quot;迅雷非广告&quot;&gt;迅雷（非广告）&lt;/h4&gt;
&lt;p&gt;迅雷在圈子里经常被叫“吸血雷”，这个说法不是空穴来风，主要是历史上大家对它在 P2P 生态中的行为有争议。&lt;br&gt;
“吸血”这个词的意思大概是：下载时拿得多、分享得少，或者借助加速体系让普通节点承担更多上传压力。&lt;/p&gt;
&lt;p&gt;从用户体感看，你会觉得它“我这边下得很快”；但从网络生态角度看，如果大量客户端都偏向只拿不共享，整个网络健康度会下降，最后大家都变慢。&lt;br&gt;
这也是为什么老 P2P 用户对“吸血雷”这个称呼非常敏感，它本质是在讨论公平共享的问题。&lt;/p&gt;
&lt;p&gt;下载入口：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xunlei.com/&quot;&gt;迅雷官网&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;2-选择你的播放器&quot;&gt;2. 选择你的播放器&lt;/h2&gt;
&lt;p&gt;下载只是第一步，真正决定你“看得爽不爽”的是播放器。尤其是解码能力和字幕支持，这两个差一点，体验会差很多。&lt;/p&gt;
&lt;h3 id=&quot;potplayer&quot;&gt;potplayer&lt;/h3&gt;
&lt;p&gt;PotPlayer 我自己一直当主力本地播放器用，它的核心优势就是解码强、字幕细节能调、兼容性高。你手里文件格式比较杂的时候，它通常都能稳稳播出来。&lt;/p&gt;
&lt;p&gt;官方下载：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://potplayer.daum.net/&quot;&gt;PotPlayer 官网&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;安装我建议这样走，基本不踩坑：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开官网后，下载 Windows 版本安装包。&lt;/li&gt;
&lt;li&gt;双击安装，一般保持默认下一步就行。&lt;/li&gt;
&lt;li&gt;第一次打开播放器后，先别急着调一堆参数，先拖一个你常看的视频进去试播。&lt;/li&gt;
&lt;li&gt;确认能正常播放后，再进设置做基础优化。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;基础设置我建议先配这几项，够用了：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;关联常见视频格式（mkv、mp4），以后双击文件直接用 PotPlayer 打开。&lt;/li&gt;
&lt;li&gt;在“字幕”里开启自动加载同名字幕文件，减少手动操作。&lt;/li&gt;
&lt;li&gt;在“视频”里确认硬件解码是开启状态（一般默认就开）。&lt;/li&gt;
&lt;li&gt;音频输出先保持默认，不要第一天就上复杂滤镜。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;它的好处我按真实体验讲：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;解码能力强：很多平台播放器播不顺的封装，PotPlayer 能播。&lt;/li&gt;
&lt;li&gt;字幕控制细：字体、描边、阴影、位置都能调，字幕党很舒服。&lt;/li&gt;
&lt;li&gt;音轨切换方便：双音轨、外挂字幕、内封字幕切换都快。&lt;/li&gt;
&lt;li&gt;本地稳定：你不用被平台 UI 和功能变化影响。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;新手最常见的问题其实就三个：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;卡顿：先看硬解有没有开，再看是否误开了高负载滤镜。&lt;/li&gt;
&lt;li&gt;字幕怪异：先换字幕渲染方式，再检查系统字体是否缺失。&lt;/li&gt;
&lt;li&gt;没声音或声道怪：切一下音频输出设备，或者切到另一个音轨测试。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我自己的使用流程很简单：双击文件打开 -&gt; 右键确认字幕轨和音轨 -&gt; 如果不对再进设置微调。不要一开始把播放器改得太“极限”，先稳定，再个性化。&lt;/p&gt;
&lt;h3 id=&quot;dandanplay&quot;&gt;dandanplay&lt;/h3&gt;
&lt;p&gt;dandanplay 我把它理解成“专门给看番做的播放器”。它不是参数最多的，但它把播放、弹幕、番剧信息、文件匹配这些事情放在了一起，对追更党特别省心。&lt;/p&gt;
&lt;p&gt;官方下载：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.dandanplay.com/&quot;&gt;弹弹play 官网&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kaedei/dandanplay/releases&quot;&gt;GitHub Releases（Windows版发布页）&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果你想在 Windows 上从 GitHub 直接下，我建议按这个顺序来：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开发布页后，先看版本标题，优先选带 &lt;code&gt;windows-&lt;/code&gt; 的最新版本。&lt;/li&gt;
&lt;li&gt;点开这个版本的 &lt;code&gt;Assets&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;你要下载的文件优先选安装包：文件名里通常会有 &lt;code&gt;Setup&lt;/code&gt; 和 &lt;code&gt;.exe&lt;/code&gt;。&lt;br&gt;
如果你是 64 位 Windows，优先选带 &lt;code&gt;x64&lt;/code&gt; 的安装包（如果有）。&lt;/li&gt;
&lt;li&gt;如果你不想安装，想要绿色版，就选 &lt;code&gt;.zip&lt;/code&gt; 压缩包，解压后运行 &lt;code&gt;dandanplay.exe&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;不要下 &lt;code&gt;Source code (zip)&lt;/code&gt; 或 &lt;code&gt;Source code (tar.gz)&lt;/code&gt;，那是源码，不是给普通用户直接安装用的。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;下载和安装也很直白：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开官网，下载对应系统版本。&lt;/li&gt;
&lt;li&gt;双击安装，默认路径安装即可。&lt;/li&gt;
&lt;li&gt;首次打开后，先把你的番剧文件夹加入媒体库。&lt;/li&gt;
&lt;li&gt;让它先扫描一次，这样后面识别速度会快很多。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;它的核心好处我总结成四个点：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;看番一体化：本地播放和弹幕不用来回切软件。&lt;/li&gt;
&lt;li&gt;识别友好：对番剧命名和集数识别通常比通用播放器更友好。&lt;/li&gt;
&lt;li&gt;弹幕体验好：匹配、加载、筛选都做得比较顺手。&lt;/li&gt;
&lt;li&gt;上手门槛低：不想折腾大量参数也能直接用。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;第一次使用我建议按这个顺序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先导入一个作品文件夹，确认集数识别正确。&lt;/li&gt;
&lt;li&gt;打开一集，先看弹幕是否时间轴对齐。&lt;/li&gt;
&lt;li&gt;在设置里把弹幕透明度、速度、字号调成你自己舒服的值。&lt;/li&gt;
&lt;li&gt;最后再决定是否开启更多过滤规则（比如屏蔽重复弹幕）。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;很多人一开始会遇到“有弹幕但看着很乱”，这不是软件坏了，通常是参数没调好。你先把弹幕速度放慢一点、轨道数量适中、透明度降低一些，观感会立刻好很多。&lt;/p&gt;
&lt;p&gt;如果你同时装了 PotPlayer 和 dandanplay，我建议分工用：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;想细抠画质和字幕样式，用 PotPlayer。&lt;/li&gt;
&lt;li&gt;想轻松追更看弹幕，用 dandanplay。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这样组合起来，基本能覆盖绝大多数追番场景。&lt;/p&gt;
&lt;h3 id=&quot;夸克网盘&quot;&gt;夸克网盘&lt;/h3&gt;
&lt;p&gt;夸克这边我更多是把它当轻量播放器。&lt;/p&gt;
&lt;p&gt;优点是你换设备很方便，缺点是解码和字幕微调不够细。我的建议是把它放在“补充位”，不是“主力位”。&lt;/p&gt;
&lt;h2 id=&quot;3-如何用-dandan-play-配置弹幕&quot;&gt;3. 如何用 dandan play 配置弹幕&lt;/h2&gt;
&lt;p&gt;弹幕这块真的是细节决定体验。你参数配对了会很舒服，配错了就会觉得很吵。&lt;/p&gt;
&lt;h3 id=&quot;什么是弹幕&quot;&gt;什么是弹幕？&lt;/h3&gt;
&lt;p&gt;弹幕就是绑定时间轴的评论流。它的价值在于让你看到同一剧情节点上别人的实时反应，这种“异步共时”是番剧体验里很有趣的一部分。&lt;/p&gt;
&lt;h3 id=&quot;什么是弹幕源&quot;&gt;什么是弹幕源？&lt;/h3&gt;
&lt;p&gt;弹幕源可以理解成数据来源。不同来源，密度、质量、审核风格、时间轴精度都不一样，所以同一集在不同源里的观感差异会很大。&lt;/p&gt;
&lt;h3 id=&quot;选择弹幕源&quot;&gt;选择弹幕源&lt;/h3&gt;
&lt;p&gt;我的做法很实在：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先拿一集做测试，看关键剧情点是否对齐。&lt;/li&gt;
&lt;li&gt;再看内容质量，是否刷屏或重复太多。&lt;/li&gt;
&lt;li&gt;最后才看数量够不够。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我建议固定 1-2 个你习惯的源，不要每周来回切。固定后，再把透明度、速度、字号上限这几个参数也固定，观看体验会稳很多。&lt;/p&gt;
&lt;h2 id=&quot;4-什么是-rss-订阅&quot;&gt;4. 什么是 RSS 订阅？&lt;/h2&gt;
&lt;p&gt;先说人话版定义：RSS 就是“自动更新通知”。&lt;br&gt;
你可以把它理解成“订阅箱”，只要对方有新内容，就会按统一格式推送给你，你不用每天手动去翻。&lt;/p&gt;
&lt;p&gt;技术上它是一种基于 XML 的内容订阅标准，常见后缀是 &lt;code&gt;feed&lt;/code&gt;、&lt;code&gt;rss.xml&lt;/code&gt;、&lt;code&gt;atom.xml&lt;/code&gt;。&lt;br&gt;
它不会直接帮你下载文件，它做的是“发现更新”。下载动作要靠后面的工具规则来执行。&lt;/p&gt;
&lt;p&gt;为什么这东西对追番有用？因为它解决了最烦的事：你不用记“今天周几更新、要去哪个页面看”。&lt;br&gt;
你只要把订阅源配好，更新会自己进来，你再决定“手动下”还是“自动下”。&lt;/p&gt;
&lt;h4 id=&quot;如何使用-qbittorrent-进行番剧订阅&quot;&gt;如何使用 qbittorrent 进行番剧订阅？&lt;/h4&gt;
&lt;p&gt;在 qBittorrent 里，RSS 的分工很清楚：&lt;br&gt;
RSS 负责发现新条目，下载规则负责判断这个条目是否要下载。&lt;/p&gt;
&lt;p&gt;下面这套是我自己在 Windows 上的实操流程，给你一个能直接照做的版本。&lt;/p&gt;
&lt;p&gt;第一步，先打开 RSS 功能。&lt;br&gt;
进入 qBittorrent 顶部菜单 &lt;code&gt;视图&lt;/code&gt;，勾选 &lt;code&gt;RSS 阅读器&lt;/code&gt;，左侧会出现 RSS 面板。&lt;br&gt;
如果你第一次开，它会提示初始化，直接确认就行。&lt;/p&gt;
&lt;p&gt;第二步，添加订阅源。&lt;br&gt;
在 RSS 面板里点“新建订阅”或“添加 feed”，把你已有的合法 RSS 链接贴进去。&lt;br&gt;
比如官方公告 feed、你已授权内容的平台更新 feed、或公开可订阅的节目更新源。&lt;/p&gt;
&lt;p&gt;第三步，确认源是否正常更新。&lt;br&gt;
添加后先看它会不会拉到新条目。&lt;br&gt;
如果一直空白，先检查三件事：链接是否有效、网络是否可访问、源本身是否近期有更新。&lt;/p&gt;
&lt;p&gt;第四步，创建下载规则（核心）。&lt;br&gt;
进入 &lt;code&gt;RSS 下载器&lt;/code&gt;（有时叫“自动下载规则”），新建一条规则。&lt;br&gt;
我建议先填这几项：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;必须包含&lt;/code&gt;：作品名 + 季号，比如 &lt;code&gt;Lycoris&lt;/code&gt; + &lt;code&gt;S01&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;可选包含&lt;/code&gt;：&lt;code&gt;1080p&lt;/code&gt;、&lt;code&gt;简体&lt;/code&gt;、&lt;code&gt;CHS&lt;/code&gt; 这类你偏好的标签。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;必须不包含&lt;/code&gt;：你不想要的关键词，比如 &lt;code&gt;合集&lt;/code&gt;、&lt;code&gt;预告&lt;/code&gt;、&lt;code&gt;NCOP&lt;/code&gt;（按你需求）。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;保存目录&lt;/code&gt;：指向你固定的下载目录，比如 &lt;code&gt;AnimeWorkspace/_incoming&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;智能过滤&lt;/code&gt;：同一集只抓一次，避免重复下载。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;第五步，先手动试跑，不要一上来全自动。&lt;br&gt;
先让它跑 3-7 天，观察误匹配情况。&lt;br&gt;
误匹配多，就收紧“必须包含”；漏抓多，就放宽关键词或加同义词。&lt;/p&gt;
&lt;p&gt;第六步，再决定是否自动下载。&lt;br&gt;
当你确认规则稳定后，再勾选自动下载。&lt;br&gt;
这时候你就基本进入“更新来了就排队，排队完你再看”的状态了。&lt;/p&gt;
&lt;p&gt;我给你一个更稳的规则思路，尤其适合新手：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;一部番先只建一条规则。&lt;/li&gt;
&lt;li&gt;先把标题匹配做准，再去加清晰度/字幕细分。&lt;/li&gt;
&lt;li&gt;规则名称写清楚（比如 &lt;code&gt;2026Q1_Lycoris_S01_1080p&lt;/code&gt;），后面维护不乱。&lt;/li&gt;
&lt;li&gt;每周固定检查一次命中结果，微调后再放着跑。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;最后补一个常见问题排错清单，你文章里读者会很需要：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;RSS 没更新：先检查 feed 链接是否失效，再看网络代理或 DNS。&lt;/li&gt;
&lt;li&gt;条目出现但不下载：通常是规则关键词没命中，先看标题文本再改规则。&lt;/li&gt;
&lt;li&gt;总是下错版本：&lt;code&gt;必须包含&lt;/code&gt;太宽，补上季号/分辨率/字幕标签。&lt;/li&gt;
&lt;li&gt;重复下载：开启智能过滤，或在规则里限制同标题重复。&lt;/li&gt;
&lt;li&gt;下载到了错误目录：规则里单独设置保存路径，不要只用全局默认目录。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;你把 RSS 这块配顺之后，追更真的会轻松很多。&lt;br&gt;
不是说从此不用管，而是从“每天手动找更新”，变成“每周花几分钟维护规则”。&lt;/p&gt;
&lt;h2 id=&quot;小结&quot;&gt;小结&lt;/h2&gt;
&lt;p&gt;根据我的教程，你应该学会了如何追番。实话说自23年起我养成了在本地看番的习惯后就改不掉了，是一个玩nas的老乡教我的。今年我教了一个纽约美高这个办法，他惊叹：我简直是在现场看一样！太清晰了！
一定一定要管理好下载番剧的文件夹，因为下载的后一段时间不看你就大概率忘了你下的是啥番了（提供文件夹名称）。恕我不能提供更详细图文并茂的教程，如有问题，自行谷歌或者去b站搜索视频按照步骤操作。&lt;/p&gt;
&lt;p&gt;享受看番的过程，或许您后面会走上一条路折腾nas什么的来下载番剧看番，但不要忘了旅途最初的目的。&lt;/p&gt;
&lt;p&gt;希望您能通过我的分享更好的看番。&lt;/p&gt;</content:encoded><category>anime</category><category>p2p</category><category>tools</category><category>guide</category><category>CN</category></item><item><title>How I Keep My Anime Watching Stable</title><link>https://danarnoux.com/blog/how-i-keep-my-anime-watching-stable-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-i-keep-my-anime-watching-stable-en/</guid><description>A practical, slightly nerdy, and hopefully friendly guide to watching anime more steadily with the tools I actually use.</description><pubDate>Sat, 14 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;How do you keep up with anime, or more importantly, how do you keep up &lt;em&gt;consistently&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;When a new show starts, sometimes it needs a paid membership on one app, sometimes it is not even licensed in your region yet, and sometimes even after licensing, you still wait extra weeks for delayed release windows. A classic case for me was &lt;em&gt;Lycoris Recoil&lt;/em&gt;. Every week I was waiting for the newest episode like my life depended on it.&lt;/p&gt;
&lt;p&gt;I even tried watching Japanese TV broadcasts directly with my very questionable Japanese skills. That ended exactly how you expect: confusion, panic, and me staring at the screen like a lost NPC.&lt;/p&gt;
&lt;p&gt;So yes, I was in a hurry. Platforms like Bilibili could work, but often lagged behind official release timing by weeks. And if you know that show, you know why being late felt rough. I felt like a clown by the time I caught up.&lt;/p&gt;
&lt;p&gt;Have you had this too: you search a title, click a random site, and the video quality is blurry, unstable, or heavily edited; subtitles are inconsistent; and if you like watching with danmaku, the experience is all over the place. The good news is these problems can be improved. This post is basically how I made my anime-watching flow less chaotic and more reliable.&lt;/p&gt;
&lt;hr&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-warning&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;warning&lt;/p&gt;
&lt;p&gt;This post only shares personal workflow and tool usage ideas. It does not provide unauthorized content sources. Please follow local laws and platform terms in your region.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;1-how-i-get-content&quot;&gt;1. How I Get Content&lt;/h2&gt;
&lt;p&gt;Let me be clear first: this is not a piracy tutorial. This is a “how to reduce chaos” tutorial.&lt;/p&gt;
&lt;p&gt;My order is simple: check legal options in my region first, then decide whether I need local playback for better quality/subtitle control.&lt;/p&gt;
&lt;h3 id=&quot;why-do-i-still-download-for-local-playback&quot;&gt;Why do I still download for local playback?&lt;/h3&gt;
&lt;p&gt;Not everyone needs local playback. But if you care about quality consistency, subtitle control, release timing, and archive stability, local playback helps a lot.&lt;/p&gt;
&lt;p&gt;I treat it like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Platform streaming: fast and convenient, great for casual watching.&lt;/li&gt;
&lt;li&gt;Local playback: better control, better consistency, better for rewatching.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you watch casually, streaming may be enough. If you are picky like me, local playback is often worth it.&lt;/p&gt;
&lt;h3 id=&quot;what-is-a-magnet-link&quot;&gt;What is a magnet link?&lt;/h3&gt;
&lt;p&gt;A magnet link (Magnet URI) is a technical identifier. It tells a client what content hash to look for; it does not automatically mean “this is where to legally get content.”&lt;/p&gt;
&lt;p&gt;You will often see it with P2P workflows. P2P (Peer-to-Peer) means participants exchange data with each other instead of relying only on one central server. So speed can change based on peers online, their upload rates, and your network path.&lt;/p&gt;
&lt;p&gt;Technology itself is neutral. Usage still needs to be legal.&lt;/p&gt;
&lt;h3 id=&quot;so-how-do-i-get-anime-magnet-links-then&quot;&gt;So how do I get anime magnet links then?&lt;/h3&gt;
&lt;p&gt;I do not provide unauthorized source instructions here.&lt;/p&gt;
&lt;p&gt;My practical approach: confirm licensing in your region first, then use legal channels. If you just want to start watching today, these are common legitimate platforms to check first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.bilibili.com/anime/&quot;&gt;Bilibili Anime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://v.qq.com/channel/cartoon&quot;&gt;Tencent Video Anime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.iqiyi.com/dongman/&quot;&gt;iQIYI Anime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youku.com/channel/webcomic&quot;&gt;Youku Anime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.netflix.com/browse/genre/7424&quot;&gt;Netflix Anime Category&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.crunchyroll.com/&quot;&gt;Crunchyroll&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Catalogs vary a lot by region, which is normal. I usually build a weekly watchlist first, then map each title to whichever legal platform actually has it.&lt;/p&gt;
&lt;h4 id=&quot;what-are-fansub-groups-what-does-dual-chinese-internal-subtitles-mean&quot;&gt;What are fansub groups? What does dual Chinese internal subtitles mean?&lt;/h4&gt;
&lt;p&gt;You will see these terms sooner or later.&lt;/p&gt;
&lt;p&gt;A fansub group usually handles translation, timing, editing, and packaging. “Internal subtitles” means subtitle tracks are embedded in the media container. “Dual Chinese” often means both Simplified and Traditional subtitle tracks are included.&lt;/p&gt;
&lt;p&gt;If subtitles exist but look terrible, check three things first: subtitle renderer, missing fonts, and whether you selected the correct subtitle track.&lt;/p&gt;
&lt;h3 id=&quot;how-do-i-download-from-a-magnet-link&quot;&gt;How do I download from a magnet link?&lt;/h3&gt;
&lt;p&gt;I will only cover tool usage here, not source discovery.&lt;/p&gt;
&lt;p&gt;The practical idea is simple: use one stable downloader and keep your path settings consistent. That way your player, danmaku workflow, and RSS setup all stay clean.&lt;/p&gt;
&lt;h4 id=&quot;qbittorrent&quot;&gt;qbittorrent&lt;/h4&gt;
&lt;p&gt;qBittorrent is still my primary client. It feels like a proper tool: clean, transparent, and direct.&lt;/p&gt;
&lt;p&gt;Official download links:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.qbittorrent.org/&quot;&gt;qBittorrent official site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.qbittorrent.org/download&quot;&gt;qBittorrent download page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/qbittorrent/qBittorrent/releases&quot;&gt;qBittorrent GitHub Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If the official site is inaccessible for you, GitHub releases work fine. On Windows, use this quick rule:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Releases and pick the latest stable version (not pre-release).&lt;/li&gt;
&lt;li&gt;Expand &lt;code&gt;Assets&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For most users, download the installer: usually &lt;code&gt;qbittorrent_&amp;#x3C;version&gt;_x64_setup.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you want portable mode, download the &lt;code&gt;x64.zip&lt;/code&gt; build and run &lt;code&gt;qbittorrent.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; download &lt;code&gt;Source code (zip/tar.gz)&lt;/code&gt; unless you actually plan to build from source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If this is your first time, here is the beginner-friendly flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install qBittorrent.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Tools -&gt; Options -&gt; Downloads&lt;/code&gt;, set a default save path (for example &lt;code&gt;AnimeWorkspace/_incoming&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Copy your magnet link.&lt;/li&gt;
&lt;li&gt;qBittorrent usually pops up an “Add Torrent” window automatically.&lt;/li&gt;
&lt;li&gt;If it does not pop up, click the chain/link icon and paste it manually.&lt;/li&gt;
&lt;li&gt;In the dialog, check save path, file list, and whether to start immediately.&lt;/li&gt;
&lt;li&gt;Click confirm and watch status.&lt;/li&gt;
&lt;li&gt;When status changes from downloading to seeding, download is complete.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What I check before moving a file into my main library:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;File size looks reasonable.&lt;/li&gt;
&lt;li&gt;Video duration makes sense.&lt;/li&gt;
&lt;li&gt;Subtitle track exists and is usable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Pros in plain language:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stable for long-running tasks.&lt;/li&gt;
&lt;li&gt;Highly controllable paths and categories.&lt;/li&gt;
&lt;li&gt;Great RSS automation support for weekly updates.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Cons in plain language:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;UI is not “cute beginner mode”; it looks technical.&lt;/li&gt;
&lt;li&gt;Speed fluctuates with peer/network conditions.&lt;/li&gt;
&lt;li&gt;If you hate all settings screens, it may feel a bit nerdy.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;About those country flags in peers list (this confuses many people):&lt;/p&gt;
&lt;p&gt;The flag usually represents the IP geolocation of connected peers. In plain words, it shows where those network nodes are estimated to be.&lt;/p&gt;
&lt;p&gt;It is &lt;em&gt;not&lt;/em&gt; a legal guarantee, not a quality score, and not always perfectly accurate.&lt;/p&gt;
&lt;h4 id=&quot;quark-drive-non-sponsored&quot;&gt;Quark Drive (non-sponsored)&lt;/h4&gt;
&lt;p&gt;I use Quark as an acceleration option in some cases, mostly for convenience.&lt;/p&gt;
&lt;p&gt;In my home setup (gigabit line), with membership, I can often see around &lt;code&gt;50-60 MB/s&lt;/code&gt; on many tasks.&lt;/p&gt;
&lt;p&gt;Compared with qBittorrent, the difference is often not “which app is objectively stronger” but “how the backend works.” Quark can feel more stable in speed because part of the process is platform-assisted. qBittorrent is direct P2P, so it can be very fast on good swarms and slower on weak ones.&lt;/p&gt;
&lt;p&gt;Download link:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.quark.cn/&quot;&gt;Quark official site&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;xunlei-non-sponsored&quot;&gt;Xunlei (non-sponsored)&lt;/h4&gt;
&lt;p&gt;Xunlei is often called “leech thunder” in old P2P discussions. That label comes from long-running debates about fairness in sharing behavior.&lt;/p&gt;
&lt;p&gt;The core argument is simple: if too many clients take bandwidth but contribute less back, swarm health goes down and everyone eventually suffers.&lt;/p&gt;
&lt;p&gt;Download link:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xunlei.com/&quot;&gt;Xunlei official site&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;2-choose-your-player&quot;&gt;2. Choose Your Player&lt;/h2&gt;
&lt;p&gt;Downloading is only step one. Playback quality is where your daily experience is won or lost.&lt;/p&gt;
&lt;h3 id=&quot;potplayer&quot;&gt;potplayer&lt;/h3&gt;
&lt;p&gt;PotPlayer is my main local player when I care about details.&lt;/p&gt;
&lt;p&gt;Official download:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://potplayer.daum.net/&quot;&gt;PotPlayer official site&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Beginner install path:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download Windows installer from the official page.&lt;/li&gt;
&lt;li&gt;Run installer and keep default options unless you have specific needs.&lt;/li&gt;
&lt;li&gt;Open one known-good video first before touching advanced settings.&lt;/li&gt;
&lt;li&gt;After confirming playback works, do basic tuning.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Basic setup I recommend first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Associate common formats (&lt;code&gt;mkv&lt;/code&gt;, &lt;code&gt;mp4&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Enable auto-loading same-name subtitle files.&lt;/li&gt;
&lt;li&gt;Ensure hardware decoding stays enabled.&lt;/li&gt;
&lt;li&gt;Keep audio output defaults initially.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why it is good:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Strong decoding compatibility.&lt;/li&gt;
&lt;li&gt;Excellent subtitle styling control.&lt;/li&gt;
&lt;li&gt;Fast switching between tracks/subtitles.&lt;/li&gt;
&lt;li&gt;Stable local experience without platform UI drama.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Common beginner issues:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stutter: check hardware decode and heavy filters.&lt;/li&gt;
&lt;li&gt;Weird subtitle rendering: check renderer mode and fonts.&lt;/li&gt;
&lt;li&gt;Audio oddities: switch output device or test another track.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;My normal use is boring and reliable: open file, confirm subtitle/audio tracks, only tweak settings if needed.&lt;/p&gt;
&lt;h3 id=&quot;dandanplay&quot;&gt;dandanplay&lt;/h3&gt;
&lt;p&gt;dandanplay is very anime-friendly. It combines playback, danmaku, and show metadata in one place.&lt;/p&gt;
&lt;p&gt;Official download:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.dandanplay.com/&quot;&gt;dandanplay official site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kaedei/dandanplay/releases&quot;&gt;GitHub Releases (Windows builds)&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you download from GitHub on Windows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pick the latest release with &lt;code&gt;windows-&lt;/code&gt; in the tag/title.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;Assets&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Prefer installer &lt;code&gt;.exe&lt;/code&gt; with &lt;code&gt;Setup&lt;/code&gt; in filename.&lt;/li&gt;
&lt;li&gt;On 64-bit Windows, prefer &lt;code&gt;x64&lt;/code&gt; builds when available.&lt;/li&gt;
&lt;li&gt;If you want portable mode, choose &lt;code&gt;.zip&lt;/code&gt; and run &lt;code&gt;dandanplay.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; download &lt;code&gt;Source code (zip/tar.gz)&lt;/code&gt; for normal use.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Initial setup flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install app and launch.&lt;/li&gt;
&lt;li&gt;Add your anime folder to library.&lt;/li&gt;
&lt;li&gt;Let it scan once.&lt;/li&gt;
&lt;li&gt;Open one episode and verify match.&lt;/li&gt;
&lt;li&gt;Adjust danmaku opacity/speed/font size to comfort.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why it is good:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Anime-focused workflow out of the box.&lt;/li&gt;
&lt;li&gt;Better title/episode matching than many generic players.&lt;/li&gt;
&lt;li&gt;Danmaku integration is smooth.&lt;/li&gt;
&lt;li&gt;Lower setup friction for regular users.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If danmaku looks chaotic at first, that is usually settings, not app failure. Lower speed a bit, reduce track count, and increase transparency.&lt;/p&gt;
&lt;h3 id=&quot;quark-drive&quot;&gt;Quark Drive&lt;/h3&gt;
&lt;p&gt;I use this as a light playback fallback on other devices.&lt;/p&gt;
&lt;p&gt;Convenient for quick switching, less ideal for fine subtitle/decoder control.&lt;/p&gt;
&lt;h2 id=&quot;3-how-to-configure-danmaku-in-dandanplay&quot;&gt;3. How to Configure Danmaku in dandanplay&lt;/h2&gt;
&lt;p&gt;Danmaku quality is all about tuning. Good settings feel immersive; bad settings feel noisy.&lt;/p&gt;
&lt;h3 id=&quot;what-is-danmaku&quot;&gt;What is danmaku?&lt;/h3&gt;
&lt;p&gt;Danmaku is timestamped viewer commentary synchronized to specific timeline moments.&lt;/p&gt;
&lt;p&gt;The fun part is you can still “watch with others” asynchronously.&lt;/p&gt;
&lt;h3 id=&quot;what-is-a-danmaku-source&quot;&gt;What is a danmaku source?&lt;/h3&gt;
&lt;p&gt;It is where danmaku data comes from. Different sources vary in volume, quality, moderation style, and timing precision.&lt;/p&gt;
&lt;h3 id=&quot;choosing-a-danmaku-source&quot;&gt;Choosing a danmaku source&lt;/h3&gt;
&lt;p&gt;My practical order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check timeline alignment first on one test episode.&lt;/li&gt;
&lt;li&gt;Check text quality (spam/repeat/noise).&lt;/li&gt;
&lt;li&gt;Only then evaluate quantity.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I recommend keeping 1-2 stable sources instead of switching every week.&lt;/p&gt;
&lt;h2 id=&quot;4-what-is-rss-subscription&quot;&gt;4. What is RSS Subscription?&lt;/h2&gt;
&lt;p&gt;RSS in plain English: automatic update notifications.&lt;/p&gt;
&lt;p&gt;Think of it as a subscription inbox. When a source updates, you get a structured feed item without manually checking pages every day.&lt;/p&gt;
&lt;p&gt;Technically it is a standardized feed format (often XML-based, such as RSS or Atom). It helps discover updates; it does not automatically download files by itself.&lt;/p&gt;
&lt;h3 id=&quot;how-to-use-qbittorrent-for-anime-rss-subscriptions&quot;&gt;How to use qBittorrent for anime RSS subscriptions?&lt;/h3&gt;
&lt;p&gt;In qBittorrent:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;RSS discovers new items.&lt;/li&gt;
&lt;li&gt;Download rules decide what to grab.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Windows-friendly setup flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open qBittorrent &lt;code&gt;View&lt;/code&gt; and enable &lt;code&gt;RSS Reader&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add your legal feed URL in RSS panel.&lt;/li&gt;
&lt;li&gt;Confirm feed updates are visible.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;RSS Downloader&lt;/code&gt; (auto-download rules) and create one rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I recommend starting with these fields:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Must contain: title + season keyword.&lt;/li&gt;
&lt;li&gt;Optional contains: &lt;code&gt;1080p&lt;/code&gt;, language tags, preferred release tags.&lt;/li&gt;
&lt;li&gt;Must not contain: trailers/NCOP/other unwanted items.&lt;/li&gt;
&lt;li&gt;Save path: your fixed download folder.&lt;/li&gt;
&lt;li&gt;Smart episode filter: avoid duplicates.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Start conservative:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run manually for 3-7 days.&lt;/li&gt;
&lt;li&gt;Check mis-matches.&lt;/li&gt;
&lt;li&gt;Tighten or relax keywords.&lt;/li&gt;
&lt;li&gt;Only then enable full auto-download.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Quick troubleshooting list:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Feed does not update: verify URL/network/source activity.&lt;/li&gt;
&lt;li&gt;Items appear but nothing downloads: rule mismatch.&lt;/li&gt;
&lt;li&gt;Wrong versions downloaded: tighten must-contain filters.&lt;/li&gt;
&lt;li&gt;Duplicate downloads: enable smart filters.&lt;/li&gt;
&lt;li&gt;Wrong folder: set per-rule path explicitly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once this is tuned, weekly tracking becomes much easier. You move from “daily manual searching” to “quick weekly rule maintenance,” which is honestly a huge quality-of-life upgrade.&lt;/p&gt;</content:encoded><category>anime</category><category>p2p</category><category>tools</category><category>guide</category><category>EN</category></item><item><title>如何搭建一个个人博客网站</title><link>https://danarnoux.com/blog/how-to-build-a-personal-blog-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-build-a-personal-blog-cn/</guid><description>基于Astro和Tailwind css搭建一个不需要自己解决域名和服务器问题的个人博客网站。</description><pubDate>Thu, 12 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;当我发现我的越来越记不住我的技术和想法时，我有时候会在失眠的深夜里用我手机的备忘录进行记录，但内容量相当有限，而且我无法在其他设备随时访问到我的备忘录里的内容。今年1月我在失眠的夜晚打算要是有空就搭建一个个人博客网站，我要写博客记录下来有意义的内容，为了我自己，我教过的学生，以后或许我也会有更多的学生需要。但是我实在很忙碌，最近又刚在江苏省出差完回来，回家我依旧失眠的一个夜晚，我想起了这一件事，但可惜那会是凌晨，我不好方便去打扰我有做过个人博客的朋友们，而且我预估的完成时间可能是一周。第二天早上我问了问我的高中同学Herbert Skyper，他的答复是一周，但是他是用Vue纯手搓并没有用成熟的博客框架只是想手搓个前端玩玩，我25去哈工深找他玩的时候倒是又和他聊过相关的事情，域名费大概一年几十块(七八十好像)，服务器我忘了他怎么解决了可能部署到学校的一些平台上了。做网站最麻烦之一的问题就是你需要一个域名（有特点需求还需要备案流程），还有一个尽量24小时都开着的稳定性能足够的电脑（一般来说服务器符合），还有公网IP（也是有办法解决，但是不要折腾是最好的）等等麻烦的事情。不过Skyper和我提到了一嘴他的同学有用&lt;a href=&quot;https://docs.astro.build/zh-cn/getting-started/&quot;&gt;Astro&lt;/a&gt;的，一个成熟的博客框架。后面我的朋友kymi回复了我，他用&lt;a href=&quot;https://hexo.io/zh-cn/&quot;&gt;Hexo&lt;/a&gt;写的，他的个人博客里也有对应的教程&lt;a href=&quot;https://licyk.github.io/2024/06/26/how-to-deploy-hexo/&quot;&gt;《如何用Hexo搭建博客》&lt;/a&gt;。而且他说也不是很费时间，部署在github上，这样就解决了域名和服务器费用。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;需求分析&quot;&gt;需求分析&lt;/h2&gt;
&lt;h3 id=&quot;我需要的是什么&quot;&gt;我需要的是什么？&lt;/h3&gt;
&lt;p&gt;我需要的是一个备忘录pro，我随时可以查看，并且其他人也能看，而且我希望我不会因此花费太多钱和时间。内容为王，但是我又希望可以做点美观个性的小情趣，为世界留下一些我的存在吧算是。我希望我的博客风格是简洁理性克制的，但是又温柔的，有些许多彩的小东西点缀，让人会心一笑。&lt;/p&gt;
&lt;h3 id=&quot;技术路线&quot;&gt;技术路线&lt;/h3&gt;
&lt;p&gt;根据前言，既然如此那我为什么选择了Astro了呢？因为我打算看看有哪些博客框架，他们之间都有什么优缺点，什么最适合我。由于我用Chatgpt多年，他对我的掌握的技术水平有一定了解，我将他的推荐内容整理成以下表格&lt;/p&gt;
&lt;h4 id=&quot;博客框架对比分析&quot;&gt;博客框架对比分析&lt;/h4&gt;


















































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;框架&lt;/th&gt;&lt;th&gt;技术栈&lt;/th&gt;&lt;th&gt;构建速度&lt;/th&gt;&lt;th&gt;写作体验&lt;/th&gt;&lt;th&gt;组件/交互能力&lt;/th&gt;&lt;th&gt;扩展性&lt;/th&gt;&lt;th&gt;GitHub Pages 适配&lt;/th&gt;&lt;th&gt;适合人群&lt;/th&gt;&lt;th&gt;可能的坑&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Hexo&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Node.js&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;上手简单，主题多&lt;/td&gt;&lt;td&gt;较弱（偏模板型）&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;成熟稳定&lt;/td&gt;&lt;td&gt;纯写作、中文生态用户&lt;/td&gt;&lt;td&gt;Node 依赖偶尔折腾&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Hugo&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Go&lt;/td&gt;&lt;td&gt;极快&lt;/td&gt;&lt;td&gt;结构清晰&lt;/td&gt;&lt;td&gt;一般（偏内容驱动）&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;非常稳&lt;/td&gt;&lt;td&gt;追求速度、低运维&lt;/td&gt;&lt;td&gt;主题配置偏工程化&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Astro&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;现代前端（支持 React/Vue/Svelte）&lt;/td&gt;&lt;td&gt;快&lt;/td&gt;&lt;td&gt;Markdown / MDX 体验好&lt;/td&gt;&lt;td&gt;强（组件化混排）&lt;/td&gt;&lt;td&gt;强&lt;/td&gt;&lt;td&gt;需注意 base 路径&lt;/td&gt;&lt;td&gt;前端开发者&lt;/td&gt;&lt;td&gt;自由度高，需要自己决策&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Next.js / Nuxt&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;React / Vue 全栈&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;良好&lt;/td&gt;&lt;td&gt;非常强&lt;/td&gt;&lt;td&gt;极强&lt;/td&gt;&lt;td&gt;静态导出需处理资源前缀&lt;/td&gt;&lt;td&gt;未来想做平台级网站&lt;/td&gt;&lt;td&gt;对纯博客略重&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;VitePress / Docusaurus&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Vite / React&lt;/td&gt;&lt;td&gt;快&lt;/td&gt;&lt;td&gt;文档体验极佳&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;非常稳&lt;/td&gt;&lt;td&gt;技术文档型内容&lt;/td&gt;&lt;td&gt;博客氛围较弱&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Jekyll&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Ruby&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;传统 Markdown&lt;/td&gt;&lt;td&gt;较弱&lt;/td&gt;&lt;td&gt;中等&lt;/td&gt;&lt;td&gt;原生支持&lt;/td&gt;&lt;td&gt;想最少折腾部署&lt;/td&gt;&lt;td&gt;现代化程度一般&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;决策导向总结&quot;&gt;决策导向总结&lt;/h4&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;需求类型&lt;/th&gt;&lt;th&gt;推荐方案&lt;/th&gt;&lt;th&gt;理由&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;纯写作、主题成熟、少改代码&lt;/td&gt;&lt;td&gt;Hexo / Hugo&lt;/td&gt;&lt;td&gt;经典稳定&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;大量技术文章、追求构建速度&lt;/td&gt;&lt;td&gt;Hugo&lt;/td&gt;&lt;td&gt;构建速度极快&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;博客 + 项目展示 + 前端交互&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Astro&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Markdown + 组件混排优势明显&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;未来可能升级成个人平台&lt;/td&gt;&lt;td&gt;Next.js / Nuxt&lt;/td&gt;&lt;td&gt;全栈能力强&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;偏技术文档整理&lt;/td&gt;&lt;td&gt;VitePress / Docusaurus&lt;/td&gt;&lt;td&gt;目录与结构管理优秀&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Chatgpt和我说，虽然Astro自由度高，需要自己决策可能是一个坑，但对我反而或许是一个优势了，我可以挑选我喜欢的组件，至于域名和服务器问题，我一开始想的是 Cloudflare，但是既然项目要上传github，那么github pages反而相当的方便，因为我设置完后，每次只要push就能更新了，相当的方便。下面我附上部署与成本难度的表格&lt;/p&gt;
&lt;h4 id=&quot;部署与成本维度&quot;&gt;部署与成本维度&lt;/h4&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;项目&lt;/th&gt;&lt;th&gt;现实情况&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;服务器费用&lt;/td&gt;&lt;td&gt;GitHub Pages / Cloudflare Pages / Vercel 基本为 0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;域名费用&lt;/td&gt;&lt;td&gt;默认可用 username.github.io（免费）；自定义域名通常需要付费&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;运维成本&lt;/td&gt;&lt;td&gt;静态站点基本为 0 运维&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;既然Astro支持现代前端Vue，那我要选用什么组件呢， &lt;strong&gt;你的技术路线也其实决定博客风格与气质&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;先校正一个关键认知&lt;/strong&gt;，这是 Astro 的优势，不是限制。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Astro 不是“基于 Vue 的博客”，而是：
👉 Astro = 静态站框架 + 可按需引入 Vue 组件&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Chatgpt给我选了&lt;a href=&quot;https://tailwindcss.com/plus/ui-blocks/marketing&quot;&gt;Tailwind CSS&lt;/a&gt;，并且推荐我选择一套 **耐看、长期不腻、非常“专业”**的风格，我觉得他是对的，目前这种风格我老了可能也希望（不过我老了还会是二次元吗）。您可以点击我设置的Tailwind的超链接，来看看里面的组件是否对您的胃口。&lt;/p&gt;
&lt;p&gt;目前我还是希望引入一个组件进行开发先，这样可以避免复杂性，&lt;em&gt;&lt;strong&gt;少即是多&lt;/strong&gt;&lt;/em&gt;。&lt;/p&gt;
&lt;h4 id=&quot;开发环境&quot;&gt;开发环境&lt;/h4&gt;
&lt;p&gt;我选用的是用&lt;strong&gt;Vs Code&lt;/strong&gt;作为我的&lt;strong&gt;文本编辑器&lt;/strong&gt;进行开发，并且已经安装了Astro的拓展。&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-note&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;note&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt; - &lt;code&gt;v18.20.8&lt;/code&gt; 或 &lt;code&gt;v20.3.0&lt;/code&gt;、&lt;code&gt;v22.0.0&lt;/code&gt; 或更高版本。（&lt;code&gt;v19&lt;/code&gt; 和 &lt;code&gt;v21&lt;/code&gt; 均不支持。）&lt;/p&gt;
&lt;p&gt;Astro 使用 Vite 构建，Vite 默认针对支持现代 JavaScript 的浏览器。要阅读完整的参考，你可以 &lt;a href=&quot;https://cn.vite.dev/guide/build#browser-compatibility&quot;&gt;在 Vite 中查看当前支持的浏览器版本列表&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;终端&lt;/strong&gt; - Astro 通过其命令行界面（CLI）访问。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;先让-ai-code-帮你搭一版骨架&quot;&gt;先让 AI Code 帮你搭一版骨架&lt;/h2&gt;
&lt;p&gt;当你已经确定了需求和技术路线，其实可以把 AI 当成“脚手架助手”，先让它帮你搭一个能跑起来的版本。&lt;br&gt;
我自己的习惯是：先让 AI 快速出一版，再人工做第二轮收敛。这样做效率会高很多，也更不容易卡在第一步。&lt;/p&gt;
&lt;h3 id=&quot;一套我自己会用的提示词可直接复制&quot;&gt;一套我自己会用的提示词（可直接复制）&lt;/h3&gt;
&lt;p&gt;你可以把下面这段贴给 AI（ChatGPT、Codex、Cursor 都可以）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;你是一个资深前端工程师，请帮我从 0 到 1 搭建一个 Astro 个人博客项目。&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;我的目标：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) 技术栈：Astro + Tailwind CSS&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) 文章：Markdown 写作&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) 部署：GitHub Pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) 要求：适合新手维护，目录结构清晰，样式简洁克制&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;请按下面方式输出：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) 先给我项目目录结构（树形）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) 再给我需要执行的命令（按顺序）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) 再给我每个关键文件的完整内容（astro.config.mjs、package.json、基础页面、博客内容目录）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) 每一步都注明“为什么要这样做”&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;5) 最后给我一份排错清单（常见报错 + 解决办法）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;约束：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- 不要跳步&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- 不要省略关键配置&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- 所有命令可直接复制&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- 优先给稳定方案，不要花哨技巧&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;第二轮提示词让-ai-改而不是重写&quot;&gt;第二轮提示词（让 AI 改，而不是重写）&lt;/h3&gt;
&lt;p&gt;第一版跑起来后，你再给 AI 这个指令：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;下面是我当前项目状态，请你只在现有结构上增量修改，不要推翻重来。&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;目标：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) 保持现有路由不变&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) 优化首页排版和博客列表样式&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) 增加 tags 页面&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) 确保 npm run build 通过&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;输出要求：&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) 只给“需要修改的文件”&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) 每个文件给最小改动 diff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) 改动后附上验证命令&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这类“增量修改”提示词很关键，不然 AI 很容易把你已经写好的内容一锅端掉。
举个例子，这就是我确定好需求后直接让codex帮我大体改出来的效果。很适合项目起步，后续如果您调试的时候自己没头绪，也可以让ai写一份专业的提示词，这样比你说这个东西应该在那个东西的左边右边更加合理，毕竟aicode他看不见嘛，他是个很聪明的盲人。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step2.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;安装&quot;&gt;安装&lt;/h2&gt;
&lt;h3 id=&quot;安装nodejswindows安装&quot;&gt;安装node.js（Windows安装）&lt;/h3&gt;
&lt;p&gt;Node.js 安装包及源码下载地址为：&lt;a href=&quot;https://nodejs.org/en/download%E3%80%82&quot;&gt;https://nodejs.org/en/download。&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;最简单的办法，点开网址，然后点击按钮&lt;a href=&quot;https://nodejs.org/dist/v24.13.1/node-v24.13.1-win-x64.zip&quot;&gt;Windows Installer(.msi)&lt;/a&gt;，当然我也给你做好了超链接，你点一下能下载了。&lt;/p&gt;
&lt;h4 id=&quot;安装步骤&quot;&gt;安装步骤&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;双击安装包&lt;/li&gt;
&lt;li&gt;点击以上的 Next 按钮&lt;/li&gt;
&lt;li&gt;勾选接受协议选项，点击 Next 按钮 :&lt;/li&gt;
&lt;li&gt;Node.js默认安装目录为 “C:\Program Files\nodejs” , 你可以修改目录，并点击 Next 按钮：&lt;/li&gt;
&lt;li&gt;点击 Install（安装） 开始安装 Node.js，你也可以点击 Back（返回）来修改先前的配置：&lt;/li&gt;
&lt;li&gt;安装完后点击 Finish（完成）按钮退出安装向导。&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-tip&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;tip&lt;/p&gt;
&lt;p&gt;安装完成后，我们可以在命令行或 Windows Powershell 中执行以下命令来测试。这是输出node版本号的命令，如果正常输出，则表示安装成功。&lt;/p&gt;
&lt;p&gt;至于命令行怎么调用出来，最简单的就是Win+R，然后输入cmd，回车。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;node -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm -v&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#example&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;C:\Users\Dan&gt;node -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;v24.13.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;如果你遇到网络问题下载慢--安装依赖超时&quot;&gt;如果你遇到网络问题（下载慢 / 安装依赖超时）&lt;/h4&gt;
&lt;p&gt;很多新手第一次卡住都在这里，不是你操作错了，通常是网络到 npm 官方源太慢。&lt;br&gt;
可以先把 npm 源切到国内镜像，再继续安装依赖：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 查看当前源&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; get&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 切换到国内镜像（npmmirror）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://registry.npmmirror.com&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 再确认一下&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; get&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后再执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果你后面想切回官方源，也很简单：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://registry.npmjs.org&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;安装vs-code&quot;&gt;安装Vs Code&lt;/h3&gt;
&lt;p&gt;你可以直接去官网下载安装（推荐 Stable 版本）：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;简版步骤（Windows）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开官网，点击 &lt;code&gt;Download for Windows&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;双击安装包，基本一路 &lt;code&gt;Next&lt;/code&gt; 就行。&lt;/li&gt;
&lt;li&gt;建议勾选这几个选项：&lt;br&gt;
&lt;code&gt;Add &quot;Open with Code&quot;&lt;/code&gt;、&lt;code&gt;Add to PATH&lt;/code&gt;、&lt;code&gt;Register Code as an editor&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;安装完成后，打开 VS Code，&lt;code&gt;File -&gt; Open Folder&lt;/code&gt; 选择你的博客项目目录。&lt;/li&gt;
&lt;li&gt;打开终端（&lt;code&gt;Ctrl + ~&lt;/code&gt;），执行：&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;node -v&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;能看到版本号就说明开发环境已经通了。&lt;/p&gt;
&lt;p&gt;我自己常用的扩展（够用版）：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Astro&lt;/code&gt;（官方语法支持）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Tailwind CSS IntelliSense&lt;/code&gt;（Tailwind 类名提示）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Markdown All in One&lt;/code&gt;（写 Markdown 更顺手）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果您对上手编程感兴趣，我会在日后更新的文章《如何上手编程》中详细说明更多。&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;安装astro&quot;&gt;安装Astro&lt;/h3&gt;
&lt;p&gt;我这边还是建议提供&lt;strong&gt;通过 CLI 向导安装&lt;/strong&gt;，&lt;/p&gt;
&lt;p&gt;1.在终端运行以下命令，首先我建议你选好文件夹，我的话是&lt;strong&gt;F:\project\Blog&lt;/strong&gt;，你在文件资源管理器里打开至当前文件夹，然后点击搜索左边的路径，然后输出cmd，回车。安装下面的步骤来，您可以按照格式输入您的项目名称，选择&lt;strong&gt;Use blog template&lt;/strong&gt;。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# 使用 npm 创建一个新项目&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm create astro@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step1.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;p&gt;2.项目创建好后，也就是当你的可以输入了，例如出现了例如，这边有个光标一直在闪&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;C:\Users\Dan&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3.接下来你cd进你的项目，例如我的项目文件夹叫做astro-blog，所以我在命令行内输入。cd进入对应文件夹后就安装依赖就行了，大概率不需要换源，既然您能看到我的博客网站了，那您的网络环境应该是满足条件的。&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;F:\project\Blog&gt;cd astro-blog&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;F:\project\Blog\astro-blog&gt;npm install&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;到这里其实本地就能跑起来了，你可以先试一下：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm run dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;浏览器打开 &lt;code&gt;http://localhost:4321/&lt;/code&gt;，看到页面正常就可以进入下一步了。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;部署到-github-pages&quot;&gt;部署到 GitHub Pages&lt;/h2&gt;
&lt;h3 id=&quot;先准备账号和工具新手建议按顺序来&quot;&gt;先准备账号和工具（新手建议按顺序来）&lt;/h3&gt;
&lt;h4 id=&quot;1-注册-github-账号&quot;&gt;1. 注册 GitHub 账号&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;打开 &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;。&lt;/li&gt;
&lt;li&gt;点击右上角 &lt;code&gt;Sign up&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;输入邮箱、密码和用户名（用户名后面会出现在你的博客网址里）。&lt;/li&gt;
&lt;li&gt;按提示做人机验证，完成邮箱验证。&lt;/li&gt;
&lt;li&gt;登录后先记住你的用户名，后面要填到仓库地址和 &lt;code&gt;site&lt;/code&gt; 配置里。&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-tip&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;tip&lt;/p&gt;
&lt;p&gt;如果你后面想长期维护项目，建议在 &lt;code&gt;Settings&lt;/code&gt; 里把 2FA（两步验证）开一下，账号更安全。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;2-安装-gitwindows&quot;&gt;2. 安装 Git（Windows）&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;打开官网 &lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;https://git-scm.com/downloads&lt;/a&gt; 下载 Windows 安装包。&lt;/li&gt;
&lt;li&gt;双击安装，绝大多数选项保持默认即可，一路 &lt;code&gt;Next&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;安装完成后，打开 &lt;code&gt;cmd&lt;/code&gt; 或 PowerShell，执行：&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看到版本号就说明安装成功。然后配置你的身份信息（只需配置一次）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git config --global user.name &quot;你的名字&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git config --global user.email &quot;你的邮箱&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-安装-github-desktop可选但对新手非常友好&quot;&gt;3. 安装 GitHub Desktop（可选，但对新手非常友好）&lt;/h4&gt;
&lt;p&gt;如果你不想一上来就记太多命令，GitHub Desktop 是个很好的过渡工具。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;下载并安装：&lt;a href=&quot;https://desktop.github.com/&quot;&gt;https://desktop.github.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;打开后登录你的 GitHub 账号。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;File&lt;/code&gt; -&gt; &lt;code&gt;Add local repository...&lt;/code&gt;，选择你的项目目录。&lt;/li&gt;
&lt;li&gt;修改代码后，在左侧看变更，填 &lt;code&gt;Summary&lt;/code&gt;，点击 &lt;code&gt;Commit to main&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点击右上角 &lt;code&gt;Push origin&lt;/code&gt;，把提交推送到 GitHub。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我自己日常还是命令行为主，但给刚入门的同学，我通常先推荐 Desktop，心理负担会小很多。坐上轮椅是对的，你想你不应该有什么心里负担，又没人会说你 skill issue这类的话，提升效率是第一原则，你应该专心commit，然后push，怎么方便怎么来。&lt;/p&gt;
&lt;h3 id=&quot;初始化仓库并首次推送cli--desktop-二选一&quot;&gt;初始化仓库并首次推送（CLI / Desktop 二选一）&lt;/h3&gt;
&lt;p&gt;如果你是第一次做这个项目，可以按下面这套来（已经有仓库的就跳过）：&lt;/p&gt;
&lt;p&gt;先在 GitHub 网页里创建一个空仓库，然后把仓库地址替换到下面命令里。&lt;/p&gt;
&lt;h4 id=&quot;方案a命令行cli&quot;&gt;方案A：命令行（CLI）&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git init&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git add .&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git commit -m &quot;init astro blog&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git branch -M main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git remote add origin https://github.com/&amp;#x3C;你的GitHub用户名&gt;/&amp;#x3C;你的仓库名&gt;.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git push -u origin main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;方案bgithub-desktop图形界面&quot;&gt;方案B：GitHub Desktop（图形界面）&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;在 GitHub Desktop 里 &lt;code&gt;Add local repository&lt;/code&gt; 选择你的项目目录。&lt;/li&gt;
&lt;li&gt;首次提交填一个说明，例如 &lt;code&gt;init astro blog&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;点击 &lt;code&gt;Publish repository&lt;/code&gt;，输入仓库名并发布到 GitHub。&lt;/li&gt;
&lt;li&gt;以后每次更新就是 &lt;code&gt;Commit&lt;/code&gt; + &lt;code&gt;Push origin&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;我自己的建议是仓库名尽量简单一点，全小写，后续配置 &lt;code&gt;base&lt;/code&gt; 的时候不容易输错。
&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step4.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;参考我的博客项目先-clone-再改成你自己的&quot;&gt;参考我的博客项目：先 clone 再改成你自己的&lt;/h3&gt;
&lt;p&gt;如果你是想直接参考我这套项目结构来学习，最快方式就是先把我的仓库 clone 到本地：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git clone https://github.com/Dancncn/DansBlog.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;cd DansBlog&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;npm run dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;本地跑起来后，你会在 &lt;code&gt;http://localhost:4321/&lt;/code&gt; 看到完整博客。&lt;/p&gt;
&lt;p&gt;项目地址也放在这里，方便你直接点开：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/Dancncn/DansBlog&quot;&gt;https://github.com/Dancncn/DansBlog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;如果这篇教程或这个项目对你有帮助，欢迎顺手点个 &lt;code&gt;Star&lt;/code&gt;，这对我真的很有鼓励作用。&lt;/p&gt;
&lt;p&gt;接着你要把它改成你自己的仓库，流程如下：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在你自己的 GitHub 账号下新建一个空仓库（例如 &lt;code&gt;my-blog&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;修改 &lt;code&gt;astro.config.mjs&lt;/code&gt; 里的这两项：&lt;br&gt;
&lt;code&gt;site: &apos;https://&amp;#x3C;你的用户名&gt;.github.io&apos;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;base: &apos;/&amp;#x3C;你的仓库名&gt;/&apos;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把远程地址改成你自己的：&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git remote set-url origin https://github.com/&amp;#x3C;你的用户名&gt;/&amp;#x3C;你的仓库名&gt;.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;git push -u origin main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;到 GitHub 仓库 &lt;code&gt;Settings -&gt; Pages&lt;/code&gt;，把 Source 设为 &lt;code&gt;GitHub Actions&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;等待 Actions 跑完，你就可以通过：
&lt;code&gt;https://&amp;#x3C;你的用户名&gt;.github.io/&amp;#x3C;你的仓库名&gt;/&lt;/code&gt; 访问到你自己的博客。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;配置-astro-的-site-和-base这一步很关键&quot;&gt;配置 Astro 的 site 和 base（这一步很关键）&lt;/h3&gt;
&lt;p&gt;如果你部署的是项目仓库（例如 &lt;code&gt;https://&amp;#x3C;用户名&gt;.github.io/&amp;#x3C;仓库名&gt;/&lt;/code&gt;），Astro 里一定要配 &lt;code&gt;base&lt;/code&gt;，不然静态资源路径很容易 404。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;astro.config.mjs&lt;/code&gt; 可以像这样：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; REPO_BASE&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&amp;#x3C;你的仓库名&gt;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; defineConfig&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  site: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;https://&amp;#x3C;你的GitHub用户名&gt;.github.io&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  base: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;REPO_BASE&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  trailingSlash: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;always&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  output: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;static&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果你用的是用户主页仓库（仓库名就是 &lt;code&gt;&amp;#x3C;用户名&gt;.github.io&lt;/code&gt;），那通常 &lt;code&gt;base&lt;/code&gt; 可以写 &lt;code&gt;/&lt;/code&gt;。&lt;/p&gt;
&lt;h3 id=&quot;用-github-actions-自动部署&quot;&gt;用 GitHub Actions 自动部署&lt;/h3&gt;
&lt;p&gt;我个人比较喜欢自动化，push 一次就发布一次，省心很多。&lt;br&gt;
在项目里新建文件：&lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;Deploy to GitHub Pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  push&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    branches&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  workflow_dispatch&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;permissions&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  contents&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;read&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  pages&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  id-token&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;concurrency&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  group&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  cancel-in-progress&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  build&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    runs-on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    steps&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/checkout@v4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/setup-node@v4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        with&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          node-version&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;20&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          cache&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/configure-pages@v5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm ci&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/upload-pages-artifact@v3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        with&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          path&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;./dist&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  deploy&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    needs&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    runs-on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    environment&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;      name&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;github-pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;      url&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;${{ steps.deployment.outputs.page_url }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    steps&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/deploy-pages@v4&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你如果是直接用 Astro 的 blog 模板，很多时候这份文件本来就有，可以先看一眼再决定要不要改。&lt;/p&gt;
&lt;h3 id=&quot;打开-github-pages&quot;&gt;打开 GitHub Pages&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;进入你的仓库，点击 &lt;code&gt;Settings&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;左侧找到 &lt;code&gt;Pages&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Source&lt;/code&gt; 选择 &lt;code&gt;GitHub Actions&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;回到 &lt;code&gt;Actions&lt;/code&gt; 页面等工作流跑完。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;跑完后一般就能在下面这个地址看到你的网站：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step3.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;https://&amp;#x3C;你的GitHub用户名&gt;.github.io/&amp;#x3C;你的仓库名&gt;/&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;我自己踩过的几个坑&quot;&gt;我自己踩过的几个坑&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;页面能打开，但 CSS 全丢了：&lt;code&gt;base&lt;/code&gt; 配错了。&lt;/li&gt;
&lt;li&gt;图片 404：Markdown 里图片路径写错，尽量用相对路径。&lt;/li&gt;
&lt;li&gt;Action 失败：看日志通常就是依赖没装好或者 Node 版本不对。&lt;/li&gt;
&lt;li&gt;刚部署访问 404：等 1-2 分钟，GitHub Pages 有时候会慢一点。&lt;/li&gt;
&lt;li&gt;代码推上去了但页面没更新：你可能推到了别的分支，不是 &lt;code&gt;main&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;本地能跑，线上白屏：&lt;code&gt;site&lt;/code&gt; 和 &lt;code&gt;base&lt;/code&gt; 组合不对，静态资源路径全偏了。&lt;/li&gt;
&lt;li&gt;用中文路径或带空格路径建项目：某些脚本在 Windows 下容易出玄学问题，建议英文目录。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install&lt;/code&gt; 很慢甚至卡死：先检查网络，再考虑换镜像源，不要一上来就怀疑项目坏了。&lt;/li&gt;
&lt;li&gt;改完配置忘记重启 dev server：有些配置（比如 &lt;code&gt;astro.config.mjs&lt;/code&gt;）必须重启才生效。&lt;/li&gt;
&lt;li&gt;图片文件名随手改大小写：Windows 不敏感、GitHub Pages（Linux）敏感，最后线上 404。&lt;/li&gt;
&lt;li&gt;直接在 GitHub 网页端乱改配置文件：很容易和本地冲突，最好本地改完再统一 push。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;部署到-cloudflare-pages推荐更强-cdn--更少运维&quot;&gt;部署到 Cloudflare Pages（推荐：更强 CDN + 更少运维）&lt;/h2&gt;
&lt;p&gt;如果你已经把 GitHub Pages 跑通了，这一节可以看成“同一个 Astro 项目，换一条更省心的发布链路”。我自己后来长期用下来，Cloudflare Pages 在部署体验和可维护性上都更顺手。&lt;/p&gt;
&lt;h3 id=&quot;为什么考虑-cloudflare-pages对比-github-pages&quot;&gt;为什么考虑 Cloudflare Pages（对比 GitHub Pages）&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;全球 CDN：静态资源分发节点更多，国际访问通常更稳。&lt;/li&gt;
&lt;li&gt;自动 HTTPS：默认证书和 TLS 配置都省掉了。&lt;/li&gt;
&lt;li&gt;自动构建部署：连好仓库后，每次 push 自动构建上线。&lt;/li&gt;
&lt;li&gt;性能与安全：缓存、压缩、基础安全策略都比较完善。&lt;/li&gt;
&lt;li&gt;未来可扩展：后面要接 Functions/Workers，或者用 D1/KV/R2，也能在同一生态里继续长。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;对可访问性这件事我说结论：国际访问通常会显著更好；中国大陆地区通常也比 GitHub Pages 更“可用”，但它不是“国内 CDN 同等级稳定性”的承诺，这两件事要分开看。&lt;/p&gt;
&lt;h3 id=&quot;从-0-开始部署步骤注册到上线&quot;&gt;从 0 开始部署步骤（注册到上线）&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;注册并登录 Cloudflare，进入 Dashboard。&lt;/li&gt;
&lt;li&gt;在左侧菜单进入 &lt;code&gt;Workers &amp;#x26; Pages&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;选择 &lt;code&gt;Pages&lt;/code&gt;。如果你看到新版界面，入口可能在 &lt;code&gt;Looking to deploy Pages? Get started&lt;/code&gt; 这类提示里。&lt;/li&gt;
&lt;li&gt;点击 &lt;code&gt;Import an existing Git repository&lt;/code&gt;，按提示连接 GitHub，授权后选择你的博客仓库。&lt;/li&gt;
&lt;li&gt;在 Build settings 里填这四个关键项：
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Framework preset&lt;/code&gt;: &lt;code&gt;Astro&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Build command&lt;/code&gt;: &lt;code&gt;npm run build&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Build output directory&lt;/code&gt;: &lt;code&gt;dist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Production branch&lt;/code&gt;: &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;点击部署，等构建完成后先用 &lt;code&gt;xxx.pages.dev&lt;/code&gt; 域名访问。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;第一次部署建议先别急着绑定自定义域名，先把默认域名验收跑通，排错成本最低。对于域名购买以及配置教程，请参考&lt;a href=&quot;https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-cn/&quot;&gt;如何注册一个cloudflare域名&lt;/a&gt;，附带视频教程。&lt;/p&gt;
&lt;h3 id=&quot;必踩坑base-路径导致样式丢失以及如何修&quot;&gt;必踩坑：base 路径导致样式丢失（以及如何修）&lt;/h3&gt;
&lt;p&gt;最常见现象是：页面能打开，但样式全没了，像一页蓝色链接的纯 HTML。根因通常是你之前给 GitHub Pages 写死了 &lt;code&gt;base: &apos;/DansBlog/&apos;&lt;/code&gt;，Cloudflare 继续用这套路径后，资源地址就错了。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;astro.config.mjs&lt;/code&gt; 推荐改成按环境自动切换：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { defineConfig } &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;astro/config&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; isCfPages&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; process.env.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;1&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; isGithubProd&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;isCfPages &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; process.env.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;production&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; base&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; isCfPages &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; isGithubProd &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/DansBlog/&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; defineConfig&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  site: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;https://your-domain-or-pages-domain&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  base,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  trailingSlash: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;always&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  output: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;static&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这段配置对应的行为是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cloudflare 构建（&lt;code&gt;CF_PAGES=1&lt;/code&gt;）：&lt;code&gt;base = &apos;/&apos;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;GitHub Pages 生产构建：&lt;code&gt;base = &apos;/DansBlog/&apos;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;本地 &lt;code&gt;npm run dev&lt;/code&gt;：&lt;code&gt;base = &apos;/&apos;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;再补一个习惯：页面里尽量不要写死 &lt;code&gt;&quot;/DansBlog&quot;&lt;/code&gt; 这类前缀，优先用 &lt;code&gt;import.meta.env.BASE_URL&lt;/code&gt; 或相对路径，不然后面平台一换就炸。&lt;/p&gt;
&lt;h3 id=&quot;验收方法本地模拟--线上检查&quot;&gt;验收方法（本地模拟 + 线上检查）&lt;/h3&gt;
&lt;p&gt;先在本地模拟 Cloudflare 构建（Windows CMD）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npx astro preview&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后访问本地预览地址，检查首页和文章页是否正常加载样式。&lt;/p&gt;
&lt;p&gt;可选：再模拟 GitHub Pages 生产构建（Windows CMD）：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;production&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npx astro preview&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后用 &lt;code&gt;http://localhost:4321/DansBlog/&lt;/code&gt; 这类路径做一次回归检查，确认两边都兼容。（PowerShell 可用 &lt;code&gt;$env:CF_PAGES=&apos;1&apos;&lt;/code&gt; 这种写法，但这里默认按 CMD 流程走。）&lt;/p&gt;
&lt;p&gt;线上验收（&lt;code&gt;pages.dev&lt;/code&gt;）我会做这几步：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;打开首页、文章页、标签页、分页页。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;F12&lt;/code&gt; 打开 DevTools，在 Network 里过滤 &lt;code&gt;404&lt;/code&gt;，结果应为 &lt;code&gt;0&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;View page source&lt;/code&gt; 搜索 &lt;code&gt;&quot;/DansBlog&quot;&lt;/code&gt;，Cloudflare 版本里不应该出现。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;pagesdev-默认域名与自定义域名&quot;&gt;pages.dev 默认域名与自定义域名&lt;/h3&gt;
&lt;p&gt;Cloudflare Pages 会给你一个默认免费域名（&lt;code&gt;xxx.pages.dev&lt;/code&gt;），这个可以直接用来上线和验收。项目名改变后，子域名前缀通常也会跟着变化。&lt;/p&gt;
&lt;p&gt;如果你想用自己的域名，结论也很直接：通常需要先有自己的域名，然后在 Pages 项目里绑定自定义域名。DNS 细节这里不展开，但流程上就是“先买域名，再在 Pages 里绑定”。&lt;/p&gt;
&lt;h3 id=&quot;面向大陆与国际用户的可达性建议务实&quot;&gt;面向大陆与国际用户的可达性建议（务实）&lt;/h3&gt;
&lt;p&gt;这块我不说大话，直接给实操建议：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;国际访问：Cloudflare Pages 通常明显优于 GitHub Pages。&lt;/li&gt;
&lt;li&gt;大陆访问：通常会比 GitHub Pages 更可用，但它不等同于国内商业 CDN 的稳定性上限。&lt;/li&gt;
&lt;li&gt;字体、图片、脚本尽量自托管，减少第三方外链（尤其 Google Fonts 这类跨境依赖）。&lt;/li&gt;
&lt;li&gt;静态资源配合 hash 文件名做强缓存，让重复访问更快。&lt;/li&gt;
&lt;li&gt;图片优先走你自己的站点资源；如果后面有对象存储需求，可以考虑接 R2。&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;小结&quot;&gt;小结&lt;/h2&gt;
&lt;p&gt;到这一步其实你已经完成了一套很实用的流程：本地写作 -&gt; &lt;code&gt;git push&lt;/code&gt; -&gt; GitHub 自动构建并发布。&lt;br&gt;
后面你要做的就是持续写内容，然后慢慢把样式打磨成你喜欢的样子。&lt;br&gt;
技术是骨架，内容才是灵魂。先让它跑起来，再让它变好看。&lt;/p&gt;
&lt;p&gt;我希望您可以没有心理负担，可以尝试使用aicode来协助您的工作，这对您的工作效率大大的提升，比方说本站我第一天只用了4小时就实现了基本的Home，blog，about页面可以拿来展示了，第二第三天则是花费一些时间进行精修和移动端适配。但不要忘了自己做博客网站的初心，一切目的以实现博客正常发布阅读功能为主，增加其他花样功能则是自己的情趣，愿不愿意在下面折腾时看你自己。&lt;/p&gt;</content:encoded><category>Astro</category><category>blog</category><category>github-pages</category><category>guide</category><category>CN</category></item><item><title>How to Build a Personal Blog Website</title><link>https://danarnoux.com/blog/how-to-build-a-personal-blog-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/how-to-build-a-personal-blog-en/</guid><description>Build a personal blog with Astro and Tailwind CSS, without dealing with your own server and domain setup from day one.</description><pubDate>Thu, 12 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;preface&quot;&gt;Preface&lt;/h2&gt;
&lt;p&gt;When I realized I was remembering less and less of my technical ideas, I started writing things down in my phone notes during sleepless nights. But phone notes are limited, and I could not access everything smoothly across devices.&lt;/p&gt;
&lt;p&gt;In January this year, during another late night, I thought: if I get some time, I should build a personal blog. I want to write down meaningful things for myself, for students I have taught, and maybe for students I will teach in the future.&lt;/p&gt;
&lt;p&gt;The problem was: I was very busy. I had just returned from a business trip in Jiangsu. One night, still unable to sleep, I remembered this plan again. It was already very late, so I did not want to disturb friends who had built blogs before. I guessed the whole thing might take around a week.&lt;/p&gt;
&lt;p&gt;The next morning, I asked my high school friend Herbert Skyper. His answer: around one week too. He hand-built his version with Vue (no mature blog framework, mostly for frontend fun). When I visited him later, we talked more. Domain cost is usually not expensive per year, but server/public IP/stability are often the annoying parts.&lt;/p&gt;
&lt;p&gt;One of the biggest headaches of running a website is exactly this: domain name, reliable always-on machine (or server), public network accessibility, and so on. There are ways to solve all of these, but if you can avoid extra operations in the early stage, that is usually better.&lt;/p&gt;
&lt;p&gt;Skyper mentioned some classmates using &lt;a href=&quot;https://docs.astro.build/&quot;&gt;Astro&lt;/a&gt;, which is a mature framework. Later my friend kymi replied too; he writes with &lt;a href=&quot;https://hexo.io/&quot;&gt;Hexo&lt;/a&gt; and has a related tutorial: &lt;a href=&quot;https://licyk.github.io/2024/06/26/how-to-deploy-hexo/&quot;&gt;How to Deploy a Blog with Hexo&lt;/a&gt;. He also said deployment on GitHub is not too time-consuming, and it avoids server/domain costs at the start.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;requirements-analysis&quot;&gt;Requirements Analysis&lt;/h2&gt;
&lt;h3 id=&quot;what-exactly-do-i-need&quot;&gt;What exactly do I need?&lt;/h3&gt;
&lt;p&gt;I need something like a “pro memo” that I can read anytime, and others can read too, without costing too much time or money.&lt;/p&gt;
&lt;p&gt;Content comes first, but I also want a little personality in the design. Something simple, rational, and restrained, but still gentle, with small colorful details that can make people smile.&lt;/p&gt;
&lt;h3 id=&quot;technical-route&quot;&gt;Technical Route&lt;/h3&gt;
&lt;p&gt;So why did I choose Astro?&lt;/p&gt;
&lt;p&gt;I compared several blog frameworks first: their pros, cons, and which one fits me best. Since I have used ChatGPT for years, it has a decent idea of my technical level, and I organized its suggestions into the table below.&lt;/p&gt;
&lt;h4 id=&quot;blog-framework-comparison&quot;&gt;Blog Framework Comparison&lt;/h4&gt;


















































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Framework&lt;/th&gt;&lt;th&gt;Tech Stack&lt;/th&gt;&lt;th&gt;Build Speed&lt;/th&gt;&lt;th&gt;Writing Experience&lt;/th&gt;&lt;th&gt;Component/Interaction Power&lt;/th&gt;&lt;th&gt;Extensibility&lt;/th&gt;&lt;th&gt;GitHub Pages Fit&lt;/th&gt;&lt;th&gt;Best For&lt;/th&gt;&lt;th&gt;Common Pitfalls&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Hexo&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Node.js&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Easy to start, many themes&lt;/td&gt;&lt;td&gt;Weaker (template-centric)&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Mature and stable&lt;/td&gt;&lt;td&gt;Pure writing, Chinese ecosystem&lt;/td&gt;&lt;td&gt;Node dependencies may be annoying&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Hugo&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Go&lt;/td&gt;&lt;td&gt;Very fast&lt;/td&gt;&lt;td&gt;Clear structure&lt;/td&gt;&lt;td&gt;Moderate (content-driven)&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Very stable&lt;/td&gt;&lt;td&gt;Speed-focused, low maintenance&lt;/td&gt;&lt;td&gt;Theme config can feel too engineering-ish&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Astro&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Modern frontend (React/Vue/Svelte)&lt;/td&gt;&lt;td&gt;Fast&lt;/td&gt;&lt;td&gt;Great Markdown/MDX experience&lt;/td&gt;&lt;td&gt;Strong (component mixing)&lt;/td&gt;&lt;td&gt;Strong&lt;/td&gt;&lt;td&gt;Need to handle &lt;code&gt;base&lt;/code&gt; carefully&lt;/td&gt;&lt;td&gt;Frontend developers&lt;/td&gt;&lt;td&gt;High freedom means more decisions&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Next.js / Nuxt&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;React / Vue full-stack&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Good&lt;/td&gt;&lt;td&gt;Very strong&lt;/td&gt;&lt;td&gt;Very strong&lt;/td&gt;&lt;td&gt;Static export needs prefix care&lt;/td&gt;&lt;td&gt;People planning larger platforms&lt;/td&gt;&lt;td&gt;Slightly heavy for pure blogs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;VitePress / Docusaurus&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Vite / React&lt;/td&gt;&lt;td&gt;Fast&lt;/td&gt;&lt;td&gt;Excellent for documentation&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Very stable&lt;/td&gt;&lt;td&gt;Technical docs-style content&lt;/td&gt;&lt;td&gt;Less “blog vibe”&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Jekyll&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Ruby&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Traditional Markdown&lt;/td&gt;&lt;td&gt;Weaker&lt;/td&gt;&lt;td&gt;Medium&lt;/td&gt;&lt;td&gt;Native support&lt;/td&gt;&lt;td&gt;Minimal deployment overhead seekers&lt;/td&gt;&lt;td&gt;Less modern by today’s standards&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 id=&quot;decision-oriented-summary&quot;&gt;Decision-Oriented Summary&lt;/h4&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Requirement Type&lt;/th&gt;&lt;th&gt;Recommended Option&lt;/th&gt;&lt;th&gt;Why&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Pure writing, mature theme ecosystem&lt;/td&gt;&lt;td&gt;Hexo / Hugo&lt;/td&gt;&lt;td&gt;Classic and stable&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Lots of technical posts, fastest builds&lt;/td&gt;&lt;td&gt;Hugo&lt;/td&gt;&lt;td&gt;Extremely fast build speed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Blog + project showcase + interactions&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Astro&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Markdown + components is very strong&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Might evolve into personal platform&lt;/td&gt;&lt;td&gt;Next.js / Nuxt&lt;/td&gt;&lt;td&gt;Strong full-stack capability&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;More documentation-oriented&lt;/td&gt;&lt;td&gt;VitePress / Docusaurus&lt;/td&gt;&lt;td&gt;Great structure and TOC management&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;ChatGPT told me Astro’s flexibility can feel like a pitfall because you need to make more choices yourself. For me, that is actually an advantage: I can choose the components and style I like.&lt;/p&gt;
&lt;p&gt;At first I considered Cloudflare. But once I decided to push the project to GitHub anyway, GitHub Pages became super convenient: configure once, then update via &lt;code&gt;push&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&quot;deployment-cost-snapshot&quot;&gt;Deployment Cost Snapshot&lt;/h4&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Item&lt;/th&gt;&lt;th&gt;Reality&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Server cost&lt;/td&gt;&lt;td&gt;Usually 0 with GitHub Pages / Cloudflare Pages / Vercel&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Domain cost&lt;/td&gt;&lt;td&gt;&lt;code&gt;username.github.io&lt;/code&gt; is free; custom domains usually cost money&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Maintenance overhead&lt;/td&gt;&lt;td&gt;Almost 0 for static sites&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Astro supports modern frontend component ecosystems, so which components should you choose?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your technical route shapes your blog’s personality and tone.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One key mindset correction first&lt;/strong&gt;: this is Astro’s strength, not a limitation.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Astro is not “a Vue-based blog framework”. It is:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;Astro = static-site framework + optional Vue components when needed&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ChatGPT recommended &lt;a href=&quot;https://tailwindcss.com/plus/ui-blocks/marketing&quot;&gt;Tailwind CSS&lt;/a&gt; and suggested a style that is timeless, professional, and easy to live with in the long term. I agree.&lt;/p&gt;
&lt;p&gt;At this stage, I still prefer introducing only a small number of components to avoid complexity.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Less is more.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h4 id=&quot;development-environment&quot;&gt;Development Environment&lt;/h4&gt;
&lt;p&gt;I use &lt;strong&gt;VS Code&lt;/strong&gt; as my text editor, and I installed the Astro extension.&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-note&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;note&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt; - &lt;code&gt;v18.20.8&lt;/code&gt;, &lt;code&gt;v20.3.0&lt;/code&gt;, &lt;code&gt;v22.0.0&lt;/code&gt;, or higher (&lt;code&gt;v19&lt;/code&gt; and &lt;code&gt;v21&lt;/code&gt; are not supported).&lt;/p&gt;
&lt;p&gt;Astro is built with Vite. Vite targets modern JavaScript browsers by default. See the browser support list in Vite docs: &lt;a href=&quot;https://cn.vite.dev/guide/build#browser-compatibility&quot;&gt;Browser Compatibility&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Terminal&lt;/strong&gt; - Astro is operated via CLI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;let-ai-code-build-the-first-skeleton-for-you&quot;&gt;Let AI Code Build the First Skeleton for You&lt;/h2&gt;
&lt;p&gt;Once your requirements and technical direction are clear, you can treat AI as a “scaffolding assistant” and let it create a runnable version first.&lt;/p&gt;
&lt;p&gt;My habit is simple: let AI produce a quick first draft, then do a second refinement pass manually. This is much more efficient and helps you avoid getting stuck at step one.&lt;/p&gt;
&lt;h3 id=&quot;prompt-set-i-actually-use-copy-paste-ready&quot;&gt;Prompt Set I Actually Use (Copy-Paste Ready)&lt;/h3&gt;
&lt;p&gt;You can paste this to AI tools like ChatGPT, Codex, or Cursor:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;You are a senior frontend engineer. Help me build an Astro personal blog project from 0 to 1.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Goals:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) Tech stack: Astro + Tailwind CSS&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) Content: Markdown-based writing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) Deployment: GitHub Pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) Requirements: beginner-friendly maintenance, clear project structure, clean and restrained style&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Output format:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) First, provide the project directory tree&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) Then provide commands to run (in order)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) Then provide full content for key files (astro.config.mjs, package.json, basic pages, blog content dirs)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) Explain &quot;why&quot; for every step&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;5) Finally provide a troubleshooting checklist (common errors + fixes)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Constraints:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Do not skip steps&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Do not omit key configurations&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- All commands must be directly runnable&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Prioritize stable solutions over fancy tricks&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;second-round-prompt-ask-ai-to-improve-not-rewrite&quot;&gt;Second-Round Prompt (Ask AI to Improve, Not Rewrite)&lt;/h3&gt;
&lt;p&gt;After the first version runs, give AI this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;This is my current project state. Please make incremental changes on top of the existing structure. Do not rewrite from scratch.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Goals:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) Keep existing routes unchanged&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) Improve homepage layout and blog list style&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) Add tags page&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4) Ensure npm run build passes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Output requirements:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1) Only list files that need modification&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2) For each file, provide minimal diff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3) Include verification commands after changes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This “incremental modification” style prompt is important. Otherwise AI may accidentally replace things you already wrote.&lt;/p&gt;
&lt;p&gt;For example, this is the kind of effect I got when I locked requirements and asked Codex to scaffold it. It is great for getting started. If you feel stuck during debugging, ask AI to help write a precise prompt first. It is often more effective than saying “move this thing a bit left/right.” AI code assistants are smart, but they cannot see your screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step2.png&quot; alt=&quot;step2&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;
&lt;h3 id=&quot;install-nodejs-windows&quot;&gt;Install Node.js (Windows)&lt;/h3&gt;
&lt;p&gt;Node.js download page:
&lt;a href=&quot;https://nodejs.org/en/download&quot;&gt;https://nodejs.org/en/download&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The simplest way is opening that page and clicking &lt;strong&gt;Windows Installer (.msi)&lt;/strong&gt;.&lt;/p&gt;
&lt;h4 id=&quot;steps&quot;&gt;Steps&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Double-click the installer.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Next&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Accept the license and click &lt;code&gt;Next&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Default path is usually &lt;code&gt;C:\Program Files\nodejs\&lt;/code&gt; (you can change it).&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Install&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Finish&lt;/code&gt; when done.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-tip&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;tip&lt;/p&gt;
&lt;p&gt;After installation, test Node/NPM in &lt;code&gt;cmd&lt;/code&gt; or PowerShell.
The fastest way to open &lt;code&gt;cmd&lt;/code&gt;: &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;cmd&lt;/code&gt;, press Enter.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;node&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -v&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# example&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;C:\Users\Dan&gt;node -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;v24.13.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;if-network-is-slow-downloadinstall-timeout&quot;&gt;If Network Is Slow (download/install timeout)&lt;/h4&gt;
&lt;p&gt;This is a very common beginner issue and not your fault.
Often the connection to the official npm registry is simply slow.&lt;/p&gt;
&lt;p&gt;You can switch npm registry to a domestic mirror first:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# check current registry&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; get&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# switch to npmmirror&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://registry.npmmirror.com&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# verify again&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; get&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you want to switch back to the official registry later:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; registry&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://registry.npmjs.org&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;install-vs-code&quot;&gt;Install VS Code&lt;/h3&gt;
&lt;p&gt;Download from the official site (Stable recommended):&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Quick Windows setup:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Download for Windows&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run the installer and mostly &lt;code&gt;Next&lt;/code&gt; all the way.&lt;/li&gt;
&lt;li&gt;Recommended checkboxes:
&lt;code&gt;Add &quot;Open with Code&quot;&lt;/code&gt;, &lt;code&gt;Add to PATH&lt;/code&gt;, &lt;code&gt;Register Code as an editor&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open VS Code, then &lt;code&gt;File -&gt; Open Folder&lt;/code&gt; and choose your blog project folder.&lt;/li&gt;
&lt;li&gt;Open terminal (&lt;code&gt;Ctrl + ~&lt;/code&gt;) and run:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -v&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;node&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -v&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If versions show up correctly, your environment is ready.&lt;/p&gt;
&lt;p&gt;Extensions I personally use (minimal but effective):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Astro&lt;/code&gt; (official syntax support)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Tailwind CSS IntelliSense&lt;/code&gt; (class name suggestions)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Markdown All in One&lt;/code&gt; (better Markdown writing flow)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are interested in learning programming from scratch, I will publish a future post called &lt;strong&gt;“How to Start Programming”&lt;/strong&gt; with more detailed guidance.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;install-astro&quot;&gt;Install Astro&lt;/h3&gt;
&lt;p&gt;I recommend using the &lt;strong&gt;CLI wizard&lt;/strong&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open terminal in your target folder (for me: &lt;code&gt;F:\project\Blog&lt;/code&gt;) and run:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D;--shiki-dark:#6A737D&quot;&gt;# create a new Astro project&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; astro@latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Choose your project name and select &lt;strong&gt;Use blog template&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step1.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;After project creation, when terminal is ready again (cursor blinking), continue.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;C:\Users\Dan&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Enter your project folder and install dependencies:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;F:\project\Blog&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; astro-blog&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;F:\project\Blog\astro-blog&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At this point, the local site should already run:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Open &lt;code&gt;http://localhost:4321/&lt;/code&gt; in browser. If it looks normal, move on.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;deploy-to-github-pages&quot;&gt;Deploy to GitHub Pages&lt;/h2&gt;
&lt;h3 id=&quot;prepare-accounts-and-tools-first-beginner-friendly-order&quot;&gt;Prepare Accounts and Tools First (Beginner-Friendly Order)&lt;/h3&gt;
&lt;h4 id=&quot;1-create-a-github-account&quot;&gt;1. Create a GitHub Account&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;a href=&quot;https://github.com/&quot;&gt;https://github.com/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Sign up&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enter email, password, and username (username appears in your blog URL).&lt;/li&gt;
&lt;li&gt;Finish verification and email confirmation.&lt;/li&gt;
&lt;li&gt;Remember your username, you will use it in repo URL and Astro &lt;code&gt;site&lt;/code&gt; config.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote class=&quot;markdown-alert markdown-alert-tip&quot;&gt;
&lt;p class=&quot;markdown-alert-title&quot;&gt;tip&lt;/p&gt;
&lt;p&gt;If you plan long-term maintenance, enable 2FA in &lt;code&gt;Settings&lt;/code&gt; for better account safety.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;2-install-git-windows&quot;&gt;2. Install Git (Windows)&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Download from &lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;https://git-scm.com/downloads&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Run installer; default options are usually fine.&lt;/li&gt;
&lt;li&gt;Verify in terminal:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then configure identity (one-time):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --global&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; user.name&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;Your Name&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --global&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; user.email&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;your-email@example.com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-install-github-desktop-optional-very-beginner-friendly&quot;&gt;3. Install GitHub Desktop (Optional, very beginner-friendly)&lt;/h4&gt;
&lt;p&gt;If you do not want to memorize many commands at first, GitHub Desktop is a great bridge.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download: &lt;a href=&quot;https://desktop.github.com/&quot;&gt;https://desktop.github.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sign in with your GitHub account.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;File -&gt; Add local repository...&lt;/code&gt;, choose your project folder.&lt;/li&gt;
&lt;li&gt;After edits, review changes, write a &lt;code&gt;Summary&lt;/code&gt;, click &lt;code&gt;Commit to main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Push origin&lt;/code&gt; to upload.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I still use CLI in daily work, but for beginners I often recommend Desktop first. No mental burden needed. Efficiency matters: commit, push, and move forward.&lt;/p&gt;
&lt;h3 id=&quot;initialize-repository-and-first-push-cli--desktop&quot;&gt;Initialize Repository and First Push (CLI / Desktop)&lt;/h3&gt;
&lt;p&gt;If this is your first time, follow this flow (skip if repo already exists).&lt;/p&gt;
&lt;p&gt;Create an empty repository on GitHub first, then replace the URL below.&lt;/p&gt;
&lt;h4 id=&quot;option-a-cli&quot;&gt;Option A: CLI&lt;/h4&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; init&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; commit&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;init astro blog&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; branch&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -M&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; remote&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://github.com/&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;your-github-usernam&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;your-repo-nam&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; push&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -u&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;option-b-github-desktop-gui&quot;&gt;Option B: GitHub Desktop (GUI)&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;In GitHub Desktop, &lt;code&gt;Add local repository&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For first commit, use a message like &lt;code&gt;init astro blog&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Publish repository&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Next updates are simply &lt;code&gt;Commit&lt;/code&gt; + &lt;code&gt;Push origin&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;My recommendation: keep repository name simple and lowercase, which helps avoid mistakes when configuring &lt;code&gt;base&lt;/code&gt; later.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step4.png&quot; alt=&quot;step4&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;use-my-blog-project-as-a-reference-clone-first-then-customize&quot;&gt;Use My Blog Project as a Reference: Clone First, Then Customize&lt;/h3&gt;
&lt;p&gt;If you want to learn from my current project structure directly, quickest way:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; clone&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://github.com/Dancncn/DansBlog.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; DansBlog&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After local startup, open &lt;code&gt;http://localhost:4321/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Project link:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/Dancncn/DansBlog&quot;&gt;https://github.com/Dancncn/DansBlog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If this tutorial or project helps you, I would really appreciate a &lt;code&gt;Star&lt;/code&gt; on the repo.&lt;/p&gt;
&lt;p&gt;Then convert it to your own repo:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new empty repository in your own GitHub account (for example &lt;code&gt;my-blog&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Update these fields in &lt;code&gt;astro.config.mjs&lt;/code&gt;:
&lt;code&gt;site: &apos;https://&amp;#x3C;your-username&gt;.github.io&apos;&lt;/code&gt;
&lt;code&gt;base: &apos;/&amp;#x3C;your-repo-name&gt;/&apos;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Replace remote URL:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; remote&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set-url&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://github.com/&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;your-usernam&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;your-repo-nam&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; push&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -u&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; origin&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Go to &lt;code&gt;Settings -&gt; Pages&lt;/code&gt; and set Source to &lt;code&gt;GitHub Actions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Wait until Actions finishes, then visit:
&lt;code&gt;https://&amp;#x3C;your-username&gt;.github.io/&amp;#x3C;your-repo-name&gt;/&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;configure-site-and-base-in-astro-critical&quot;&gt;Configure &lt;code&gt;site&lt;/code&gt; and &lt;code&gt;base&lt;/code&gt; in Astro (Critical)&lt;/h3&gt;
&lt;p&gt;If you deploy as a project repo (for example &lt;code&gt;https://&amp;#x3C;username&gt;.github.io/&amp;#x3C;repo&gt;/&lt;/code&gt;), you must configure &lt;code&gt;base&lt;/code&gt;, otherwise static assets often return 404.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;astro.config.mjs&lt;/code&gt; example:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; REPO_BASE&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&amp;#x3C;your-repo-name&gt;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; defineConfig&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  site: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;https://&amp;#x3C;your-github-username&gt;.github.io&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  base: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;REPO_BASE&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  trailingSlash: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;always&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  output: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;static&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you use a user-site repo (&lt;code&gt;&amp;#x3C;username&gt;.github.io&lt;/code&gt;), &lt;code&gt;base&lt;/code&gt; is usually &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;auto-deploy-with-github-actions&quot;&gt;Auto Deploy with GitHub Actions&lt;/h3&gt;
&lt;p&gt;I personally prefer automation: one &lt;code&gt;push&lt;/code&gt;, one deployment.&lt;/p&gt;
&lt;p&gt;Create file: &lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;Deploy to GitHub Pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  push&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    branches&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  workflow_dispatch&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;permissions&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  contents&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;read&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  pages&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  id-token&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;concurrency&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  group&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  cancel-in-progress&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  build&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    runs-on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    steps&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/checkout@v4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/setup-node@v4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        with&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          node-version&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;20&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          cache&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/configure-pages@v5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm ci&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/upload-pages-artifact@v3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        with&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;          path&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;./dist&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;  deploy&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    needs&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    runs-on&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    environment&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;      name&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;github-pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;      url&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;${{ steps.deployment.outputs.page_url }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;    steps&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - &lt;/span&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A;--shiki-dark:#85E89D&quot;&gt;        uses&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;actions/deploy-pages@v4&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you started from Astro’s blog template, this file may already exist. Check first before editing.&lt;/p&gt;
&lt;h3 id=&quot;enable-github-pages&quot;&gt;Enable GitHub Pages&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Open your repo, click &lt;code&gt;Settings&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Find &lt;code&gt;Pages&lt;/code&gt; in left sidebar.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;Source&lt;/code&gt; to &lt;code&gt;GitHub Actions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Go back to &lt;code&gt;Actions&lt;/code&gt; and wait for workflow success.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After that, your site is usually available at:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/how-to-build-step3.png&quot; alt=&quot;step3&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;https://&amp;#x3C;your-github-username&gt;.github.io/&amp;#x3C;your-repo-name&gt;/&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;pitfalls-i-personally-hit&quot;&gt;Pitfalls I Personally Hit&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Site opens but CSS is missing: &lt;code&gt;base&lt;/code&gt; is wrong.&lt;/li&gt;
&lt;li&gt;Images 404: wrong Markdown image path, prefer relative paths.&lt;/li&gt;
&lt;li&gt;Action failed: most often dependency install or Node version issue.&lt;/li&gt;
&lt;li&gt;Fresh deployment still 404: wait 1-2 minutes; Pages can lag.&lt;/li&gt;
&lt;li&gt;Pushed code but site did not update: likely pushed to wrong branch (not &lt;code&gt;main&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Works locally, white screen online: &lt;code&gt;site&lt;/code&gt; + &lt;code&gt;base&lt;/code&gt; combination is wrong.&lt;/li&gt;
&lt;li&gt;Project path with Chinese chars/spaces: can trigger weird script issues on Windows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install&lt;/code&gt; is very slow/stuck: check network first, then switch registry.&lt;/li&gt;
&lt;li&gt;Changed config but no effect: some files (like &lt;code&gt;astro.config.mjs&lt;/code&gt;) require dev server restart.&lt;/li&gt;
&lt;li&gt;Random file-name case changes: Windows is case-insensitive, Linux (Pages) is not, causing online 404.&lt;/li&gt;
&lt;li&gt;Editing config directly on GitHub web too often: easy to conflict with local changes.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;deploying-to-cloudflare-pages-recommended-stronger-cdn--less-maintenance&quot;&gt;Deploying to Cloudflare Pages (Recommended: Stronger CDN &amp;#x26; Less Maintenance)&lt;/h2&gt;
&lt;p&gt;If GitHub Pages is already working for you, this is a practical upgrade path worth trying. In real-world use, Cloudflare Pages usually gives you a smoother deployment loop and stronger global delivery out of the box.&lt;/p&gt;
&lt;h3 id=&quot;why-consider-cloudflare-pages&quot;&gt;Why Consider Cloudflare Pages?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Global CDN: static assets are distributed closer to visitors worldwide.&lt;/li&gt;
&lt;li&gt;Automatic HTTPS: certificate and TLS are managed for you.&lt;/li&gt;
&lt;li&gt;Automatic deployment from Git: push to branch, trigger build, ship.&lt;/li&gt;
&lt;li&gt;Performance and basic security benefits: caching, compression, and edge protection are easier to get right.&lt;/li&gt;
&lt;li&gt;Future scalability: you can extend with Pages Functions / Workers and pair with D1 / KV / R2 when needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For access quality, keep expectations realistic: international performance is usually excellent; mainland China is often more usable than GitHub Pages, but this is still not the same as a mainland CDN setup with ICP filing.&lt;/p&gt;
&lt;h3 id=&quot;step-by-step-deployment-guide&quot;&gt;Step-by-Step Deployment Guide&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Create a Cloudflare account and enter the dashboard.&lt;/li&gt;
&lt;li&gt;In the left menu, open &lt;code&gt;Workers &amp;#x26; Pages&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;Pages&lt;/code&gt;. In the newer UI, this entry may appear under &lt;code&gt;Looking to deploy Pages? Get started&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Import an existing Git repository&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Connect your GitHub account and select your blog repository.&lt;/li&gt;
&lt;li&gt;Configure build settings:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Framework preset&lt;/code&gt;: &lt;code&gt;Astro&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Build command&lt;/code&gt;: &lt;code&gt;npm run build&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Build output directory&lt;/code&gt;: &lt;code&gt;dist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Production branch&lt;/code&gt;: &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Start deployment. After success, open the generated &lt;code&gt;*.pages.dev&lt;/code&gt; URL.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;My recommendation: validate everything on the default &lt;code&gt;pages.dev&lt;/code&gt; domain first, then bind custom domain later.&lt;/p&gt;
&lt;h3 id=&quot;the-most-common-pitfall-base-path-issues&quot;&gt;The Most Common Pitfall: Base Path Issues&lt;/h3&gt;
&lt;p&gt;This is the one that gets almost everyone once.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GitHub Pages project sites usually live under a subpath like &lt;code&gt;/DansBlog/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Cloudflare Pages usually serves your site from root path &lt;code&gt;/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;base&lt;/code&gt; still points to &lt;code&gt;/DansBlog/&lt;/code&gt;, your page loads as blue links / raw HTML with missing CSS/JS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use an environment-based &lt;code&gt;base&lt;/code&gt; switch in &lt;code&gt;astro.config.mjs&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { defineConfig } &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;astro/config&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; isCfPages&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; process.env.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;1&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; isGithubProd&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;isCfPages &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; process.env.&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;production&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; base&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; isCfPages &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt; isGithubProd &lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/DansBlog/&apos;&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt; defineConfig&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  site: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;https://your-domain-or-pages-domain&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  base,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  trailingSlash: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;always&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  output: &lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;static&apos;&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Behavior of this setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cloudflare build: &lt;code&gt;base = &quot;/&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;GitHub Pages production build: &lt;code&gt;base = &quot;/DansBlog/&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Local dev: &lt;code&gt;base = &quot;/&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also avoid hardcoded &lt;code&gt;&quot;/DansBlog&quot;&lt;/code&gt; in links/components. Prefer &lt;code&gt;import.meta.env.BASE_URL&lt;/code&gt; or relative paths.&lt;/p&gt;
&lt;h3 id=&quot;how-to-validate-the-deployment&quot;&gt;How to Validate the Deployment&lt;/h3&gt;
&lt;p&gt;Local simulation first (Windows CMD):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;cmd&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npx astro preview&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Optional PowerShell equivalent:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt;env:&lt;/span&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;CF_PAGES&lt;/span&gt;&lt;span style=&quot;color:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;1&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npm run build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E;--shiki-dark:#E1E4E8&quot;&gt;npx astro preview&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Online validation checklist:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your &lt;code&gt;pages.dev&lt;/code&gt; URL.&lt;/li&gt;
&lt;li&gt;Open DevTools -&gt; &lt;code&gt;Network&lt;/code&gt;, confirm 404 count is &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;View page source and search for &lt;code&gt;&quot;/DansBlog&quot;&lt;/code&gt;; it should not appear in Cloudflare deployment output.&lt;/li&gt;
&lt;li&gt;Test key routes: home page, article page, tag page, pagination.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;pagesdev-domain--custom-domain&quot;&gt;pages.dev Domain &amp;#x26; Custom Domain&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pages.dev&lt;/code&gt; is the default free subdomain.&lt;/li&gt;
&lt;li&gt;Renaming the project usually changes the subdomain prefix.&lt;/li&gt;
&lt;li&gt;If you want your own domain, you usually need to purchase one first.&lt;/li&gt;
&lt;li&gt;Cloudflare Pages supports custom domain binding directly in project settings.&lt;/li&gt;
&lt;li&gt;Regarding domain acquisition and setup, please consult the guide on &lt;strong&gt;&lt;a href=&quot;https://danarnoux.com/blog/how-to-register-a-cloudflare-domain-en/&quot;&gt;How to Register a Cloudflare Domain&lt;/a&gt;&lt;/strong&gt;, which includes a video tutorial.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;accessibility-for-international--mainland-china-users&quot;&gt;Accessibility for International &amp;#x26; Mainland China Users&lt;/h3&gt;
&lt;p&gt;Practical expectations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;International visitors: usually very strong performance.&lt;/li&gt;
&lt;li&gt;Mainland China users: often more usable than GitHub Pages.&lt;/li&gt;
&lt;li&gt;Without ICP备案 and mainland CDN architecture, do not expect domestic-CDN-level stability everywhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Low-cost improvements that help a lot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Self-host fonts instead of relying on Google Fonts.&lt;/li&gt;
&lt;li&gt;Minimize third-party external scripts.&lt;/li&gt;
&lt;li&gt;Leverage static asset caching (hashed file names + long cache headers).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;wrap-up&quot;&gt;Wrap-up&lt;/h2&gt;
&lt;p&gt;By now you already have a very practical workflow:
local writing -&gt; &lt;code&gt;git push&lt;/code&gt; -&gt; GitHub auto build + deploy.&lt;/p&gt;
&lt;p&gt;From here, keep writing and gradually polish your style.
Technology is the skeleton; content is the soul.
First make it run, then make it beautiful.&lt;/p&gt;
&lt;p&gt;I hope you can use AI code tools without psychological pressure. They can significantly improve productivity. For example, this site reached a usable Home/Blog/About structure in about 4 hours on day one, then I spent day two and day three refining details and mobile adaptation.&lt;/p&gt;
&lt;p&gt;But do not forget your original goal for building a blog:
reliable publishing and reading comes first.
Fancy features are optional personal fun. Add them if you want, skip them if you do not.&lt;/p&gt;</content:encoded><category>Astro</category><category>blog</category><category>github-pages</category><category>guide</category><category>EN</category></item><item><title>GoFile 下载工具 -- 完整使用指南</title><link>https://danarnoux.com/blog/gofile-download-tool-guide-cn/</link><guid isPermaLink="true">https://danarnoux.com/blog/gofile-download-tool-guide-cn/</guid><description>一份使用 Python 脚本从 GoFile 下载文件的分步指南，包含环境配置和实战演示。</description><pubDate>Wed, 11 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;hr&gt;
&lt;h2 id=&quot;引言&quot;&gt;引言&lt;/h2&gt;
&lt;p&gt;说实话，Gofile这个网盘使用起来还是还是有点麻烦的，比方说有你需要下载的资源的时候。欸，让你等等再下载，但是你很急，又不想开会员，那就可以试试这个小工具了，如果你不知道你要下的对应链接里的对应文件的下载命令怎么写，也不妨让ai来帮你吧，坐上轮椅是对的。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;1-获取项目&quot;&gt;1. 获取项目&lt;/h2&gt;
&lt;p&gt;项目托管在 GitHub：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rkwyu/gofile-dl&quot;&gt;https://github.com/rkwyu/gofile-dl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;你可以通过两种方式获取它。&lt;/p&gt;
&lt;h3 id=&quot;方法-1--下载-zip推荐&quot;&gt;方法 1 — 下载 ZIP（推荐）&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;打开仓库页面&lt;/li&gt;
&lt;li&gt;点击 &lt;strong&gt;Code&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;选择 &lt;strong&gt;Download ZIP&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;解压到任意文件夹&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/gofile-step1.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;方法-2--使用-git-克隆&quot;&gt;方法 2 — 使用 Git 克隆&lt;/h3&gt;
&lt;p&gt;如果已安装 Git：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; clone&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://github.com/rkwyu/gofile-dl&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-安装依赖&quot;&gt;2. 安装依赖&lt;/h2&gt;
&lt;p&gt;打开项目文件夹。&lt;/p&gt;
&lt;p&gt;点击地址栏，输入：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cmd&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;按下回车。&lt;/p&gt;
&lt;p&gt;然后安装依赖：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; requirements.txt&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;等待安装完成。&lt;/p&gt;
&lt;p&gt;如果无法识别 Python：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;请重新安装 Python 并启用：&lt;/p&gt;
&lt;p&gt;将 Python 添加到 PATH&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-运行下载器&quot;&gt;3. 运行下载器&lt;/h2&gt;
&lt;p&gt;执行：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run.py&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;output_filename.zip&quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://gofile.io/d/your_link_id&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;示例：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run.py&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;example.zip&quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://gofile.io/d/abcd1234&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;下载后的文件会出现在：&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;outputs/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/gofile-step3.png&quot; alt=&quot;step3&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;4-常见问题&quot;&gt;4. 常见问题&lt;/h2&gt;
&lt;h3 id=&quot;找不到-python&quot;&gt;找不到 Python&lt;/h3&gt;
&lt;p&gt;重新安装 Python，并正确配置 PATH。&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;pip-安装报错&quot;&gt;pip 安装报错&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --upgrade&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;流程总结&quot;&gt;流程总结&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;获取仓库&lt;/li&gt;
&lt;li&gt;安装依赖&lt;/li&gt;
&lt;li&gt;运行下载命令&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;完成。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;说明&quot;&gt;说明&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;此工具仅用于下载可公开访问的文件。&lt;/li&gt;
&lt;li&gt;请确保遵守适用法律及平台服务条款。&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>tools</category><category>download</category><category>gofile</category><category>guide</category><category>CN</category></item><item><title>GoFile Download Tool -- Complete Usage Guide</title><link>https://danarnoux.com/blog/gofile-download-tool-guide-en/</link><guid isPermaLink="true">https://danarnoux.com/blog/gofile-download-tool-guide-en/</guid><description>A step-by-step guide to downloading files from GoFile using a Python script, with environment setup and practical examples.</description><pubDate>Wed, 11 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;hr&gt;
&lt;h2 id=&quot;1-getting-the-project&quot;&gt;1. Getting the Project&lt;/h2&gt;
&lt;p&gt;The project is hosted on GitHub:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rkwyu/gofile-dl&quot;&gt;https://github.com/rkwyu/gofile-dl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You have two ways to obtain it.&lt;/p&gt;
&lt;h3 id=&quot;method-1--download-zip-recommended&quot;&gt;Method 1 — Download ZIP (Recommended)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Open the repository page&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Code&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Download ZIP&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Extract it to any folder&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/gofile-step1.png&quot; alt=&quot;step1&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;method-2--clone-via-git&quot;&gt;Method 2 — Clone via Git&lt;/h3&gt;
&lt;p&gt;If Git is installed:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; clone&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://github.com/rkwyu/gofile-dl&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;2-install-dependencies&quot;&gt;2. Install Dependencies&lt;/h2&gt;
&lt;p&gt;Open the project folder.&lt;/p&gt;
&lt;p&gt;Click the address bar, type:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cmd&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Press Enter.&lt;/p&gt;
&lt;p&gt;Then install dependencies:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; requirements.txt&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Wait until installation finishes.&lt;/p&gt;
&lt;p&gt;If Python is not recognized:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reinstall Python and enable:&lt;/p&gt;
&lt;p&gt;Add Python to PATH&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;3-run-the-downloader&quot;&gt;3. Run the Downloader&lt;/h2&gt;
&lt;p&gt;Execute:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run.py&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;output_filename.zip&quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://gofile.io/d/your_link_id&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run.py&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;example.zip&quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://gofile.io/d/abcd1234&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Downloaded files will appear in:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;outputs/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://img.danarnoux.com/posts/gofile-step3.png&quot; alt=&quot;step3&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;4-common-issues&quot;&gt;4. Common Issues&lt;/h2&gt;
&lt;h3 id=&quot;python-not-found&quot;&gt;Python Not Found&lt;/h3&gt;
&lt;p&gt;Reinstall Python and configure PATH properly.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;pip-installation-errors&quot;&gt;pip Installation Errors&lt;/h3&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --upgrade&lt;/span&gt;&lt;span style=&quot;color:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pip&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&quot;workflow-summary&quot;&gt;Workflow Summary&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Get repository&lt;/li&gt;
&lt;li&gt;Install dependencies&lt;/li&gt;
&lt;li&gt;Run download command&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That’s all.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;notes&quot;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This tool is intended for downloading publicly accessible files.&lt;/li&gt;
&lt;li&gt;Ensure you comply with applicable laws and platform terms of
service.&lt;/li&gt;
&lt;/ul&gt;</content:encoded><category>tools</category><category>download</category><category>gofile</category><category>guide</category><category>EN</category></item></channel></rss>