{"id":88340,"date":"2026-07-31T23:08:37","date_gmt":"2026-07-31T15:08:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88340.html"},"modified":"2026-07-31T23:08:37","modified_gmt":"2026-07-31T15:08:37","slug":"codex-cli-%e4%bf%9d%e5%a7%86%e7%ba%a7%e5%ae%89%e8%a3%85%e4%b8%8e%e9%85%8d%e7%bd%ae%e6%95%99%e7%a8%8b%ef%bc%88windows-mac-linux-%e5%85%a8%e5%b9%b3%e5%8f%b0-vscode-%e9%9b%86%e6%88%90%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88340.html","title":{"rendered":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09"},"content":{"rendered":"<h2>Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b&#xff08;Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 &#043; VSCode \u96c6\u6210&#xff09;<\/h2>\n<p>\u4e00\u7bc7\u641e\u5b9a OpenAI \u63a8\u51fa\u7684\u547d\u4ee4\u884c AI \u7f16\u7a0b\u52a9\u624b Codex CLI \u7684\u5168\u6d41\u7a0b,\u4ece\u88c5\u73af\u5883\u5230\u8dd1\u8d77\u6765,\u518d\u5230\u63a5\u5165 VSCode \u63d2\u4ef6\u3002<\/p>\n<h3>\u524d\u8a00<\/h3>\n<p>\u6700\u8fd1 OpenAI \u628a Codex CLI \u5f00\u6e90\u540e,\u76f4\u63a5\u5728\u7ec8\u7aef\u91cc\u7528\u81ea\u7136\u8bed\u8a00\u6539\u4ee3\u7801\u3001\u8dd1\u547d\u4ee4\u3001\u67e5\u6587\u6863,\u4f53\u9a8c\u6bd4 IDE \u63d2\u4ef6\u66f4\u81ea\u7531,\u88ab\u4e0d\u5c11\u5f00\u53d1\u8005\u79f0\u4e3a&#034;\u547d\u4ee4\u884c\u91cc\u7684 Cursor&#034;\u3002<\/p>\n<p>\u4f46 Codex CLI \u9ed8\u8ba4\u7ed1\u5b9a\u7684\u662f OpenAI \u5b98\u65b9\u7684 ChatGPT Plus \/ Pro \/ Team \/ Enterprise \u8ba2\u9605\u8d26\u53f7,\u56fd\u5185\u76f4\u8fde\u4e5f\u6709\u95e8\u69db\u3002\u8fd9\u7bc7\u6559\u7a0b\u4f1a\u5e26\u4f60\u4ece\u96f6\u641e\u5b9a\u4e09\u4ef6\u4e8b:<\/p>\n<li>\u5728 Windows \/ Mac \/ Linux \u4efb\u610f\u5e73\u53f0\u88c5\u597d Codex CLI<\/li>\n<li>\u914d\u597d API,\u8dd1\u901a\u7b2c\u4e00\u4e2a\u4efb\u52a1<\/li>\n<li>\u628a\u5b83\u63a5\u5230 VSCode \u91cc,\u50cf\u63d2\u4ef6\u4e00\u6837\u7528<\/li>\n<h3>\u8bfb\u5b8c\u672c\u6587\u4f60\u80fd\u2026<\/h3>\n<ul>\n<li>\u4e09\u5e73\u53f0\u5168\u6d41\u7a0b\u5b89\u88c5 Codex CLI<\/li>\n<li>\u7528 API Key(\u975e\u8ba2\u9605\u8d26\u53f7)\u9a71\u52a8 Codex<\/li>\n<li>\u628a Codex \u96c6\u6210\u5230 VSCode<\/li>\n<li>\u81ea\u5df1\u6392\u67e5\u5e38\u89c1\u7684\u62a5\u9519<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e00\u3001\u51c6\u5907\u5de5\u4f5c<\/h3>\n<p>Codex CLI \u672c\u8d28\u4e0a\u662f\u4e00\u4e2a Node.js \u5305,\u6240\u4ee5\u7cfb\u7edf\u5f97\u5148\u6709 Node.js 18&#043;\u3002<\/p>\n<table>\n<tr>\u7cfb\u7edf\u989d\u5916\u4f9d\u8d56<\/tr>\n<tbody>\n<tr>\n<td>Windows<\/td>\n<td>Git Bash(\u63a8\u8350,\u540e\u9762\u811a\u672c\/\u8def\u5f84\u66f4\u53cb\u597d)<\/td>\n<\/tr>\n<tr>\n<td>Mac<\/td>\n<td>Homebrew(\u53ef\u9009,\u88c5 Node.js \u66f4\u65b9\u4fbf)<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td>curl \/ wget(\u7cfb\u7edf\u57fa\u672c\u90fd\u81ea\u5e26)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e8c\u3001Windows \u5e73\u53f0\u5b89\u88c5<\/h3>\n<h4>1. \u5b89\u88c5 Git Bash(\u524d\u7f6e\u6b65\u9aa4)<\/h4>\n<p>\u53bb Git \u5b98\u7f51 \u4e0b\u8f7d\u5bf9\u5e94\u4f60\u7cfb\u7edf\u7684\u7248\u672c,\u4e00\u8def\u300c\u4e0b\u4e00\u6b65\u300d\u88c5\u5b8c\u5373\u53ef\u3002<\/p>\n<h4>2. \u5b89\u88c5 Node.js<\/h4>\n<p>\u53bb Node.js \u5b98\u7f51 \u4e0b\u8f7d\u6700\u65b0\u7684 LTS \u7248\u672c,\u9ed8\u8ba4\u5b89\u88c5\u3002<\/p>\n<p>\u88c5\u5b8c\u6253\u5f00 CMD,\u8dd1\u4e00\u4e0b\u9a8c\u8bc1:<\/p>\n<p><span class=\"token function\">node<\/span> <span class=\"token parameter variable\">-v<\/span><br \/>\n<span class=\"token function\">npm<\/span> <span class=\"token parameter variable\">-v<\/span><\/p>\n<h4>3. \u5b89\u88c5 Codex CLI<\/h4>\n<p>\u6253\u5f00 CMD \u6216 PowerShell,\u6267\u884c:<\/p>\n<p><span class=\"token function\">npm<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-g<\/span> &#064;openai\/codex<\/p>\n<h4>4. \u914d\u7f6e API(\u91cd\u70b9)<\/h4>\n<p>Codex CLI \u9ed8\u8ba4\u662f\u8fde OpenAI \u5b98\u65b9\u7684 ChatGPT \u8ba2\u9605\u8d26\u53f7\u3002\u5982\u679c\u4f60\u6ca1\u4e70 Plus \/ Pro \u8ba2\u9605,\u6216\u8005\u60f3\u8981\u66f4\u7075\u6d3b\u3001\u4e0d\u6311\u8282\u70b9\u7684\u63a5\u5165\u65b9\u5f0f,\u53ef\u4ee5\u7528 API Key &#043; \u517c\u5bb9 OpenAI \u63a5\u53e3\u7684\u4e2d\u8f6c\u670d\u52a1 \u6765\u8dd1,\u6548\u679c\u4e00\u81f4,\u95e8\u69db\u4f4e\u5f88\u591a\u3002<\/p>\n<h5>4.1 \u83b7\u53d6 API Key<\/h5>\n<p>\u64cd\u4f5c\u6b65\u9aa4:<\/p>\n<li>\u6ce8\u518c\u5e76\u767b\u5f55<\/li>\n<li>\u8fdb\u5165\u300c\u4ee4\u724c\u300d\u9875\u9762<\/li>\n<li>\u5206\u7ec4\u4e00\u5b9a\u8981\u9009\u300ccodex \u4e13\u5c5e\u300d(Windows \u7528\u6237\u7684\u4e13\u5c5e\u5206\u7ec4,\u9009\u9519\u4f1a\u8c03\u4e0d\u901a)<\/li>\n<li>\u989d\u5ea6\u9009\u62e9\u300c\u65e0\u9650\u989d\u5ea6\u300d,\u4e0d\u8981\u9650\u5236\u6a21\u578b<\/li>\n<li>\u70b9\u521b\u5efa,\u628a\u751f\u6210\u7684 sk-xxx \u590d\u5236\u4e0b\u6765<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150835-6a6cba73d9b52.png\" alt=\"image\" \/><\/p>\n<h5>4.2 \u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p>\u8fdb\u5165 C:\\\\Users\\\\\u4f60\u7684\u7528\u6237\u540d\\\\.codex \u76ee\u5f55(\u6ca1\u6709\u5c31\u624b\u52a8\u5efa\u4e00\u4e2a,\u8bb0\u5f97\u5728\u6587\u4ef6\u8d44\u6e90\u7ba1\u7406\u5668\u91cc\u6253\u5f00\u300c\u663e\u793a\u9690\u85cf\u7684\u9879\u76ee\u300d),\u65b0\u5efa\u4e24\u4e2a\u6587\u4ef6:<\/p>\n<p>auth.json<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;OPENAI_API_KEY&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;sk-xxx&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>config.toml<\/p>\n<p>model_provider &#061; &#034;api111&#034;<br \/>\nmodel &#061; &#034;gpt-5-codex&#034;<br \/>\nmodel_reasoning_effort &#061; &#034;high&#034;<br \/>\ndisable_response_storage &#061; true<br \/>\npreferred_auth_method &#061; &#034;apikey&#034;<\/p>\n<p>[model_providers.api111]<br \/>\nname &#061; &#034;api111&#034;<br \/>\nbase_url &#061; &#034;https:\/\/selltoken.top\/v1&#034;<br \/>\nwire_api &#061; &#034;responses&#034;<\/p>\n<ul>\n<li>\u628a sk-xxx \u66ff\u6362\u6210\u4f60\u81ea\u5df1\u751f\u6210\u7684 key<\/li>\n<li>model_reasoning_effort \u53ef\u9009 high \/ medium \/ low,\u4ee3\u8868\u6a21\u578b\u7684\u601d\u8003\u5f3a\u5ea6<\/li>\n<li>wire_api &#061; &#034;responses&#034; \u8fd9\u4e00\u884c\u4e0d\u80fd\u6f0f,Codex CLI \u8d70\u7684\u662f OpenAI Responses \u63a5\u53e3,\u4e0d\u662f chat\/completions<\/li>\n<\/ul>\n<h4>5. \u542f\u52a8 Codex<\/h4>\n<p>\u91cd\u542f\u7ec8\u7aef!\u91cd\u542f\u7ec8\u7aef!\u91cd\u542f\u7ec8\u7aef!(\u91cd\u8981\u7684\u4e8b\u8bf4\u4e09\u904d)<\/p>\n<p>\u7136\u540e\u8fdb\u5165\u4f60\u7684\u5de5\u7a0b\u76ee\u5f55,\u8fd0\u884c:<\/p>\n<p>codex<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150836-6a6cba740341d.png\" alt=\"image\" \/><\/p>\n<p>\u7b2c\u4e00\u6b21\u4f1a\u63d0\u793a\u786e\u8ba4,\u6572\u56de\u8f66\u5373\u53ef\u3002\u987a\u5229\u7684\u8bdd\u5c31\u80fd\u770b\u5230 Codex \u7684\u6b22\u8fce\u754c\u9762,\u63a5\u4e0b\u6765\u7528\u81ea\u7136\u8bed\u8a00\u8ddf\u5b83\u4ea4\u4e92\u5c31\u884c\u3002<\/p>\n<h4>6. \u88c5 VSCode \u63d2\u4ef6<\/h4>\n<p>\u6253\u5f00 VSCode \u2192 \u6269\u5c55\u5546\u5e97,\u641c\u7d22 codex \u5b89\u88c5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150836-6a6cba74187ce.png\" alt=\"image\" \/><\/p>\n<p>\u88c5\u5b8c\u540e\u4f1a\u51fa\u73b0\u5728\u4fa7\u8fb9\u680f,\u70b9\u548c\u7ec8\u7aef\u91cc\u7684 Codex \u7528\u540c\u4e00\u4efd\u914d\u7f6e,\u6240\u4ee5\u80fd\u8dd1\u901a\u5c31\u90fd\u80fd\u8dd1\u901a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150836-6a6cba743517a.png\" alt=\"image\" \/><\/p>\n<hr \/>\n<h3>\u4e09\u3001Mac \u5e73\u53f0\u5b89\u88c5<\/h3>\n<h4>1. \u5b89\u88c5 Node.js<\/h4>\n<p>\u65b9\u5f0f\u4e00:\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305<\/p>\n<p>\u65b9\u5f0f\u4e8c(\u63a8\u8350):Homebrew<\/p>\n<p><span class=\"token comment\"># \u88c5 Homebrew(\u5df2\u88c5\u53ef\u8df3\u8fc7)<\/span><br \/>\n\/bin\/bash <span class=\"token parameter variable\">-c<\/span> <span class=\"token string\">&#034;<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-fsSL<\/span> https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh<span class=\"token variable\">)<\/span><\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u88c5 Node.js<\/span><br \/>\nbrew <span class=\"token function\">install<\/span> <span class=\"token function\">node<\/span><\/p>\n<h4>2. \u5b89\u88c5 Codex CLI<\/h4>\n<p><span class=\"token function\">npm<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-g<\/span> &#064;openai\/codex<\/p>\n<h4>3. \u914d\u7f6e API<\/h4>\n<h5>3.1 \u83b7\u53d6 API Key<\/h5>\n<p>\u53bb selltoken.top \u6ce8\u518c\u5e76\u767b\u5f55,\u4ee4\u724c\u5206\u7ec4\u9009\u62e9 \u300ccodex \u7279\u4f9b\u300d(Mac \u7528\u6237\u7684\u4e13\u5c5e\u5206\u7ec4)\u3002<\/p>\n<h5>3.2 \u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> ~\/.codex<br \/>\n<span class=\"token function\">touch<\/span> ~\/.codex\/auth.json<br \/>\n<span class=\"token function\">touch<\/span> ~\/.codex\/config.toml<\/p>\n<p>\u7f16\u8f91 auth.json(\u7528 vim \u6216\u4f60\u4e60\u60ef\u7684\u7f16\u8f91\u5668,\u6309 i \u8fdb\u5165\u63d2\u5165\u6a21\u5f0f,\u7c98\u5b8c\u6309 Esc &#043; :wq \u4fdd\u5b58):<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;OPENAI_API_KEY&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;sk-xxx&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7f16\u8f91 config.toml:<\/p>\n<p>model_provider &#061; &#034;api111&#034;<br \/>\nmodel &#061; &#034;gpt-5-codex&#034;<br \/>\nmodel_reasoning_effort &#061; &#034;high&#034;<br \/>\ndisable_response_storage &#061; true<br \/>\npreferred_auth_method &#061; &#034;apikey&#034;<\/p>\n<p>[model_providers.api111]<br \/>\nname &#061; &#034;api111&#034;<br \/>\nbase_url &#061; &#034;https:\/\/selltoken.top\/v1&#034;<br \/>\nwire_api &#061; &#034;responses&#034;<\/p>\n<h4>4. \u542f\u52a8 &amp; \u88c5 VSCode \u63d2\u4ef6<\/h4>\n<p>\u91cd\u542f\u7ec8\u7aef!\u7136\u540e:<\/p>\n<p>codex<\/p>\n<p>VSCode \u63d2\u4ef6\u540c Windows,\u6269\u5c55\u5546\u5e97\u641c codex \u88c5\u4e0a\u5373\u53ef\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001Linux \u5e73\u53f0\u5b89\u88c5<\/h3>\n<h4>1. \u5b89\u88c5 Node.js<\/h4>\n<p>Ubuntu \/ Debian<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-fsSL<\/span> https:\/\/deb.nodesource.com\/setup_lts.x <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token function\">bash<\/span> &#8211;<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> nodejs<\/p>\n<p>CentOS \/ RHEL \/ Fedora<\/p>\n<p><span class=\"token function\">sudo<\/span> dnf <span class=\"token function\">install<\/span> nodejs <span class=\"token function\">npm<\/span><br \/>\n<span class=\"token comment\"># \u6216<\/span><br \/>\n<span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> nodejs <span class=\"token function\">npm<\/span><\/p>\n<p>Arch Linux<\/p>\n<p><span class=\"token function\">sudo<\/span> pacman <span class=\"token parameter variable\">-S<\/span> nodejs <span class=\"token function\">npm<\/span><\/p>\n<h4>2. \u5b89\u88c5 Codex CLI<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">npm<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-g<\/span> &#064;openai\/codex<\/p>\n<h4>3. \u914d\u7f6e API<\/h4>\n<h5>3.1 \u83b7\u53d6 API Key<\/h5>\n<p>\u53bb selltoken.top,\u5206\u7ec4\u9009 \u300ccodex \u6e20\u9053-gpt\u300d(Linux \u7528\u6237\u4e13\u5c5e)\u3002<\/p>\n<h5>3.2 \u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> ~\/.codex<br \/>\n<span class=\"token function\">touch<\/span> ~\/.codex\/auth.json<br \/>\n<span class=\"token function\">touch<\/span> ~\/.codex\/config.toml<\/p>\n<p>auth.json<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;OPENAI_API_KEY&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;sk-xxx&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>config.toml<\/p>\n<p>model_provider &#061; &#034;api111&#034;<br \/>\nmodel &#061; &#034;gpt-5-codex&#034;<br \/>\nmodel_reasoning_effort &#061; &#034;high&#034;<br \/>\ndisable_response_storage &#061; true<br \/>\npreferred_auth_method &#061; &#034;apikey&#034;<\/p>\n<p>[model_providers.api111]<br \/>\nname &#061; &#034;api111&#034;<br \/>\nbase_url &#061; &#034;https:\/\/selltoken.top\/v1&#034;<br \/>\nwire_api &#061; &#034;responses&#034;<\/p>\n<h4>4. \u542f\u52a8<\/h4>\n<p>\u91cd\u542f\u7ec8\u7aef!\u7136\u540e:<\/p>\n<p>codex<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150836-6a6cba744c04e.png\" alt=\"image\" \/><\/p>\n<p>VSCode \u63d2\u4ef6\u540c\u4e0a,\u6269\u5c55\u5546\u5e97\u641c codex \u5373\u53ef\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150836-6a6cba746192c.png\" alt=\"image\" \/><\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898 FAQ<\/h3>\n<p>Q1:\u542f\u52a8\u62a5 401 \/ 403 \u600e\u4e48\u529e?<\/p>\n<ul>\n<li>\u68c0\u67e5 auth.json \u91cc\u7684 key \u6709\u6ca1\u6709\u590d\u5236\u9519(\u5f00\u5934\u7ed3\u5c3e\u522b\u5e26\u7a7a\u683c)<\/li>\n<li>\u53bb selltoken \u540e\u53f0\u786e\u8ba4 key \u72b6\u6001\u662f\u5426\u542f\u7528<\/li>\n<li>\u786e\u8ba4\u5206\u7ec4\u662f\u5426\u9009\u5bf9:Windows \u9009\u300ccodex \u4e13\u5c5e\u300d\u3001Mac \u9009\u300ccodex \u7279\u4f9b\u300d\u3001Linux \u9009\u300ccodex \u6e20\u9053-gpt\u300d,\u5206\u7ec4\u9009\u9519\u4f1a\u76f4\u63a5\u8c03\u4e0d\u901a<\/li>\n<\/ul>\n<p>Q2:\u62a5 model not found?<\/p>\n<ul>\n<li>config.toml \u91cc model \u5b57\u6bb5\u5fc5\u987b\u662f selltoken \u540e\u53f0\u5b9e\u9645\u5f00\u901a\u7684\u6a21\u578b<\/li>\n<li>\u91cd\u70b9\u68c0\u67e5 wire_api &#061; &#034;responses&#034; \u8fd9\u4e00\u884c\u6ca1\u6f0f\u2014\u2014Codex CLI \u8d70\u7684\u662f OpenAI Responses \u7aef\u70b9,\u4e0d\u662f chat\/completions<\/li>\n<\/ul>\n<p>Q3:\u8fd0\u884c\u5230\u4e00\u534a timeout?<\/p>\n<ul>\n<li>\u8bd5\u8bd5\u628a model_reasoning_effort \u8c03\u6210 medium \u6216 low,\u9ad8\u5f3a\u5ea6\u601d\u8003\u66f4\u8d39\u65f6<\/li>\n<li>\u68c0\u67e5 selltoken \u540e\u53f0\u989d\u5ea6\u662f\u5426\u5145\u8db3<\/li>\n<\/ul>\n<p>Q4:VSCode \u63d2\u4ef6\u8fde\u4e0d\u4e0a,\u4f46 CLI \u6ca1\u95ee\u9898?<\/p>\n<ul>\n<li>VSCode \u63d2\u4ef6\u548c CLI \u8bfb\u7684\u662f\u540c\u4e00\u4efd\u914d\u7f6e(~\/.codex\/ \u6216 C:\\\\Users\\\\xxx\\\\.codex\\\\),\u6240\u4ee5 CLI \u80fd\u7528\u63d2\u4ef6\u5c31\u4e00\u5b9a\u80fd\u7528<\/li>\n<li>\u88c5\u5b8c\u63d2\u4ef6\u540e\u91cd\u542f VSCode<\/li>\n<\/ul>\n<p>Q5:Mac \u4e0a codex \u547d\u4ee4\u627e\u4e0d\u5230?<\/p>\n<ul>\n<li>\u5168\u5c40 npm \u5305\u7684\u8def\u5f84\u6ca1\u52a0\u5230 PATH\u3002\u5148 npm config get prefix \u770b\u4e00\u4e0b,\u628a\u8f93\u51fa\u7684 bin \u76ee\u5f55\u52a0\u5230 ~\/.zshrc \u6216 ~\/.bash_profile \u91cc source \u4e00\u4e0b\u5373\u53ef<\/li>\n<li>\u6216\u8005\u4e34\u65f6\u7528 npx &#064;openai\/codex \u8dd1<\/li>\n<\/ul>\n<p>Q6:Windows \u4e0a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u627e\u4e0d\u5230?<\/p>\n<ul>\n<li>C:\\\\Users\\\\\u4f60\u7684\u7528\u6237\u540d\\\\.codex\\\\ \u662f\u9690\u85cf\u76ee\u5f55,\u5148\u5728\u6587\u4ef6\u8d44\u6e90\u7ba1\u7406\u5668 \u2192 \u67e5\u770b \u2192 \u52fe\u9009\u300c\u663e\u793a\u9690\u85cf\u7684\u9879\u76ee\u300d<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516d\u3001\u5199\u5728\u6700\u540e<\/h3>\n<p>OK,\u5230\u8fd9\u91cc\u4e09\u5e73\u53f0\u7684\u5b89\u88c5\u914d\u7f6e\u5c31\u8bb2\u5b8c\u4e86\u3002Codex CLI \u771f\u6b63\u4e0a\u624b\u7528\u4e00\u6bb5\u65f6\u95f4\u4f60\u4f1a\u53d1\u73b0,\u5b83\u5728\u6539 bug\u3001\u67e5\u6587\u6863\u3001\u5199\u4e00\u6b21\u6027\u811a\u672c\u8fd9\u4e9b\u300c\u5c0f\u800c\u788e\u300d\u7684\u4efb\u52a1\u4e0a\u7279\u522b\u8d81\u624b\u2014\u2014\u6bd4 IDE \u63d2\u4ef6\u66f4\u81ea\u7531,\u6bd4 ChatGPT \u7f51\u9875\u7248\u66f4\u8d34\u8fd1\u4ee3\u7801,\u4e2d\u95f4\u4e0d\u7528\u5207\u7a97\u53e3,\u6548\u7387\u63d0\u5347\u662f\u771f\u7684\u6709\u611f\u3002<\/p>\n<p>\u5982\u679c\u672c\u6587\u5bf9\u4f60\u6709\u5e2e\u52a9,\u70b9\u8d5e\u3001\u6536\u85cf\u5c31\u662f\u6700\u5927\u7684\u652f\u6301 &#x1f44d; \u8bc4\u8bba\u533a\u9047\u5230\u95ee\u9898\u968f\u65f6\u7559\u8a00,\u770b\u5230\u90fd\u4f1a\u56de\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u51c6\u5907\u5199 Codex CLI \u7684\u8fdb\u9636\u7528\u6cd5(\u81ea\u5b9a\u4e49\u6307\u4ee4\u3001\u4e0a\u4e0b\u6587\u538b\u7f29\u3001\u914d\u5408 git worktree \u5e72\u5927\u4e8b),\u6709\u60f3\u770b\u7684\u5185\u5bb9\u4e5f\u53ef\u4ee5\u8bc4\u8bba\u533a\u63d0~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b&#xff08;Windows \/ Mac \/ Linux \u5168\u5e73\u53f0  VSCode \u96c6\u6210&#xff09; \u4e00\u7bc7\u641e\u5b9a OpenAI \u63a8\u51fa\u7684\u547d\u4ee4\u884c AI \u7f16\u7a0b\u52a9\u624b Codex CLI \u7684\u5168\u6d41\u7a0b,\u4ece\u88c5\u73af\u5883\u5230\u8dd1\u8d77\u6765,\u518d\u5230\u63a5\u5165 VSCode \u63d2\u4ef6\u3002 \u524d\u8a00<br \/>\n\u6700\u8fd1 OpenAI \u628a Codex CLI \u5f00\u6e90\u540e,\u76f4\u63a5\u5728\u7ec8\u7aef\u91cc\u7528\u81ea\u7136\u8bed\u8a00\u6539\u4ee3\u7801\u3001\u8dd1\u547d\u4ee4\u3001\u67e5\u6587\u6863,\u4f53\u9a8c\u6bd4 IDE \u63d2\u4ef6\u66f4\u81ea\u7531,\u88ab\u4e0d\u5c11\u5f00\u53d1\u8005\u79f0\u4e3a\\&#8221;\u547d\u4ee4\u884c\u91cc\u7684 Cursor\\&#8221;\u3002<br \/>\n\u4f46 Codex <\/p>\n","protected":false},"author":2,"featured_media":88334,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,330,149],"topic":[],"class_list":["post-88340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-macos","tag-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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:\/\/www.wsisp.com\/helps\/88340.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b&#xff08;Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 VSCode \u96c6\u6210&#xff09; \u4e00\u7bc7\u641e\u5b9a OpenAI \u63a8\u51fa\u7684\u547d\u4ee4\u884c AI \u7f16\u7a0b\u52a9\u624b Codex CLI \u7684\u5168\u6d41\u7a0b,\u4ece\u88c5\u73af\u5883\u5230\u8dd1\u8d77\u6765,\u518d\u5230\u63a5\u5165 VSCode \u63d2\u4ef6\u3002 \u524d\u8a00 \u6700\u8fd1 OpenAI \u628a Codex CLI \u5f00\u6e90\u540e,\u76f4\u63a5\u5728\u7ec8\u7aef\u91cc\u7528\u81ea\u7136\u8bed\u8a00\u6539\u4ee3\u7801\u3001\u8dd1\u547d\u4ee4\u3001\u67e5\u6587\u6863,\u4f53\u9a8c\u6bd4 IDE \u63d2\u4ef6\u66f4\u81ea\u7531,\u88ab\u4e0d\u5c11\u5f00\u53d1\u8005\u79f0\u4e3a&quot;\u547d\u4ee4\u884c\u91cc\u7684 Cursor&quot;\u3002 \u4f46 Codex\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88340.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-31T15:08:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150835-6a6cba73d9b52.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88340.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88340.html\",\"name\":\"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T15:08:37+00:00\",\"dateModified\":\"2026-07-31T15:08:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88340.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88340.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88340.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/88340.html","og_locale":"zh_CN","og_type":"article","og_title":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b&#xff08;Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 VSCode \u96c6\u6210&#xff09; \u4e00\u7bc7\u641e\u5b9a OpenAI \u63a8\u51fa\u7684\u547d\u4ee4\u884c AI \u7f16\u7a0b\u52a9\u624b Codex CLI \u7684\u5168\u6d41\u7a0b,\u4ece\u88c5\u73af\u5883\u5230\u8dd1\u8d77\u6765,\u518d\u5230\u63a5\u5165 VSCode \u63d2\u4ef6\u3002 \u524d\u8a00 \u6700\u8fd1 OpenAI \u628a Codex CLI \u5f00\u6e90\u540e,\u76f4\u63a5\u5728\u7ec8\u7aef\u91cc\u7528\u81ea\u7136\u8bed\u8a00\u6539\u4ee3\u7801\u3001\u8dd1\u547d\u4ee4\u3001\u67e5\u6587\u6863,\u4f53\u9a8c\u6bd4 IDE \u63d2\u4ef6\u66f4\u81ea\u7531,\u88ab\u4e0d\u5c11\u5f00\u53d1\u8005\u79f0\u4e3a\"\u547d\u4ee4\u884c\u91cc\u7684 Cursor\"\u3002 \u4f46 Codex","og_url":"https:\/\/www.wsisp.com\/helps\/88340.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T15:08:37+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260731150835-6a6cba73d9b52.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88340.html","url":"https:\/\/www.wsisp.com\/helps\/88340.html","name":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T15:08:37+00:00","dateModified":"2026-07-31T15:08:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88340.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88340.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88340.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Codex CLI \u4fdd\u59c6\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6e\u6559\u7a0b\uff08Windows \/ Mac \/ Linux \u5168\u5e73\u53f0 + VSCode \u96c6\u6210\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=88340"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88340\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/88334"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88340"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}