{"id":41,"date":"2026-06-09T20:04:08","date_gmt":"2026-06-09T12:04:08","guid":{"rendered":"https:\/\/yylx.io\/blog\/?p=41"},"modified":"2026-06-09T20:25:23","modified_gmt":"2026-06-09T12:25:23","slug":"claude-code-cli-install-guide","status":"publish","type":"post","link":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/","title":{"rendered":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Claude Code CLI \u662f Anthropic \u7684\u547d\u4ee4\u884c\u5f00\u53d1\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u91cc\u542f\u52a8 Claude\uff0c\u8ba9\u5b83\u9605\u8bfb\u4ee3\u7801\u3001\u89e3\u91ca\u62a5\u9519\u3001\u4fee\u6539\u6587\u4ef6\u548c\u534f\u52a9\u5b8c\u6210\u5f00\u53d1\u4efb\u52a1\u3002\u672c\u6587\u76f4\u63a5\u6574\u7406\u53ef\u590d\u5236\u7684\u5b89\u88c5\u547d\u4ee4\uff0c\u8986\u76d6 macOS\u3001Windows PowerShell\u3001Windows CMD\u3001WSL\u3001Homebrew\u3001WinGet \u548c npm\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u547d\u4ee4\u6839\u636e Claude Code \u5b98\u65b9\u5b89\u88c5\u6587\u6863\u6574\u7406\u3002\u5b89\u88c5\u811a\u672c\u548c\u5305\u7ba1\u7406\u5668\u547d\u4ee4\u53ef\u80fd\u4f1a\u66f4\u65b0\uff0c\u6267\u884c\u524d\u5efa\u8bae\u786e\u8ba4\u4f60\u8bbf\u95ee\u7684\u662f\u5b98\u65b9\u57df\u540d <code>claude.ai<\/code>\u3001<code>claude.com<\/code> \u6216 Anthropic \u5b98\u65b9\u6587\u6863\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5\u524d\u786e\u8ba4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8d26\u53f7\uff1a<\/strong>Claude Code \u9700\u8981 Pro\u3001Max\u3001Team\u3001Enterprise \u6216 Console \u8d26\u53f7\uff1b\u514d\u8d39 Claude.ai \u8d26\u53f7\u901a\u5e38\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528 Claude Code\u3002\u5982\u679c\u521b\u5efa\u8d26\u53f7\u9047\u5230\u95ee\u9898\uff1a\u5982\u65e0\u4fe1\u7528\u5361\u3001\u5c01\u53f7\u7b49\uff0c\u4e5f\u53ef\u4ee5\u4e86\u89e3 <a href=\"https:\/\/yylx.io\" target=\"_blank\" rel=\"noopener\">YYLX.IO \u9c7c\u9c7c\u8fde\u7ebf<\/a> \u8fd9\u7c7b AI \u4e2d\u8f6c\u7ad9\u8bbf\u95ee Claude Code\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Windows\uff1a<\/strong>Windows \u539f\u751f\u4f7f\u7528\u65f6\uff0c\u5efa\u8bae\u5b89\u88c5 Git for Windows\uff0c\u65b9\u4fbf Claude Code \u8c03\u7528 Git Bash\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Node.js\uff1a<\/strong>\u5982\u679c\u9009\u62e9 npm \u5b89\u88c5\uff0c\u9700\u8981 Node.js 18 \u6216\u66f4\u9ad8\u7248\u672c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5b89\u5168\uff1a<\/strong>\u4e0d\u8981\u4ece\u4e0d\u660e SEO \u4e0b\u8f7d\u7ad9\u590d\u5236\u5b89\u88c5\u547d\u4ee4\uff0c\u5c24\u5176\u4e0d\u8981\u8fd0\u884c\u6765\u6e90\u4e0d\u6e05\u7684 PowerShell \u811a\u672c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e00\uff1a\u5b98\u65b9 Native Install\uff0c\u63a8\u8350<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b98\u65b9\u63a8\u8350\u7684 native install \u4f1a\u5b89\u88c5 Claude Code \u539f\u751f\u547d\u4ee4\u884c\u7a0b\u5e8f\uff0c\u5e76\u652f\u6301\u540e\u53f0\u81ea\u52a8\u66f4\u65b0\u3002macOS\u3001Linux \u548c WSL \u4f7f\u7528\u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/claude.ai\/install.sh | bash<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Windows PowerShell \u4f7f\u7528\u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\u3002\u6ce8\u610f\u63d0\u793a\u7b26\u5e94\u7c7b\u4f3c <code>PS C:\\<\/code>\uff0c\u4e0d\u8981\u5728 CMD \u91cc\u8fd0\u884c\u8fd9\u6761 PowerShell \u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>irm https:\/\/claude.ai\/install.ps1 | iex<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Windows CMD \u4f7f\u7528\u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\u3002\u6ce8\u610f\u63d0\u793a\u7b26\u901a\u5e38\u662f <code>C:\\<\/code>\uff0c\u4e0d\u662f <code>PS C:\\<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/claude.ai\/install.cmd -o install.cmd &amp;&amp; install.cmd &amp;&amp; del install.cmd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\uff0c\u518d\u6267\u884c\u9a8c\u8bc1\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>claude --version\nclaude doctor<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u822c\u7528\u6237\u76f4\u63a5\u4f7f\u7528\u4e0a\u9762\u7684\u9ed8\u8ba4\u5b89\u88c5\u547d\u4ee4\u5373\u53ef\u3002\u9664\u975e\u5b98\u65b9\u6587\u6863\u7279\u522b\u8981\u6c42\u5207\u6362\u7248\u672c\u901a\u9053\uff0c\u5426\u5219\u4e0d\u5efa\u8bae\u5728\u6559\u7a0b\u91cc\u989d\u5916\u4f20\u9012\u5b89\u88c5\u53c2\u6570\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e8c\uff1amacOS \u7528 Homebrew \u5b89\u88c5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u4e60\u60ef\u7528 Homebrew \u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u5b89\u88c5 stable cask\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install --cask claude-code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Homebrew \u5b89\u88c5\u4e0d\u4f1a\u7531 Claude Code \u81ea\u52a8\u540e\u53f0\u66f4\u65b0\uff0c\u9700\u8981\u624b\u52a8\u5347\u7ea7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew upgrade claude-code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5378\u8f7d\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew uninstall --cask claude-code<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e09\uff1aWindows \u7528 WinGet \u5b89\u88c5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Windows \u7528\u6237\u4e5f\u53ef\u4ee5\u7528 WinGet \u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>winget install Anthropic.ClaudeCode<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">WinGet \u5b89\u88c5\u540c\u6837\u9700\u8981\u624b\u52a8\u5347\u7ea7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>winget upgrade Anthropic.ClaudeCode<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5378\u8f7d\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>winget uninstall Anthropic.ClaudeCode<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6cd5\u56db\uff1anpm \u5b89\u88c5\uff0c\u9002\u5408 Node.js \u7528\u6237<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u5df2\u7ecf\u5b89\u88c5 Node.js 18+\uff0c\u4e5f\u53ef\u4ee5\u7528 npm \u5168\u5c40\u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @anthropic-ai\/claude-code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5347\u7ea7 npm \u5b89\u88c5\u7248\u672c\u65f6\uff0c\u5b98\u65b9\u5efa\u8bae\u4f7f\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @anthropic-ai\/claude-code@latest<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5378\u8f7d\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm uninstall -g @anthropic-ai\/claude-code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u5efa\u8bae\u4f7f\u7528 <code>sudo npm install -g<\/code>\uff0c\u56e0\u4e3a\u5b83\u5bb9\u6613\u5e26\u6765\u6743\u9650\u548c\u5b89\u5168\u95ee\u9898\u3002\u5982\u679c\u5168\u5c40\u5b89\u88c5\u76ee\u5f55\u4e0d\u53ef\u5199\uff0c\u4f18\u5148\u4fee\u590d npm \u76ee\u5f55\u6743\u9650\uff0c\u6216\u4f7f\u7528 nvm \u91cd\u65b0\u5b89\u88c5 Node.js\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Windows \u539f\u751f\u8fd8\u662f WSL\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u7684\u9879\u76ee\u5728 Windows \u6587\u4ef6\u7cfb\u7edf\u91cc\uff0c\u6bd4\u5982 <code>C:\\Users\\Yu\\project<\/code>\uff0c\u53ef\u4ee5\u7528 Windows \u539f\u751f\u5b89\u88c5\u3002\u5982\u679c\u4f60\u7684\u9879\u76ee\u4e3b\u8981\u5728 Linux \u5de5\u5177\u94fe\u91cc\uff0c\u6bd4\u5982 Docker\u3001Ubuntu\u3001Python\u3001Node.js\u3001Rust \u5f00\u53d1\u73af\u5883\uff0c\u5efa\u8bae\u5728 WSL \u91cc\u5b89\u88c5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WSL \u91cc\u4e0d\u8981\u8fd0\u884c Windows PowerShell \u5b89\u88c5\u547d\u4ee4\uff0c\u800c\u662f\u6253\u5f00 WSL \u7ec8\u7aef\uff0c\u4f7f\u7528 Linux\/macOS \u8fd9\u6761\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/claude.ai\/install.sh | bash<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u9996\u6b21\u542f\u52a8\u548c\u767b\u5f55<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728\u4f60\u8981\u5904\u7406\u7684\u9879\u76ee\u76ee\u5f55\u91cc\u8fd0\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>claude<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u6b21\u8fd0\u884c\u4f1a\u5f15\u5bfc\u4f60\u767b\u5f55\u6216\u9009\u62e9\u8d26\u53f7\u7c7b\u578b\u3002\u767b\u5f55\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5148\u8ba9\u5b83\u505a\u4e00\u4e2a\u4f4e\u98ce\u9669\u6d4b\u8bd5\uff0c\u4f8b\u5982\u603b\u7ed3\u9879\u76ee\u7ed3\u6784\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>claude\n&gt; summarize this project<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u56fd\u5185\u7f51\u7edc\u73af\u5883\u4e0b\u600e\u4e48\u88c5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u5b98\u65b9\u5b89\u88c5\u811a\u672c\u4e0b\u8f7d\u5931\u8d25\uff0c\u5148\u5224\u65ad\u5931\u8d25\u70b9\u3002\u5982\u679c\u662f <code>claude.ai\/install.sh<\/code>\u3001<code>install.ps1<\/code> \u6216 <code>install.cmd<\/code> \u8bbf\u95ee\u5931\u8d25\uff0c\u8bf4\u660e\u5b98\u65b9\u4e0b\u8f7d\u6e90\u8fde\u63a5\u4e0d\u7a33\u5b9a\uff0c\u9700\u8981\u6362\u7f51\u7edc\u73af\u5883\u540e\u518d\u8bd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u8d70 npm \u5b89\u88c5\uff0c\u4e14\u53ea\u662f npm registry \u6162\uff0c\u53ef\u4ee5\u4e34\u65f6\u4f7f\u7528\u955c\u50cf\u6e90\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @anthropic-ai\/claude-code --registry=https:\/\/registry.npmmirror.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u8981\u6ce8\u610f\uff1anpm \u955c\u50cf\u53ea\u80fd\u89e3\u51b3\u4e0b\u8f7d npm \u5305\u6162\u7684\u95ee\u9898\uff0c\u4e0d\u80fd\u89e3\u51b3 Claude Code \u767b\u5f55\u3001\u8d26\u53f7\u6743\u9650\u6216 Claude \u670d\u52a1\u8bbf\u95ee\u95ee\u9898\u3002\u547d\u4ee4\u88c5\u597d\u4e86\u4e0d\u4ee3\u8868\u670d\u52a1\u4e00\u5b9a\u80fd\u8fde\u901a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u547d\u4ee4\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff0c\u4f46\u8fd0\u884c <code>claude<\/code> \u65f6\u767b\u5f55\u5931\u8d25\u3001\u8bf7\u6c42\u8d85\u65f6\u6216\u670d\u52a1\u8fde\u63a5\u4e0d\u7a33\u5b9a\uff0c\u95ee\u9898\u901a\u5e38\u4e0d\u5728\u5b89\u88c5\u547d\u4ee4\uff0c\u800c\u5728\u7f51\u7edc\u8bbf\u95ee\u94fe\u8def\u3002\u4f60\u53ef\u4ee5\u5148\u6362\u4e00\u4e2a\u7a33\u5b9a\u7f51\u7edc\u73af\u5883\uff0c\u4e5f\u53ef\u4ee5\u4e86\u89e3 <a href=\"https:\/\/yylx.io\" target=\"_blank\" rel=\"noopener\">YYLX.IO \u9c7c\u9c7c\u8fde\u7ebf<\/a> \u8fd9\u7c7b AI \u4e2d\u8f6c\u7ad9\uff0c\u7528\u6765\u6539\u5584 Claude\u3001OpenAI\u3001Gemini \u7b49\u670d\u52a1\u7684\u8bbf\u95ee\u7a33\u5b9a\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e38\u89c1\u62a5\u9519<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">claude: command not found<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u540e\u518d\u8bd5\u3002\u5982\u679c\u4ecd\u7136\u5931\u8d25\uff0c\u68c0\u67e5 <code>~\/.local\/bin<\/code> \u662f\u5426\u5728 PATH \u4e2d\u3002npm \u5b89\u88c5\u7528\u6237\u8fd8\u8981\u68c0\u67e5 npm \u5168\u5c40 bin \u76ee\u5f55\u662f\u5426\u5728 PATH \u4e2d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PowerShell \u63d0\u793a &amp;&amp; \u4e0d\u662f\u6709\u6548\u8bed\u53e5\u5206\u9694\u7b26<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u628a CMD \u547d\u4ee4\u653e\u5230 PowerShell \u91cc\u6267\u884c\u4e86\u3002PowerShell \u8bf7\u4f7f\u7528 <code>irm https:\/\/claude.ai\/install.ps1 | iex<\/code>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CMD \u63d0\u793a irm \u4e0d\u662f\u5185\u90e8\u6216\u5916\u90e8\u547d\u4ee4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u628a PowerShell \u547d\u4ee4\u653e\u5230 CMD \u91cc\u6267\u884c\u4e86\u3002CMD \u8bf7\u4f7f\u7528 <code>install.cmd<\/code> \u90a3\u6761\u547d\u4ee4\uff0c\u6216\u8005\u5207\u6362\u5230 PowerShell\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u767b\u5f55\u540e\u4ecd\u7136\u4e0d\u80fd\u4f7f\u7528<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u786e\u8ba4\u4f60\u7684\u8d26\u53f7\u7c7b\u578b\u662f\u5426\u652f\u6301 Claude Code\u3002\u5b98\u65b9\u6587\u6863\u8bf4\u660e Claude Code \u9700\u8981 Pro\u3001Max\u3001Team\u3001Enterprise \u6216 Console \u8d26\u53f7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u603b\u7ed3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u6b21\u5b89\u88c5 Claude Code CLI\uff0c\u4f18\u5148\u9009\u62e9\u5b98\u65b9 native install\uff1amacOS\u3001Linux\u3001WSL \u4f7f\u7528 <code>curl -fsSL https:\/\/claude.ai\/install.sh | bash<\/code>\uff0cWindows PowerShell \u4f7f\u7528 <code>irm https:\/\/claude.ai\/install.ps1 | iex<\/code>\uff0cWindows CMD \u4f7f\u7528 <code>install.cmd<\/code>\u3002\u5982\u679c\u4f60\u4e60\u60ef\u5305\u7ba1\u7406\u5668\uff0c\u518d\u8003\u8651 Homebrew\u3001WinGet \u6216 npm\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\u4e00\u5b9a\u6267\u884c <code>claude --version<\/code> \u548c <code>claude doctor<\/code>\u3002\u8fd9\u4e00\u6b65\u80fd\u5e2e\u4f60\u533a\u5206\u201c\u547d\u4ee4\u6ca1\u88c5\u597d\u201d\u201cPATH \u6ca1\u751f\u6548\u201d\u201c\u8d26\u53f7\u6ca1\u6743\u9650\u201d\u548c\u201c\u7f51\u7edc\u65e0\u6cd5\u8bbf\u95ee\u670d\u52a1\u201d\u8fd9\u51e0\u7c7b\u5b8c\u5168\u4e0d\u540c\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u6b63\u5728\u642d\u5efa AI \u5f00\u53d1\u73af\u5883\uff0c\u5e0c\u671b Claude\u3001ChatGPT\u3001Gemini\u3001Codex \u7b49\u5de5\u5177\u8bbf\u95ee\u66f4\u7a33\u5b9a\uff0c\u53ef\u4ee5\u770b\u770b <a href=\"https:\/\/yylx.io\" target=\"_blank\" rel=\"noopener\">YYLX.IO \u9c7c\u9c7c\u8fde\u7ebf<\/a>\u3002\u5b83\u66f4\u9002\u5408\u9700\u8981\u957f\u671f\u4f7f\u7528 AI \u5de5\u5177\uff0c\u4f46\u7ecf\u5e38\u9047\u5230\u7f51\u7edc\u4e0d\u7a33\u5b9a\u7684\u5f00\u53d1\u8005\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u7ed9\u51fa Claude Code CLI \u5728 macOS\u3001Windows PowerShell\u3001Windows CMD\u3001WSL\u3001Homebrew\u3001WinGet \u548c npm \u4e0b\u7684\u5b9e\u9645\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u9a8c\u8bc1\u3001\u66f4\u65b0\u3001\u5378\u8f7d\u548c\u5e38\u89c1\u62a5\u9519\u5904\u7406\u3002<\/p>\n","protected":false},"author":2,"featured_media":55,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u7ed9\u51fa Claude Code CLI \u5728 macOS\u3001Windows PowerShell\u3001Windows CMD\u3001WSL\u3001Homebrew\u3001WinGet \u548c npm \u4e0b\u7684\u5b9e\u9645\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u9a8c\u8bc1\u3001\u66f4\u65b0\u3001\u5378\u8f7d\u548c\u5e38\u89c1\u62a5\u9519\u5904\u7406\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-09T12:04:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-09T12:25:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Yu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yu\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/\"},\"author\":{\"name\":\"Yu\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#\\\/schema\\\/person\\\/2cde4f7a47af39013dd042fb25ba1afd\"},\"headline\":\"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357\",\"datePublished\":\"2026-06-09T12:04:08+00:00\",\"dateModified\":\"2026-06-09T12:25:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/\"},\"wordCount\":179,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/claude-code-cli-install-guide-v4.png\",\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/\",\"name\":\"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/claude-code-cli-install-guide-v4.png\",\"datePublished\":\"2026-06-09T12:04:08+00:00\",\"dateModified\":\"2026-06-09T12:25:23+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#\\\/schema\\\/person\\\/2cde4f7a47af39013dd042fb25ba1afd\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/claude-code-cli-install-guide-v4.png\",\"contentUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/claude-code-cli-install-guide-v4.png\",\"width\":1200,\"height\":630,\"caption\":\"Claude Code CLI \u5b89\u88c5\u6307\u5357\u5c01\u9762\u56fe\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/claude-code-cli-install-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/yylx.io/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#website\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/\",\"name\":\"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2\",\"description\":\"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9 \u535a\u5ba2\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/yylx.io/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#\\\/schema\\\/person\\\/2cde4f7a47af39013dd042fb25ba1afd\",\"name\":\"Yu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109\",\"contentUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109\",\"caption\":\"Yu\"},\"url\":\"https:\\\/\\\/yylx.io/blog\\\/author\\\/yu\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/","og_locale":"zh_CN","og_type":"article","og_title":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","og_description":"\u672c\u6587\u7ed9\u51fa Claude Code CLI \u5728 macOS\u3001Windows PowerShell\u3001Windows CMD\u3001WSL\u3001Homebrew\u3001WinGet \u548c npm \u4e0b\u7684\u5b9e\u9645\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u9a8c\u8bc1\u3001\u66f4\u65b0\u3001\u5378\u8f7d\u548c\u5e38\u89c1\u62a5\u9519\u5904\u7406\u3002","og_url":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/","og_site_name":"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","article_published_time":"2026-06-09T12:04:08+00:00","article_modified_time":"2026-06-09T12:25:23+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v3.png","type":"image\/png"}],"author":"Yu","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"Yu","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#article","isPartOf":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/"},"author":{"name":"Yu","@id":"https:\/\/yylx.io\/blog\/#\/schema\/person\/2cde4f7a47af39013dd042fb25ba1afd"},"headline":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357","datePublished":"2026-06-09T12:04:08+00:00","dateModified":"2026-06-09T12:25:23+00:00","mainEntityOfPage":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/"},"wordCount":179,"commentCount":0,"image":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v4.png","inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/","url":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/","name":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","isPartOf":{"@id":"https:\/\/yylx.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#primaryimage"},"image":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v4.png","datePublished":"2026-06-09T12:04:08+00:00","dateModified":"2026-06-09T12:25:23+00:00","author":{"@id":"https:\/\/yylx.io\/blog\/#\/schema\/person\/2cde4f7a47af39013dd042fb25ba1afd"},"breadcrumb":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#primaryimage","url":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v4.png","contentUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/claude-code-cli-install-guide-v4.png","width":1200,"height":630,"caption":"Claude Code CLI \u5b89\u88c5\u6307\u5357\u5c01\u9762\u56fe"},{"@type":"BreadcrumbList","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/claude-code-cli-install-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/yylx.io\/blog\/"},{"@type":"ListItem","position":2,"name":"Claude Code CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS \u548c Windows \u5b8c\u6574\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/yylx.io\/blog\/#website","url":"https:\/\/yylx.io\/blog\/","name":"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","description":"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9 \u535a\u5ba2","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yylx.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/yylx.io\/blog\/#\/schema\/person\/2cde4f7a47af39013dd042fb25ba1afd","name":"Yu","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/yylx.io\/blog\/wp-content\/litespeed\/avatar\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109","url":"https:\/\/yylx.io\/blog\/wp-content\/litespeed\/avatar\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109","contentUrl":"https:\/\/yylx.io\/blog\/wp-content\/litespeed\/avatar\/4cd7987c935fdbc8a48265040ea79397.jpg?ver=1782820109","caption":"Yu"},"url":"https:\/\/yylx.io\/blog\/author\/yu\/"}]}},"_links":{"self":[{"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":7,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions\/50"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/media\/55"}],"wp:attachment":[{"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}