{"id":62,"date":"2026-06-09T20:40:55","date_gmt":"2026-06-09T12:40:55","guid":{"rendered":"https:\/\/yylx.io\/blog\/?p=62"},"modified":"2026-06-09T20:40:55","modified_gmt":"2026-06-09T12:40:55","slug":"codex-cli-install-guide","status":"publish","type":"post","link":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/","title":{"rendered":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \u5b8c\u6574\u6307\u5357"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Codex CLI \u662f OpenAI \u7684\u547d\u4ee4\u884c coding agent\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u7ec8\u7aef\u91cc\u8bfb\u53d6\u9879\u76ee\u3001\u4fee\u6539\u4ee3\u7801\u3001\u8fd0\u884c\u547d\u4ee4\u548c\u534f\u52a9\u5b8c\u6210\u5f00\u53d1\u4efb\u52a1\u3002\u5b83\u9002\u5408\u559c\u6b22\u5728 Terminal\u3001PowerShell\u3001VSCode \u7ec8\u7aef\u6216 WSL \u4e2d\u5de5\u4f5c\u7684\u5f00\u53d1\u8005\u3002<\/p><p class=\"wp-block-paragraph\">\u672c\u6587\u6839\u636e OpenAI Codex \u5b98\u65b9\u6587\u6863\u548c openai\/codex \u5b98\u65b9\u4ed3\u5e93\u6574\u7406\uff0c\u7ed9\u51fa\u53ef\u590d\u5236\u7684\u5b89\u88c5\u547d\u4ee4\u3002\u5b89\u88c5\u524d\u8bf7\u786e\u8ba4\u4f60\u8bbf\u95ee\u7684\u662f <code>chatgpt.com<\/code>\u3001<code>developers.openai.com<\/code> \u6216 <code>github.com\/openai\/codex<\/code> \u8fd9\u4e9b\u5b98\u65b9\u6765\u6e90\uff0c\u4e0d\u8981\u4ece\u4e0d\u660e\u4e0b\u8f7d\u7ad9\u590d\u5236\u5b89\u88c5\u811a\u672c\u3002<\/p><h2 class=\"wp-block-heading\">\u5b89\u88c5\u524d\u786e\u8ba4<\/h2><p class=\"wp-block-paragraph\"><strong>\u8d26\u53f7\uff1a<\/strong>ChatGPT Plus\u3001Pro\u3001Business\u3001Edu \u548c Enterprise \u8ba1\u5212\u5305\u542b Codex\u3002\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528 OpenAI API key \u767b\u5f55\uff0c\u4f46\u9700\u8981\u989d\u5916\u914d\u7f6e\u3002<\/p><p class=\"wp-block-paragraph\"><strong>\u7cfb\u7edf\uff1a<\/strong>Codex CLI \u652f\u6301 macOS\u3001Windows \u548c Linux\u3002Windows \u7528\u6237\u53ef\u4ee5\u5728 PowerShell \u539f\u751f\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728 WSL2 \u4e2d\u4f7f\u7528 Linux \u73af\u5883\u3002<\/p><p class=\"wp-block-paragraph\"><strong>npm\uff1a<\/strong>\u5982\u679c\u9009\u62e9 npm \u5b89\u88c5\uff0c\u9700\u8981\u63d0\u524d\u5b89\u88c5 Node.js \u548c npm\u3002<\/p><p class=\"wp-block-paragraph\"><strong>\u5b89\u5168\uff1a<\/strong>npm \u5305\u8bf7\u786e\u8ba4\u662f <code>@openai\/codex<\/code>\uff0c\u4e0d\u8981\u5b89\u88c5\u540d\u5b57\u76f8\u4f3c\u7684\u7b2c\u4e09\u65b9\u5305\u3002<\/p><h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e00\uff1amacOS \/ Linux \u5b98\u65b9\u5b89\u88c5\u811a\u672c<\/h2><p class=\"wp-block-paragraph\">macOS \u548c Linux \u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u5b98\u65b9 standalone installer\uff1a<\/p><pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/chatgpt.com\/codex\/install.sh | sh<\/code><\/pre><p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u6267\u884c\uff1a<\/p><pre class=\"wp-block-code\"><code>codex --version\ncodex<\/code><\/pre><p class=\"wp-block-paragraph\">\u7b2c\u4e00\u6b21\u8fd0\u884c <code>codex<\/code> \u65f6\uff0c\u4f1a\u5f15\u5bfc\u4f60\u767b\u5f55\u3002\u901a\u5e38\u5efa\u8bae\u4f7f\u7528 ChatGPT \u8d26\u53f7\u767b\u5f55\uff1b\u5982\u679c\u4f60\u4f7f\u7528 API credits\uff0c\u4e5f\u53ef\u4ee5\u6309\u63d0\u793a\u9009\u62e9 API key \u65b9\u5f0f\u3002<\/p><p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u9700\u8981\u65e0\u4eba\u503c\u5b88\u5b89\u88c5\uff0c\u53ef\u4ee5\u8bbe\u7f6e <code>CODEX_NON_INTERACTIVE=1<\/code>\uff1a<\/p><pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/chatgpt.com\/codex\/install.sh | CODEX_NON_INTERACTIVE=1 sh<\/code><\/pre><h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e8c\uff1aWindows PowerShell \u5b89\u88c5<\/h2><p class=\"wp-block-paragraph\">Windows \u7528\u6237\u53ef\u4ee5\u6253\u5f00 PowerShell\uff0c\u6267\u884c\u5b98\u65b9\u4ed3\u5e93\u7ed9\u51fa\u7684\u5b89\u88c5\u547d\u4ee4\uff1a<\/p><pre class=\"wp-block-code\"><code>powershell -ExecutionPolicy ByPass -c \"irm https:\/\/chatgpt.com\/codex\/install.ps1 | iex\"<\/code><\/pre><p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u6253\u5f00 PowerShell\uff0c\u68c0\u67e5\u7248\u672c\u5e76\u542f\u52a8\uff1a<\/p><pre class=\"wp-block-code\"><code>codex --version\ncodex<\/code><\/pre><p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u7684\u9879\u76ee\u4e3b\u8981\u8fd0\u884c\u5728 Linux \u5de5\u5177\u94fe\u91cc\uff0c\u6bd4\u5982 Docker\u3001Python\u3001Node.js \u6216 Rust \u9879\u76ee\uff0c\u4e5f\u53ef\u4ee5\u5728 WSL2 \u91cc\u5b89\u88c5 Codex CLI\u3002WSL2 \u4e2d\u4f7f\u7528 macOS\/Linux \u90a3\u6761\u5b89\u88c5\u547d\u4ee4\u5373\u53ef\u3002<\/p><h2 class=\"wp-block-heading\">\u65b9\u6cd5\u4e09\uff1anpm \u5b89\u88c5<\/h2><p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u5df2\u7ecf\u5b89\u88c5 Node.js \u548c npm\uff0c\u53ef\u4ee5\u4f7f\u7528 npm \u5168\u5c40\u5b89\u88c5\uff1a<\/p><pre class=\"wp-block-code\"><code>npm install -g @openai\/codex<\/code><\/pre><p class=\"wp-block-paragraph\">\u5347\u7ea7 npm \u5b89\u88c5\u7248\u672c\uff1a<\/p><pre class=\"wp-block-code\"><code>npm install -g @openai\/codex@latest<\/code><\/pre><p class=\"wp-block-paragraph\">\u5378\u8f7d npm \u5b89\u88c5\u7248\u672c\uff1a<\/p><pre class=\"wp-block-code\"><code>npm uninstall -g @openai\/codex<\/code><\/pre><p class=\"wp-block-paragraph\">\u4e0d\u5efa\u8bae\u968f\u624b\u4f7f\u7528 <code>sudo npm install -g<\/code>\u3002\u5982\u679c\u63d0\u793a\u6743\u9650\u4e0d\u8db3\uff0c\u4f18\u5148\u68c0\u67e5 npm \u5168\u5c40\u76ee\u5f55\uff0c\u6216\u8005\u4f7f\u7528 nvm \u91cd\u65b0\u7ba1\u7406 Node.js \u73af\u5883\u3002<\/p><h2 class=\"wp-block-heading\">\u65b9\u6cd5\u56db\uff1aHomebrew \u5b89\u88c5<\/h2><p class=\"wp-block-paragraph\">macOS \u7528\u6237\u4e5f\u53ef\u4ee5\u7528 Homebrew cask \u5b89\u88c5\uff1a<\/p><pre class=\"wp-block-code\"><code>brew install --cask codex<\/code><\/pre><p class=\"wp-block-paragraph\">\u5347\u7ea7 Homebrew \u5b89\u88c5\u7248\u672c\uff1a<\/p><pre class=\"wp-block-code\"><code>brew upgrade --cask codex<\/code><\/pre><p class=\"wp-block-paragraph\">\u5378\u8f7d Homebrew \u5b89\u88c5\u7248\u672c\uff1a<\/p><pre class=\"wp-block-code\"><code>brew uninstall --cask codex<\/code><\/pre><h2 class=\"wp-block-heading\">\u9996\u6b21\u8fd0\u884c Codex CLI<\/h2><p class=\"wp-block-paragraph\">\u8fdb\u5165\u4e00\u4e2a\u9879\u76ee\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\uff1a<\/p><pre class=\"wp-block-code\"><code>cd your-project\ncodex<\/code><\/pre><p class=\"wp-block-paragraph\">\u4f60\u53ef\u4ee5\u5148\u8ba9 Codex \u505a\u4e00\u4e2a\u4f4e\u98ce\u9669\u4efb\u52a1\uff0c\u4f8b\u5982\u89e3\u91ca\u9879\u76ee\u7ed3\u6784\uff1a<\/p><pre class=\"wp-block-code\"><code>explain this project structure<\/code><\/pre><p class=\"wp-block-paragraph\">\u7b49\u786e\u8ba4\u5b83\u80fd\u6b63\u5e38\u8bfb\u53d6\u9879\u76ee\u3001\u663e\u793a\u8ba1\u5212\u548c\u8bf7\u6c42\u6743\u9650\u540e\uff0c\u518d\u8ba9\u5b83\u4fee\u6539\u6587\u4ef6\u6216\u8fd0\u884c\u6d4b\u8bd5\u3002<\/p><h2 class=\"wp-block-heading\">\u56fd\u5185\u7f51\u7edc\u73af\u5883\u4e0b\u600e\u4e48\u5904\u7406<\/h2><p class=\"wp-block-paragraph\">\u5982\u679c\u5b89\u88c5\u811a\u672c\u4e0b\u8f7d\u5931\u8d25\uff0c\u5148\u5224\u65ad\u662f\u4e0d\u662f <code>chatgpt.com\/codex\/install.sh<\/code> \u6216 <code>install.ps1<\/code> \u65e0\u6cd5\u8bbf\u95ee\u3002\u8fd9\u7c7b\u95ee\u9898\u901a\u5e38\u4e0d\u662f\u547d\u4ee4\u5199\u9519\uff0c\u800c\u662f\u7f51\u7edc\u8bbf\u95ee\u94fe\u8def\u4e0d\u7a33\u5b9a\u3002<\/p><p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u7528 npm \u5b89\u88c5\uff0c\u4e14\u53ea\u662f npm registry \u6162\uff0c\u53ef\u4ee5\u4e34\u65f6\u4f7f\u7528\u955c\u50cf\u6e90\uff1a<\/p><pre class=\"wp-block-code\"><code>npm install -g @openai\/codex --registry=https:\/\/registry.npmmirror.com<\/code><\/pre><p class=\"wp-block-paragraph\">\u4f46 npm \u955c\u50cf\u53ea\u80fd\u89e3\u51b3\u4e0b\u8f7d npm \u5305\u6162\u7684\u95ee\u9898\uff0c\u4e0d\u80fd\u89e3\u51b3 Codex \u767b\u5f55\u3001ChatGPT \u8d26\u53f7\u8bbf\u95ee\u3001OpenAI \u670d\u52a1\u8bf7\u6c42\u8d85\u65f6\u7b49\u95ee\u9898\u3002<\/p><p class=\"wp-block-paragraph\">\u5982\u679c Codex CLI \u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff0c\u4f46\u8fd0\u884c <code>codex<\/code> \u65f6\u767b\u5f55\u5931\u8d25\u3001\u8bf7\u6c42\u8d85\u65f6\u6216\u670d\u52a1\u8fde\u63a5\u4e0d\u7a33\u5b9a\uff0c\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 OpenAI\u3001Claude\u3001Gemini \u7b49\u670d\u52a1\u7684\u8bbf\u95ee\u7a33\u5b9a\u6027\u3002<\/p><h2 class=\"wp-block-heading\">\u5e38\u89c1\u95ee\u9898<\/h2><h3 class=\"wp-block-heading\">\u63d0\u793a codex: command not found \u600e\u4e48\u529e\uff1f<\/h3><p class=\"wp-block-paragraph\">\u5148\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\uff0c\u518d\u6267\u884c <code>codex --version<\/code>\u3002\u5982\u679c\u4ecd\u7136\u5931\u8d25\uff0c\u68c0\u67e5\u5b89\u88c5\u76ee\u5f55\u662f\u5426\u5df2\u7ecf\u52a0\u5165 PATH\u3002npm \u7528\u6237\u8fd8\u8981\u68c0\u67e5 npm \u5168\u5c40 bin \u76ee\u5f55\u3002<\/p><h3 class=\"wp-block-heading\">npm \u5b89\u88c5\u5361\u4f4f\u600e\u4e48\u529e\uff1f<\/h3><p class=\"wp-block-paragraph\">\u5148\u786e\u8ba4 npm registry \u662f\u5426\u80fd\u8bbf\u95ee\u3002\u53ef\u4ee5\u4e34\u65f6\u4f7f\u7528\u955c\u50cf\u6e90\uff0c\u4e5f\u53ef\u4ee5\u6362\u7f51\u7edc\u73af\u5883\u540e\u91cd\u8bd5\u3002\u4e0d\u8981\u6df7\u7528\u591a\u4e2a\u6765\u6e90\u5b89\u88c5\u540e\u7acb\u523b\u8986\u76d6\uff0c\u5426\u5219\u6392\u67e5\u7248\u672c\u4f1a\u53d8\u590d\u6742\u3002<\/p><h3 class=\"wp-block-heading\">Codex CLI \u548c Codex App \u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3><p class=\"wp-block-paragraph\">Codex CLI \u9002\u5408\u5728\u7ec8\u7aef\u91cc\u76f4\u63a5\u5904\u7406\u672c\u5730\u9879\u76ee\uff1bCodex App \u66f4\u9002\u5408\u684c\u9762\u4ea4\u4e92\u3001\u9879\u76ee\u7ebf\u7a0b\u548c\u53ef\u89c6\u5316\u5ba1\u67e5\u3002\u4e24\u8005\u5e95\u5c42\u80fd\u529b\u76f8\u8fd1\uff0c\u4f46\u5165\u53e3\u548c\u4f53\u9a8c\u4e0d\u540c\u3002<\/p><h2 class=\"wp-block-heading\">\u603b\u7ed3<\/h2><p class=\"wp-block-paragraph\">\u5b89\u88c5 Codex CLI\uff0cmacOS \u548c Linux \u63a8\u8350\u5148\u7528\u5b98\u65b9 standalone installer\uff1bWindows \u63a8\u8350\u7528 PowerShell \u5b89\u88c5\uff1b\u5df2\u7ecf\u719f\u6089 Node.js \u7684\u7528\u6237\u53ef\u4ee5\u7528 <code>npm install -g @openai\/codex<\/code>\uff1bmacOS \u7528\u6237\u4e5f\u53ef\u4ee5\u9009\u62e9 Homebrew\u3002<\/p><p class=\"wp-block-paragraph\">\u5b89\u88c5\u540e\u4e00\u5b9a\u6267\u884c <code>codex --version<\/code> \u548c <code>codex<\/code>\u3002\u8fd9\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\u4e0d\u540c\u95ee\u9898\u3002<\/p><p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u6b63\u5728\u642d\u5efa AI \u5f00\u53d1\u73af\u5883\uff0c\u5e0c\u671b Codex\u3001ChatGPT\u3001Claude\u3001Gemini \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>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u6574\u7406 Codex CLI \u5728 macOS\u3001Linux\u3001Windows PowerShell\u3001npm \u548c Homebrew \u4e0b\u7684\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u7248\u672c\u9a8c\u8bc1\u3001\u5347\u7ea7\u65b9\u5f0f\u3001\u767b\u5f55\u65b9\u5f0f\u548c\u56fd\u5185\u7f51\u7edc\u6392\u67e5\u5efa\u8bae\u3002<\/p>\n","protected":false},"author":2,"featured_media":56,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-62","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>Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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\/codex-cli-install-guide\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u6574\u7406 Codex CLI \u5728 macOS\u3001Linux\u3001Windows PowerShell\u3001npm \u548c Homebrew \u4e0b\u7684\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u7248\u672c\u9a8c\u8bc1\u3001\u5347\u7ea7\u65b9\u5f0f\u3001\u767b\u5f55\u65b9\u5f0f\u548c\u56fd\u5185\u7f51\u7edc\u6392\u67e5\u5efa\u8bae\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-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:40:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.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\\\/codex-cli-install-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/\"},\"author\":{\"name\":\"Yu\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#\\\/schema\\\/person\\\/2cde4f7a47af39013dd042fb25ba1afd\"},\"headline\":\"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \u5b8c\u6574\u6307\u5357\",\"datePublished\":\"2026-06-09T12:40:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/\"},\"wordCount\":147,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/codex-cli-install-guide.png\",\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/\",\"name\":\"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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\\\/codex-cli-install-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/codex-cli-install-guide.png\",\"datePublished\":\"2026-06-09T12:40:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/#\\\/schema\\\/person\\\/2cde4f7a47af39013dd042fb25ba1afd\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/codex-cli-install-guide.png\",\"contentUrl\":\"https:\\\/\\\/yylx.io/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/codex-cli-install-guide.png\",\"width\":1200,\"height\":630,\"caption\":\"Codex CLI \u5b89\u88c5\u6307\u5357\u5c01\u9762\u56fe\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/yylx.io/blog\\\/2026\\\/06\\\/09\\\/codex-cli-install-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/yylx.io/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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\/codex-cli-install-guide\/","og_locale":"zh_CN","og_type":"article","og_title":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \u5b8c\u6574\u6307\u5357 - \u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","og_description":"\u672c\u6587\u6574\u7406 Codex CLI \u5728 macOS\u3001Linux\u3001Windows PowerShell\u3001npm \u548c Homebrew \u4e0b\u7684\u5b89\u88c5\u547d\u4ee4\uff0c\u5e76\u9644\u5e26\u7248\u672c\u9a8c\u8bc1\u3001\u5347\u7ea7\u65b9\u5f0f\u3001\u767b\u5f55\u65b9\u5f0f\u548c\u56fd\u5185\u7f51\u7edc\u6392\u67e5\u5efa\u8bae\u3002","og_url":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/","og_site_name":"\u9c7c\u9c7c\u8fde\u7ebf YYLX.IO\uff5cAI\u4e2d\u8f6c\u7ad9\u535a\u5ba2","article_published_time":"2026-06-09T12:40:55+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.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\/codex-cli-install-guide\/#article","isPartOf":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/"},"author":{"name":"Yu","@id":"https:\/\/yylx.io\/blog\/#\/schema\/person\/2cde4f7a47af39013dd042fb25ba1afd"},"headline":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \u5b8c\u6574\u6307\u5357","datePublished":"2026-06-09T12:40:55+00:00","mainEntityOfPage":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/"},"wordCount":147,"commentCount":0,"image":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.png","inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/","url":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/","name":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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\/codex-cli-install-guide\/#primaryimage"},"image":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.png","datePublished":"2026-06-09T12:40:55+00:00","author":{"@id":"https:\/\/yylx.io\/blog\/#\/schema\/person\/2cde4f7a47af39013dd042fb25ba1afd"},"breadcrumb":{"@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#primaryimage","url":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.png","contentUrl":"https:\/\/yylx.io\/blog\/wp-content\/uploads\/2026\/06\/codex-cli-install-guide.png","width":1200,"height":630,"caption":"Codex CLI \u5b89\u88c5\u6307\u5357\u5c01\u9762\u56fe"},{"@type":"BreadcrumbList","@id":"https:\/\/yylx.io\/blog\/2026\/06\/09\/codex-cli-install-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/yylx.io\/blog\/"},{"@type":"ListItem","position":2,"name":"Codex CLI \u5b89\u88c5\u6559\u7a0b\uff1amacOS\u3001Windows \u548c npm \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\/62","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=62"}],"version-history":[{"count":1,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/posts\/62\/revisions\/63"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/media\/56"}],"wp:attachment":[{"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yylx.io\/blog\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}