{"id":97291,"date":"2026-08-29T08:37:03","date_gmt":"2026-08-29T00:37:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/97291.html"},"modified":"2026-08-29T08:37:03","modified_gmt":"2026-08-29T00:37:03","slug":"codex-cli-%e9%9d%9e%e4%ba%a4%e4%ba%92%e6%a8%a1%e5%bc%8f%ef%bc%9a%e6%8a%8a-ai-%e6%8e%a5%e5%85%a5%e4%bd%a0%e7%9a%84-ci-cd-%e6%b5%81%e6%b0%b4%e7%ba%bf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/97291.html","title":{"rendered":"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf"},"content":{"rendered":"<h2>Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f&#xff1a;\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf<\/h2>\n<p>\u672c\u7cfb\u5217\u6587\u7ae0\u57fa\u4e8e Codex CLI \u6e90\u7801\u6df1\u5ea6\u5206\u6790&#xff0c;\u672c\u6587\u805a\u7126 codex exec \u547d\u4ee4&#xff0c;\u6559\u4f60\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u3002<\/p>\n<p>\u5168\u7f51\u552f\u4e00\u4ece Rust \u6e90\u7801\u5c42\u9762\u62c6\u89e3 Codex CLI \u7684\u7cfb\u5217<\/p>\n<h3>\u96f6\u3001\u9605\u8bfb\u6536\u76ca<\/h3>\n<p>\u8bfb\u5b8c\u672c\u6587\u4f60\u5c06\u7406\u89e3&#xff1a;<\/p>\n<ul>\n<li>codex exec \u7684\u5b8c\u6574\u7528\u6cd5\u548c\u53c2\u6570\u4f53\u7cfb<\/li>\n<li>\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165 GitHub Actions \/ GitLab CI<\/li>\n<li>\u975e\u4ea4\u4e92\u6a21\u5f0f\u7684\u8f93\u5165\u8f93\u51fa\u683c\u5f0f&#xff08;JSON\/\u6587\u672c&#xff09;<\/li>\n<li>\u6e90\u7801\u4e2d codex-rs\/exec\/ \u7684\u5b9e\u73b0\u539f\u7406<\/li>\n<\/ul>\n<h3>\u4e00\u3001exec \u547d\u4ee4\u6982\u89c8<\/h3>\n<p>codex exec \u662f Codex CLI \u7684\u975e\u4ea4\u4e92\u6a21\u5f0f&#xff0c;\u9002\u5408\u811a\u672c\u5316\u548c\u81ea\u52a8\u5316\u573a\u666f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u57fa\u672c\u7528\u6cd5<\/span><br \/>\ncodex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u4fee\u590d src\/main.rs \u4e2d\u7684\u6240\u6709\u7f16\u8bd1\u9519\u8bef&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u7b80\u5199<\/span><br \/>\ncodex e <span class=\"token string\">&#034;\u6dfb\u52a0\u5355\u5143\u6d4b\u8bd5&#034;<\/span><\/p>\n<h4>\u6838\u5fc3\u53c2\u6570<\/h4>\n<table>\n<tr>\u53c2\u6570\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>PROMPT<\/td>\n<td>\u4efb\u52a1\u63cf\u8ff0&#xff08;\u4f4d\u7f6e\u53c2\u6570&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>&#8211;json<\/td>\n<td>\u4ee5 JSON \u683c\u5f0f\u8f93\u51fa\u7ed3\u679c<\/td>\n<\/tr>\n<tr>\n<td>&#8211;model<\/td>\n<td>\u6307\u5b9a\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td>&#8211;approval-policy<\/td>\n<td>\u8986\u76d6\u5ba1\u6279\u7b56\u7565<\/td>\n<\/tr>\n<tr>\n<td>&#8211;no-sandbox<\/td>\n<td>\u7981\u7528\u6c99\u7bb1&#xff08;\u8c28\u614e\u4f7f\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>&#8211;cwd<\/td>\n<td>\u6307\u5b9a\u5de5\u4f5c\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>&#8211;max-turns<\/td>\n<td>\u6700\u5927 Turn \u6570<\/td>\n<\/tr>\n<tr>\n<td>&#8211;timeout<\/td>\n<td>\u8d85\u65f6\u65f6\u95f4&#xff08;\u79d2&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u6e90\u7801\u7ed3\u6784<\/h4>\n<p><span class=\"token comment\">\/\/ \u6e90\u7801\u4f4d\u7f6e&#xff1a;codex-rs\/exec\/src\/<\/span><\/p>\n<p><span class=\"token keyword\">pub<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token type-definition class-name\">Cli<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/\/ \u4efb\u52a1\u63cf\u8ff0<\/span><br \/>\n    <span class=\"token attribute attr-name\">#[arg(value_name &#061; <span class=\"token string\">&#034;PROMPT&#034;<\/span>)]<\/span><br \/>\n    <span class=\"token keyword\">pub<\/span> prompt<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">Option<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/\/ \u4ece stdin \u8bfb\u53d6 prompt<\/span><br \/>\n    <span class=\"token attribute attr-name\">#[arg(long &#061; <span class=\"token string\">&#034;stdin&#034;<\/span>, default_value_t &#061; false)]<\/span><br \/>\n    <span class=\"token keyword\">pub<\/span> read_prompt_from_stdin<span class=\"token punctuation\">:<\/span> <span class=\"token keyword\">bool<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/\/ JSON \u683c\u5f0f\u8f93\u51fa<\/span><br \/>\n    <span class=\"token attribute attr-name\">#[arg(long &#061; <span class=\"token string\">&#034;json&#034;<\/span>, default_value_t &#061; false)]<\/span><br \/>\n    <span class=\"token keyword\">pub<\/span> json_output<span class=\"token punctuation\">:<\/span> <span class=\"token keyword\">bool<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/\/ \u6700\u5927 Turn \u6570<\/span><br \/>\n    <span class=\"token attribute attr-name\">#[arg(long &#061; <span class=\"token string\">&#034;max-turns&#034;<\/span>)]<\/span><br \/>\n    <span class=\"token keyword\">pub<\/span> max_turns<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">Option<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">usize<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/\/ \u8d85\u65f6\u65f6\u95f4<\/span><br \/>\n    <span class=\"token attribute attr-name\">#[arg(long &#061; <span class=\"token string\">&#034;timeout&#034;<\/span>)]<\/span><br \/>\n    <span class=\"token keyword\">pub<\/span> timeout_secs<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">Option<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">u64<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u4e8c\u3001\u5b9e\u6218\u573a\u666f<\/h3>\n<h4>2.1 \u81ea\u52a8\u4fee\u590d\u7f16\u8bd1\u9519\u8bef<\/h4>\n<p><span class=\"token comment\"># \u5c06\u7f16\u8bd1\u9519\u8bef\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9 Codex<\/span><br \/>\n<span class=\"token function\">cargo<\/span> build <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span> <span class=\"token operator\">|<\/span> codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">&#8211;stdin<\/span> <span class=\"token string\">&#034;\u4fee\u590d\u8fd9\u4e9b\u7f16\u8bd1\u9519\u8bef&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u6216\u6307\u5b9a\u6587\u4ef6<\/span><br \/>\ncodex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u4fee\u590d src\/main.rs \u4e2d\u7684\u7f16\u8bd1\u9519\u8bef&#xff0c;\u4e0d\u8981\u6539\u53d8\u529f\u80fd&#034;<\/span><\/p>\n<h4>2.2 \u81ea\u52a8\u751f\u6210\u5355\u5143\u6d4b\u8bd5<\/h4>\n<p>codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u4e3a src\/lib.rs \u4e2d\u7684\u6240\u6709\u516c\u5f00\u51fd\u6570\u751f\u6210\u5355\u5143\u6d4b\u8bd5&#xff0c;\u5199\u5165 tests\/ \u76ee\u5f55&#034;<\/span><\/p>\n<h4>2.3 \u4ee3\u7801\u683c\u5f0f\u5316\u4e0e Lint \u4fee\u590d<\/h4>\n<p>codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u68c0\u67e5 src\/ \u76ee\u5f55\u4e0b\u7684\u6240\u6709 Rust \u6587\u4ef6&#xff0c;\u4fee\u590d clippy \u8b66\u544a&#034;<\/span><\/p>\n<h4>2.4 \u81ea\u52a8\u751f\u6210\u6587\u6863<\/h4>\n<p>codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u4e3a src\/ \u76ee\u5f55\u4e0b\u6240\u6709\u516c\u5f00 API \u6dfb\u52a0 Rust doc \u6ce8\u91ca&#034;<\/span><\/p>\n<h4>2.5 \u4f9d\u8d56\u66f4\u65b0<\/h4>\n<p>codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token string\">&#034;\u68c0\u67e5 Cargo.toml \u4e2d\u7684\u4f9d\u8d56\u7248\u672c&#xff0c;\u66f4\u65b0\u5230\u6700\u65b0\u517c\u5bb9\u7248\u672c&#xff0c;\u786e\u4fdd\u7f16\u8bd1\u901a\u8fc7&#034;<\/span><\/p>\n<h3>\u4e09\u3001GitHub Actions \u96c6\u6210<\/h3>\n<h4>3.1 \u81ea\u52a8\u4fee\u590d CI \u5931\u8d25<\/h4>\n<p><span class=\"token comment\"># .github\/workflows\/ai-fix.yml<\/span><br \/>\n<span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> AI Auto Fix<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">workflow_run<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">workflows<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;CI&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token key atrule\">types<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>completed<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">ai-fix<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> github.event.workflow_run.conclusion &#061;&#061; &#039;failure&#039; <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Install Codex CLI<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          curl -fsSL https:\/\/chatgpt.com\/codex\/install.sh | sh<br \/>\n          echo &#034;$HOME\/.local\/bin&#034; &gt;&gt; $GITHUB_PATH<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Get CI Error Log<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          # \u83b7\u53d6 CI \u5931\u8d25\u65e5\u5fd7<br \/>\n          gh run view ${{ github.event.workflow_run.id }} &#8211;log &gt; ci-error.log<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> AI Fix<br \/>\n        <span class=\"token key atrule\">env<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">CODEX_API_KEY<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.CODEX_API_KEY <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          cat ci-error.log | codex exec &#8211;stdin \\\\<br \/>\n            &#8211;json \\\\<br \/>\n            &#8211;max-turns 5 \\\\<br \/>\n            &#8211;timeout 300 \\\\<br \/>\n            &#034;\u5206\u6790 CI \u5931\u8d25\u539f\u56e0\u5e76\u4fee\u590d\u4ee3\u7801\u3002\u53ea\u4fee\u6539\u6e90\u6587\u4ef6&#xff0c;\u4e0d\u8981\u4fee\u6539 CI \u914d\u7f6e\u3002&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Create PR<br \/>\n        <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> success()<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          git config user.name &#034;codex-bot&#034;<br \/>\n          git config user.email &#034;bot&#064;example.com&#034;<br \/>\n          git checkout -b ai-fix-${{ github.run_id }}<br \/>\n          git add .<br \/>\n          git commit -m &#034;&#x1f916; AI auto-fix for CI failure&#034;<br \/>\n          git push origin ai-fix-${{ github.run_id }}<br \/>\n          gh pr create &#8211;title &#034;&#x1f916; AI Auto Fix&#034; &#8211;body &#034;AI \u81ea\u52a8\u4fee\u590d CI \u5931\u8d25&#034;<\/span><\/p>\n<h4>3.2 \u81ea\u52a8 Code Review<\/h4>\n<p><span class=\"token comment\"># .github\/workflows\/ai-review.yml<\/span><br \/>\n<span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> AI Code Review<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">pull_request<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">types<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>opened<span class=\"token punctuation\">,<\/span> synchronize<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">ai-review<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">fetch-depth<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">0<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Install Codex CLI<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          curl -fsSL https:\/\/chatgpt.com\/codex\/install.sh | sh<br \/>\n          echo &#034;$HOME\/.local\/bin&#034; &gt;&gt; $GITHUB_PATH<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> AI Review<br \/>\n        <span class=\"token key atrule\">env<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">CODEX_API_KEY<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.CODEX_API_KEY <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          codex review \\\\<br \/>\n            &#8211;base ${{ github.event.pull_request.base.sha }} \\\\<br \/>\n            &#8211;json \\\\<br \/>\n            &#8211;output review.json<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Post Review<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          # \u89e3\u6790 review.json \u5e76\u4f5c\u4e3a PR comment \u53d1\u5e03<br \/>\n          gh pr comment ${{ github.event.pull_request.number }} \\\\<br \/>\n            &#8211;body &#034;$(cat review.json | jq -r &#039;.summary&#039;)&#034;<\/span><\/p>\n<h4>3.3 \u81ea\u52a8\u751f\u6210 Release Notes<\/h4>\n<p><span class=\"token comment\"># .github\/workflows\/ai-release-notes.yml<\/span><br \/>\n<span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> AI Release Notes<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">push<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">tags<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token string\">&#039;v*&#039;<\/span><\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">release-notes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">fetch-depth<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">0<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Install Codex CLI<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          curl -fsSL https:\/\/chatgpt.com\/codex\/install.sh | sh<br \/>\n          echo &#034;$HOME\/.local\/bin&#034; &gt;&gt; $GITHUB_PATH<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Generate Release Notes<br \/>\n        <span class=\"token key atrule\">env<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">CODEX_API_KEY<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.CODEX_API_KEY <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          # \u83b7\u53d6 git log<br \/>\n          PREV_TAG&#061;$(git describe &#8211;tags &#8211;abbrev&#061;0 HEAD^ 2&gt;\/dev\/null || echo &#034;&#034;)<br \/>\n          git log ${PREV_TAG}..HEAD &#8211;oneline &gt; changes.txt<\/span><\/p>\n<p>          cat changes.txt <span class=\"token punctuation\">|<\/span> codex exec <span class=\"token punctuation\">&#8211;<\/span><span class=\"token punctuation\">&#8211;<\/span>stdin \\\\<br \/>\n            <span class=\"token punctuation\">&#8211;<\/span><span class=\"token punctuation\">&#8211;<\/span>json \\\\<br \/>\n            &#034;\u6839\u636e\u8fd9\u4e9b git commits \u751f\u6210 Release Notes&#xff0c;\u6309 Feature\/BugFix\/Breaking \u5206\u7c7b&#034;<\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Create Release<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n          gh release create ${{ github.ref_name }} \\\\<br \/>\n            &#8211;title &#034;${{ github.ref_name }}&#034; \\\\<br \/>\n            &#8211;notes &#034;$(cat release-notes.md)&#034;<\/span><\/p>\n<h3>\u56db\u3001GitLab CI \u96c6\u6210<\/h3>\n<p><span class=\"token comment\"># .gitlab-ci.yml<\/span><br \/>\n<span class=\"token key atrule\">ai-auto-fix<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">stage<\/span><span class=\"token punctuation\">:<\/span> fix<br \/>\n  <span class=\"token key atrule\">when<\/span><span class=\"token punctuation\">:<\/span> on_failure<br \/>\n  <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> rust<span class=\"token punctuation\">:<\/span>latest<br \/>\n  <span class=\"token key atrule\">before_script<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> curl <span class=\"token punctuation\">&#8211;<\/span>fsSL https<span class=\"token punctuation\">:<\/span>\/\/chatgpt.com\/codex\/install.sh <span class=\"token punctuation\">|<\/span> sh<br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> export PATH&#061;&#034;$HOME\/.local\/bin<span class=\"token punctuation\">:<\/span>$PATH&#034;<br \/>\n  <span class=\"token key atrule\">script<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n      # \u6536\u96c6\u9519\u8bef\u65e5\u5fd7<br \/>\n      cat build.log 2&gt;\/dev\/null || cargo build 2&gt;&amp;1 | tee build.log<br \/>\n      # AI \u4fee\u590d<br \/>\n      cat build.log | codex exec &#8211;stdin \\\\<br \/>\n        &#8211;json \\\\<br \/>\n        &#8211;max-turns 5 \\\\<br \/>\n        &#034;\u4fee\u590d\u7f16\u8bd1\u9519\u8bef&#034;<\/span><br \/>\n  <span class=\"token key atrule\">artifacts<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">paths<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token string\">&#034;*.rs&#034;<\/span><br \/>\n    <span class=\"token key atrule\">when<\/span><span class=\"token punctuation\">:<\/span> on_success<\/p>\n<h3>\u4e94\u3001JSON \u8f93\u51fa\u683c\u5f0f<\/h3>\n<p>codex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">&#8211;json<\/span> <span class=\"token string\">&#034;\u5217\u51fa\u6240\u6709 TODO \u6ce8\u91ca&#034;<\/span><\/p>\n<p>\u8f93\u51fa\u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;success&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;result&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;summary&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u627e\u5230 5 \u4e2a TODO \u6ce8\u91ca&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;files_modified&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;output&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;1. src\/main.rs:45 &#8211; TODO: handle error\\\\n2. src\/lib.rs:120 &#8211; TODO: add tests\\\\n&#8230;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;token_usage&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token string-property property\">&#034;total&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">1234<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string-property property\">&#034;prompt&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">800<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string-property property\">&#034;completion&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">434<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;error&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token keyword\">null<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u516d\u3001Shell \u811a\u672c\u96c6\u6210<\/h3>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># auto-fix.sh &#8211; \u81ea\u52a8\u4fee\u590d\u811a\u672c<\/span><\/p>\n<p><span class=\"token builtin class-name\">set<\/span> <span class=\"token parameter variable\">-e<\/span><\/p>\n<p><span class=\"token assign-left variable\">PROJECT_DIR<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">$1<\/span>&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">ERROR_LOG<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">$2<\/span>&#034;<\/span><\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PROJECT_DIR<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5 Codex CLI \u662f\u5426\u5b89\u88c5<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token operator\">!<\/span> <span class=\"token builtin class-name\">command<\/span> <span class=\"token parameter variable\">-v<\/span> codex <span class=\"token operator\">&amp;&gt;<\/span> \/dev\/null<span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Installing Codex CLI&#8230;&#034;<\/span><br \/>\n    <span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-fsSL<\/span> https:\/\/chatgpt.com\/codex\/install.sh <span class=\"token operator\">|<\/span> <span class=\"token function\">sh<\/span><br \/>\n    <span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\"><span class=\"token environment constant\">PATH<\/span><\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token environment constant\">$HOME<\/span>\/.local\/bin:<span class=\"token environment constant\">$PATH<\/span>&#034;<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u8ba4\u8bc1<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token operator\">!<\/span> codex login-status <span class=\"token operator\">&amp;&gt;<\/span> \/dev\/null<span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Please login first: codex login&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u6267\u884c AI \u4fee\u590d<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Analyzing errors and fixing&#8230;&#034;<\/span><br \/>\ncodex <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">&#8211;stdin<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">&#8211;json<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    &#8211;max-turns <span class=\"token number\">5<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">&#8211;timeout<\/span> <span class=\"token number\">300<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token string\">&#034;\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef&#xff0c;\u53ea\u4fee\u6539\u6e90\u6587\u4ef6&#xff0c;\u4e0d\u8981\u5f15\u5165\u65b0\u7684\u95ee\u9898&#034;<\/span> <span class=\"token operator\">&lt;<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$ERROR_LOG<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u4fee\u590d\u7ed3\u679c<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token function\">cargo<\/span> build <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-q<\/span> <span class=\"token string\">&#034;error&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Some errors remain, manual review needed&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;All errors fixed!&#034;<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<h3>\u4e03\u3001\u5b89\u5168\u6ce8\u610f\u4e8b\u9879<\/h3>\n<p>\u5728 CI\/CD \u4e2d\u4f7f\u7528 Codex exec \u65f6&#xff1a;<\/p>\n<p># CI \u73af\u5883\u4e13\u7528\u914d\u7f6e<br \/>\n[approvals]<br \/>\napproval_policy &#061; &#034;never&#034;  # CI \u4e2d\u4e0d\u9700\u8981\u4ea4\u4e92\u5ba1\u6279<\/p>\n<p>[sandbox]<br \/>\nlinux &#061; &#034;landlock&#034;  # \u59cb\u7ec8\u542f\u7528\u6c99\u7bb1<\/p>\n<p>[permissions]<br \/>\npermission_profile &#061; &#034;workspace&#034;  # \u9650\u5236\u5728\u9879\u76ee\u76ee\u5f55<br \/>\nallow &#061; [<br \/>\n    &#034;.\/src&#034;,<br \/>\n    &#034;.\/tests&#034;,<br \/>\n    &#034;.\/Cargo.toml&#034;,<br \/>\n    &#034;\/tmp&#034;,<br \/>\n]<br \/>\ndeny &#061; [<br \/>\n    &#034;.\/secrets&#034;,<br \/>\n    &#034;.\/.env&#034;,<br \/>\n    &#034;.\/.git\/config&#034;,<br \/>\n]<\/p>\n<p>[network]<br \/>\n# CI \u73af\u5883\u4e0d\u9700\u8981\u7f51\u7edc\u8bbf\u95ee<br \/>\n[[network.domain_permissions]]<br \/>\nhost &#061; &#034;crates.io&#034;<br \/>\naction &#061; &#034;allow&#034;<\/p>\n<h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<p>codex exec \u8ba9 Codex CLI \u4ece\u4ea4\u4e92\u5f0f\u5de5\u5177\u53d8\u6210\u4e86\u53ef\u7f16\u7a0b\u7684 AI \u7f16\u7a0b\u80fd\u529b&#xff1a;<\/p>\n<li>\u7ba1\u9053\u8f93\u5165&#xff1a;command 2&gt;&amp;1 | codex exec &#8211;stdin \u5c06\u4efb\u4f55\u8f93\u51fa\u4f20\u7ed9 AI<\/li>\n<li>JSON \u8f93\u51fa&#xff1a;&#8211;json \u53c2\u6570\u652f\u6301\u7a0b\u5e8f\u5316\u89e3\u6790<\/li>\n<li>CI\/CD \u539f\u751f&#xff1a;\u901a\u8fc7 GitHub Actions \/ GitLab CI \u96c6\u6210&#xff0c;\u5b9e\u73b0\u81ea\u52a8\u5316<\/li>\n<li>\u5b89\u5168\u53ef\u63a7&#xff1a;\u6c99\u7bb1 &#043; \u6743\u9650\u914d\u7f6e\u786e\u4fdd CI \u73af\u5883\u5b89\u5168<\/li>\n<hr \/>\n<p>\u8ba8\u8bba&#xff1a;\u4f60\u4f1a\u5728 CI\/CD \u4e2d\u4f7f\u7528 AI \u6765\u81ea\u52a8\u4fee\u590d\u9519\u8bef\u5417&#xff1f;\u4f60\u89c9\u5f97\u6700\u5927\u7684\u98ce\u9669\u662f\u4ec0\u4e48&#xff1f;\u6b22\u8fce\u8bc4\u8bba\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f&#xff1a;\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf\u672c\u7cfb\u5217\u6587\u7ae0\u57fa\u4e8e Codex CLI \u6e90\u7801\u6df1\u5ea6\u5206\u6790&#xff0c;\u672c\u6587\u805a\u7126 codex exec \u547d\u4ee4&#xff0c;\u6559\u4f60\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u3002\u5168\u7f51\u552f\u4e00\u4ece Rust \u6e90\u7801\u5c42\u9762\u62c6\u89e3 Codex CLI \u7684\u7cfb\u5217\u96f6\u3001\u9605\u8bfb\u6536\u76ca<br \/>\n\u8bfb\u5b8c\u672c\u6587\u4f60\u5c06\u7406\u89e3&#xff1a;<br \/>\ncodex exec \u7684\u5b8c\u6574\u7528\u6cd5\u548c\u53c2\u6570\u4f53\u7cfb\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165 GitHub Actions \/ GitLab CI\u975e\u4ea4<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[597,1666,50],"topic":[],"class_list":["post-97291","post","type-post","status-publish","format-standard","hentry","category-server","tag-ci-cd","tag-1666","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \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\/97291.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f&#xff1a;\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf\u672c\u7cfb\u5217\u6587\u7ae0\u57fa\u4e8e Codex CLI \u6e90\u7801\u6df1\u5ea6\u5206\u6790&#xff0c;\u672c\u6587\u805a\u7126 codex exec \u547d\u4ee4&#xff0c;\u6559\u4f60\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u3002\u5168\u7f51\u552f\u4e00\u4ece Rust \u6e90\u7801\u5c42\u9762\u62c6\u89e3 Codex CLI \u7684\u7cfb\u5217\u96f6\u3001\u9605\u8bfb\u6536\u76ca \u8bfb\u5b8c\u672c\u6587\u4f60\u5c06\u7406\u89e3&#xff1a; codex exec \u7684\u5b8c\u6574\u7528\u6cd5\u548c\u53c2\u6570\u4f53\u7cfb\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165 GitHub Actions \/ GitLab CI\u975e\u4ea4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/97291.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-29T00:37:03+00:00\" \/>\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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97291.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/97291.html\",\"name\":\"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-29T00:37:03+00:00\",\"dateModified\":\"2026-08-29T00:37:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/97291.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/97291.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97291.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf\"}]},{\"@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 \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \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\/97291.html","og_locale":"zh_CN","og_type":"article","og_title":"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f&#xff1a;\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf\u672c\u7cfb\u5217\u6587\u7ae0\u57fa\u4e8e Codex CLI \u6e90\u7801\u6df1\u5ea6\u5206\u6790&#xff0c;\u672c\u6587\u805a\u7126 codex exec \u547d\u4ee4&#xff0c;\u6559\u4f60\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf\u3002\u5168\u7f51\u552f\u4e00\u4ece Rust \u6e90\u7801\u5c42\u9762\u62c6\u89e3 Codex CLI \u7684\u7cfb\u5217\u96f6\u3001\u9605\u8bfb\u6536\u76ca \u8bfb\u5b8c\u672c\u6587\u4f60\u5c06\u7406\u89e3&#xff1a; codex exec \u7684\u5b8c\u6574\u7528\u6cd5\u548c\u53c2\u6570\u4f53\u7cfb\u5982\u4f55\u5c06 AI \u7f16\u7a0b\u80fd\u529b\u63a5\u5165 GitHub Actions \/ GitLab CI\u975e\u4ea4","og_url":"https:\/\/www.wsisp.com\/helps\/97291.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-29T00:37:03+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/97291.html","url":"https:\/\/www.wsisp.com\/helps\/97291.html","name":"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-29T00:37:03+00:00","dateModified":"2026-08-29T00:37:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/97291.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/97291.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/97291.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Codex CLI \u975e\u4ea4\u4e92\u6a21\u5f0f\uff1a\u628a AI \u63a5\u5165\u4f60\u7684 CI\/CD \u6d41\u6c34\u7ebf"}]},{"@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\/97291","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=97291"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97291\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=97291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=97291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=97291"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=97291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}