{"id":92059,"date":"2026-08-09T06:24:44","date_gmt":"2026-08-08T22:24:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92059.html"},"modified":"2026-08-09T06:24:44","modified_gmt":"2026-08-08T22:24:44","slug":"171%e3%80%81%e3%80%90agent%e3%80%91%e3%80%90opencode%e3%80%91tuithreadcmd%ef%bc%88%e5%85%a5%e5%8f%a3%e5%91%bd%e4%bb%a4%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92059.html","title":{"rendered":"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\uff09"},"content":{"rendered":"<p>\u3010\u58f0\u660e\u3011\u672c\u535a\u5ba2\u6240\u6709\u5185\u5bb9\u5747\u4e3a\u4e2a\u4eba\u4e1a\u4f59\u65f6\u95f4\u521b\u4f5c&#xff0c;\u6240\u8ff0\u6280\u672f\u6848\u4f8b\u5747\u6765\u81ea\u516c\u5f00\u5f00\u6e90\u9879\u76ee&#xff08;\u5982Github&#xff0c;Apache\u57fa\u91d1\u4f1a&#xff09;&#xff0c;\u4e0d\u6d89\u53ca\u4efb\u4f55\u4f01\u4e1a\u673a\u5bc6\u6216\u672a\u516c\u5f00\u6280\u672f&#xff0c;\u5982\u6709\u4fb5\u6743\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n<h2>\u6807\u9898<\/h2>\n<p>171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;\u5165\u53e3\u547d\u4ee4&#xff09;<\/p>\n<h2>\u80cc\u666f<\/h2>\n<p>\u4e0a\u7bc7 blog \u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;Worker&#xff09; \u5206\u6790\u4e86 Worker &#061; \u4e00\u4e2a\u72ec\u7acb\u7684\u540e\u53f0\u7ebf\u7a0b\/\u8fdb\u7a0b&#xff0c;JavaScript \u662f\u5355\u7ebf\u7a0b\u7684\u3002\u5982\u679c\u4e3b\u7ebf\u7a0b&#xff08;\u6bd4\u5982 TUI \u754c\u9762\u6e32\u67d3\u3001\u7528\u6237\u8f93\u5165\u54cd\u5e94&#xff09;\u6b63\u5728\u8dd1\u4e00\u4e2a\u8017\u65f6\u4efb\u52a1&#xff08;\u4ee3\u7801\u5206\u6790\u3001\u6587\u4ef6\u7d22\u5f15\u3001AI \u63a8\u7406&#xff09;&#xff0c;\u6574\u4e2a\u754c\u9762\u5c31\u4f1a\u5361\u6b7b\u3002Worker \u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff1a;\u628a\u91cd\u6d3b\u6254\u7ed9\u4e00\u4e2a\u5b8c\u5168\u9694\u79bb\u7684\u540e\u53f0\u6267\u884c\u5355\u5143\u53bb\u505a&#xff0c;\u4e3b\u7ebf\u7a0b\u7ee7\u7eed\u6d41\u7545\u54cd\u5e94\u7528\u6237\u64cd\u4f5c\u3002\u4e24\u8005\u4e4b\u95f4\u901a\u8fc7\u6d88\u606f\u4f20\u9012\u901a\u4fe1&#xff0c;\u4e0d\u5171\u4eab\u5185\u5b58&#xff0c;\u5e76\u5206\u6790\u4e86\u4e3a\u4ec0\u4e48\u52a0\u8f7d Worker \u8fd9\u4e48\u9ebb\u70e6\u7684\u539f\u56e0&#xff0c;\u56e0\u4e3a Worker \u4e0d\u8d70\u6a21\u5757\u6253\u5305\u5668\u7684\u5e38\u89c4\u6d41\u7a0b&#xff0c;\u5e76\u4e14\u8fd0\u884c\u65f6 API \u8981\u6c42\u771f\u5b9e\u6587\u4ef6\u8def\u5f84&#xff0c;\u63a5\u7740\u63d0\u5230\u4e86 Worker \u4e0d\u662f\u6a21\u5757&#xff0c;\u662f\u72ec\u7acb\u8fdb\u7a0b\/\u7ebf\u7a0b&#xff0c;\u5e76\u5bf9\u6bd4\u4e86\u5404\u8fd0\u884c\u65f6\u5bf9 Worker \u7684\u652f\u6301&#xff0c;\u4e0b\u9762\u7ee7\u7eed\u5206\u6790<\/p>\n<h2>OpenCode<\/h2>\n<p>\u4e0b\u9762\u7ee7\u7eed\u5206\u6790<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260808222443-6a77acab5bccf.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u8fd9\u91cc\u7684\u4f5c\u7528\u662f&#xff1a;\u667a\u80fd\u5408\u5e76\u201c\u7ba1\u9053\u8f93\u5165\u201d\u548c\u201c\u53c2\u6570\u8f93\u5165\u201d\u3002<\/p>\n<p>\u5b83\u89e3\u51b3\u7684\u662f CLI \u5de5\u5177\u4e2d\u4e00\u4e2a\u7ecf\u5178\u95ee\u9898&#xff1a;\u7528\u6237\u65e2\u53ef\u80fd\u901a\u8fc7\u7ba1\u9053\u4f20\u6570\u636e&#xff0c;\u4e5f\u53ef\u80fd\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u4f20\u6570\u636e&#xff0c;\u8fd8\u53ef\u80fd\u4e24\u8005\u90fd\u4f20\u3002\u51fd\u6570\u9700\u8981\u4f18\u96c5\u5730\u5904\u7406\u6240\u6709\u7ec4\u5408\u3002<\/p>\n<hr \/>\n<p>&#x1f50d; \u9010\u884c\u62c6\u89e3<\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token function\">input<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">value<span class=\"token operator\">?<\/span><span class=\"token operator\">:<\/span> string<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ 1\ufe0f\u20e3 \u68c0\u6d4b\u662f\u5426\u6709\u7ba1\u9053\u8f93\u5165<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> piped <span class=\"token operator\">&#061;<\/span> process<span class=\"token punctuation\">.<\/span>stdin<span class=\"token punctuation\">.<\/span>isTTY <span class=\"token operator\">?<\/span> <span class=\"token keyword\">undefined<\/span> <span class=\"token operator\">:<\/span> <span class=\"token keyword\">await<\/span> Bun<span class=\"token punctuation\">.<\/span>stdin<span class=\"token punctuation\">.<\/span><span class=\"token function\">text<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ 2\ufe0f\u20e3 \u53ea\u6709\u7ba1\u9053\u8f93\u5165&#xff08;\u6216\u90fd\u6ca1\u6709&#xff09;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>value<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> piped<\/p>\n<p>  <span class=\"token comment\">\/\/ 3\ufe0f\u20e3 \u53ea\u6709\u53c2\u6570\u8f93\u5165<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>piped<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> value<\/p>\n<p>  <span class=\"token comment\">\/\/ 4\ufe0f\u20e3 \u4e24\u8005\u90fd\u6709 \u2192 \u62fc\u63a5<\/span><br \/>\n  <span class=\"token keyword\">return<\/span> piped <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;\\\\n&#034;<\/span> <span class=\"token operator\">&#043;<\/span> value<br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<p>1\ufe0f\u20e3 process.stdin.isTTY \u662f\u5173\u952e\u5224\u65ad<\/p>\n<table>\n<tr>isTTY \u503c\u542b\u4e49\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">true<\/td>\n<td align=\"left\">\u7ec8\u7aef\u4ea4\u4e92\u5f0f\u8f93\u5165<\/td>\n<td align=\"left\">\u7528\u6237\u76f4\u63a5\u5728\u7ec8\u7aef\u6572\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">false<\/td>\n<td align=\"left\">\u975e TTY&#xff08;\u7ba1\u9053\/\u91cd\u5b9a\u5411&#xff09;<\/td>\n<td align=\"left\">echo &#034;xxx&#034; | cmd \u6216 cmd &lt; file.txt<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\u662f TTY \u2192 \u6ca1\u6709\u7ba1\u9053\u6570\u636e&#xff0c;piped &#061; undefined&#xff0c;\u907f\u514d\u963b\u585e\u7b49\u5f85\u7528\u6237\u624b\u52a8\u8f93\u5165<\/li>\n<li>\u4e0d\u662f TTY \u2192 \u6709\u7ba1\u9053\u6570\u636e&#xff0c;\u7528 Bun.stdin.text() \u4e00\u6b21\u6027\u8bfb\u53d6\u5168\u90e8 stdin \u5185\u5bb9<\/li>\n<\/ul>\n<hr \/>\n<p>&#x1f4ca; \u56db\u79cd\u8c03\u7528\u573a\u666f\u5bf9\u7167<\/p>\n<table>\n<tr>\u8c03\u7528\u65b9\u5f0fpipedvalue\u8fd4\u56de\u503c<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">cmd<\/td>\n<td align=\"left\">undefined<\/td>\n<td align=\"left\">undefined<\/td>\n<td align=\"left\">undefined<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">cmd &#034;hello&#034;<\/td>\n<td align=\"left\">undefined<\/td>\n<td align=\"left\">&#034;hello&#034;<\/td>\n<td align=\"left\">&#034;hello&#034;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">echo &#034;world&#034; | cmd<\/td>\n<td align=\"left\">&#034;world&#034;<\/td>\n<td align=\"left\">undefined<\/td>\n<td align=\"left\">&#034;world&#034;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">echo &#034;world&#034; | cmd &#034;hello&#034;<\/td>\n<td align=\"left\">&#034;world&#034;<\/td>\n<td align=\"left\">&#034;hello&#034;<\/td>\n<td align=\"left\">&#034;world\\\\nhello&#034;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>&#x1f4a1; \u4e3a\u4ec0\u4e48\u8fd9\u6837\u8bbe\u8ba1&#xff1f;<\/p>\n<p>\u8fd9\u662f Unix CLI \u7684\u60ef\u7528\u7ea6\u5b9a&#xff1a;<\/p>\n<ul>\n<li>\u7ba1\u9053\u4f18\u5148&#xff1a;\u7ba1\u9053\u901a\u5e38\u6765\u81ea\u7a0b\u5e8f\u8f93\u51fa&#xff0c;\u662f\u201c\u4e0a\u6e38\u6570\u636e\u6d41\u201d&#xff0c;\u653e\u5728\u524d\u9762<\/li>\n<li>\u53c2\u6570\u8865\u5145&#xff1a;\u547d\u4ee4\u884c\u53c2\u6570\u901a\u5e38\u662f\u7528\u6237\u624b\u52a8\u8ffd\u52a0\u7684\u989d\u5916\u5185\u5bb9&#xff0c;\u653e\u5728\u540e\u9762<\/li>\n<li>\u6362\u884c\u5206\u9694&#xff1a;\\\\n \u4fdd\u8bc1\u4e24\u6bb5\u5185\u5bb9\u4e0d\u4f1a\u7c98\u5728\u4e00\u8d77&#xff0c;\u4e14\u7b26\u5408\u6587\u672c\u6d41\u7684\u5904\u7406\u4e60\u60ef<\/li>\n<\/ul>\n<p>\u5178\u578b\u4f7f\u7528\u573a\u666f&#xff1a;\u6bd4\u5982\u4e00\u4e2a\u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177&#xff0c;\u65e2\u53ef\u4ee5 format &#034;const x&#061;1&#034; \u76f4\u63a5\u683c\u5f0f\u5316\u53c2\u6570&#xff0c;\u4e5f\u53ef\u4ee5 cat dirty.js | format \u683c\u5f0f\u5316\u6587\u4ef6\u5185\u5bb9&#xff0c;\u8fd8\u53ef\u4ee5 cat partial.js | format &#034;\/\/ header&#034; \u5728\u7ba1\u9053\u5185\u5bb9\u540e\u8ffd\u52a0\u6ce8\u91ca\u5934\u3002\u4e00\u4e2a\u51fd\u6570\u7edf\u4e00\u5904\u7406\u4e09\u79cd\u7528\u6cd5&#xff0c;\u8c03\u7528\u65b9\u65e0\u9700\u5173\u5fc3\u6570\u636e\u6765\u6e90\u3002<\/p>\n<hr \/>\n<p>\u63a5\u7740\u5f80\u4e0b\u5206\u6790<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260808222443-6a77acab8c1a2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u8fd9\u91cc\u662f\u4f7f\u7528 yargs \u5e93\u5b9a\u4e49 CLI&#xff08;\u547d\u4ee4\u884c\u754c\u9762&#xff09;\u7684\u5165\u53e3\u547d\u4ee4&#xff0c;\u7b80\u5355\u6765\u8bf4&#xff0c;\u5b83\u5b9a\u4e49\u4e86\u7528\u6237\u5728\u7ec8\u7aef\u8f93\u5165 opencode \u65f6&#xff0c;\u7a0b\u5e8f\u5982\u4f55\u89e3\u6790\u540e\u9762\u7684\u53c2\u6570\u548c\u9009\u9879\u3002<\/p>\n<hr \/>\n<p>&#x1f50d; \u6838\u5fc3\u7ed3\u6784\u62c6\u89e3<\/p>\n<p><span class=\"token keyword\">export<\/span> <span class=\"token keyword\">const<\/span> TuiThreadCommand <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">cmd<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token literal-property property\">command<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;$0 [project]&#034;<\/span><span class=\"token punctuation\">,<\/span>       <span class=\"token comment\">\/\/ \u2190 \u547d\u4ee4\u7b7e\u540d<\/span><br \/>\n  <span class=\"token literal-property property\">describe<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;start opencode tui&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\">\/\/ \u2190 \u5e2e\u52a9\u6587\u6863\u63cf\u8ff0<\/span><br \/>\n  <span class=\"token function-variable function\">builder<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">yargs<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token operator\">&#8230;<\/span>         <span class=\"token comment\">\/\/ \u2190 \u53c2\u6570\/\u9009\u9879\u5b9a\u4e49<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>$0 [project] \u7684\u542b\u4e49<\/p>\n<table>\n<tr>\u7b26\u53f7\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">$0<\/td>\n<td align=\"left\">yargs \u7279\u6b8a\u8bed\u6cd5&#xff0c;\u8868\u793a\u811a\u672c\u540d\u79f0\u672c\u8eab&#xff08;\u5373\u9ed8\u8ba4\u547d\u4ee4\/\u6839\u547d\u4ee4&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">[project]<\/td>\n<td align=\"left\">\u53ef\u9009\u7684\u4f4d\u7f6e\u53c2\u6570&#xff08;\u65b9\u62ec\u53f7\u8868\u793a\u53ef\u9009&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u8fd9\u91cc\u7684 project \u662f\u4e00\u4e2a\u4f4d\u7f6e\u53c2\u6570&#xff08;Positional Argument&#xff09;&#xff0c;\u5b83\u7684\u5177\u4f53\u542b\u4e49\u662f&#xff1a;<\/p>\n<p>\u7528\u6237\u5e0c\u671b opencode \u542f\u52a8\u5e76\u5de5\u4f5c\u7684\u76ee\u6807\u9879\u76ee\u8def\u5f84\u3002<\/p>\n<p>\u7ed3\u5408\u4ee3\u7801\u4e2d\u7684\u63cf\u8ff0<\/p>\n<p>      <span class=\"token punctuation\">.<\/span><span class=\"token function\">positional<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;project&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token literal-property property\">type<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;string&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">describe<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;path to start opencode in&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u53ef\u4ee5\u4ece\u4ee5\u4e0b\u4e09\u4e2a\u5c42\u9762\u7406\u89e3\u5b83&#xff1a;<\/p>\n<li>\u4e1a\u52a1\u542b\u4e49<\/li>\n<ul>\n<li>\u4e0d\u4f20\u65f6&#xff1a;opencode \u9ed8\u8ba4\u5728\u5f53\u524d\u7ec8\u7aef\u6240\u5728\u76ee\u5f55&#xff08;\u5373 process.cwd()&#xff09;\u542f\u52a8 TUI \u754c\u9762\u3002<\/li>\n<li>\u4f20\u5165\u65f6&#xff1a;opencode .\/my-project \u4f1a\u76f4\u63a5\u5207\u6362\u5230 .\/my-project \u76ee\u5f55\u4e0b\u542f\u52a8&#xff0c;\u76f8\u5f53\u4e8e\u7701\u53bb\u4e86\u624b\u52a8 cd .\/my-project &amp;&amp; opencode \u7684\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<li>\u8bed\u6cd5\u542b\u4e49<\/li>\n<ul>\n<li>\u4f4d\u7f6e\u53c2\u6570&#xff1a;\u5b83\u4e0d\u9700\u8981 &#8212; \u524d\u7f00&#xff0c;\u76f4\u63a5\u8ddf\u5728\u547d\u4ee4\u540e\u9762\u5373\u53ef\u3002yargs \u4f1a\u6839\u636e\u53c2\u6570\u7684\u4f4d\u7f6e&#xff08;\u7b2c\u51e0\u4e2a&#xff09;\u6765\u5339\u914d\u5b83\u3002<\/li>\n<li>\u53ef\u9009&#xff08;\u65b9\u62ec\u53f7 [&#8230;]&#xff09;&#xff1a;\u5728 yargs \u7684\u547d\u4ee4\u7b7e\u540d\u8bed\u6cd5\u4e2d&#xff0c;[project] \u8868\u793a\u8be5\u53c2\u6570\u662f\u53ef\u9009\u7684&#xff1b;\u5982\u679c\u662f\u5fc5\u9009\u53c2\u6570&#xff0c;\u5219\u4f1a\u5199\u6210 &lt;project&gt;&#xff08;\u5c16\u62ec\u53f7&#xff09;\u3002<\/li>\n<\/ul>\n<li>\u4e0e\u9009\u9879\u7684\u533a\u522b<\/li>\n<table>\n<tr>\u7279\u6027\u4f4d\u7f6e\u53c2\u6570 project\u9009\u9879 &#8211;model \/ -m<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u8c03\u7528\u65b9\u5f0f<\/td>\n<td align=\"left\">opencode .\/src<\/td>\n<td align=\"left\">opencode &#8211;model gpt-4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u662f\u5426\u5fc5\u987b\u5e26\u540d\u79f0<\/td>\n<td align=\"left\">\u274c \u9760\u4f4d\u7f6e\u8bc6\u522b<\/td>\n<td align=\"left\">\u2705 \u5fc5\u987b\u5e26 &#8212; \u6216 &#8211; \u524d\u7f00<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u987a\u5e8f\u654f\u611f\u6027<\/td>\n<td align=\"left\">\u26a0\ufe0f \u654f\u611f&#xff08;\u5fc5\u987b\u5728\u56fa\u5b9a\u4f4d\u7f6e&#xff09;<\/td>\n<td align=\"left\">\u274c \u4e0d\u654f\u611f&#xff08;\u53ef\u4efb\u610f\u6392\u5217&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u672c\u4f8b\u4e2d\u662f\u5426\u53ef\u9009<\/td>\n<td align=\"left\">\u2705 \u53ef\u9009<\/td>\n<td align=\"left\">\u2705 \u53ef\u9009<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u8fd9\u610f\u5473\u7740\u4ee5\u4e0b\u8c03\u7528\u65b9\u5f0f\u90fd\u5408\u6cd5&#xff1a;<\/p>\n<p>opencode                    <span class=\"token comment\"># \u2705 \u65e0\u53c2\u6570<\/span><br \/>\nopencode .\/my-project       <span class=\"token comment\"># \u2705 \u5e26 project \u53c2\u6570<\/span><br \/>\nopencode <span class=\"token parameter variable\">&#8211;model<\/span> gpt-4      <span class=\"token comment\"># \u2705 \u5e26\u9009\u9879<\/span><br \/>\nopencode .\/my-project <span class=\"token parameter variable\">-c<\/span>    <span class=\"token comment\"># \u2705 \u53c2\u6570 &#043; \u9009\u9879\u7ec4\u5408<\/span><\/p>\n<hr \/>\n<p>&#x1f4a1; \u4e00\u53e5\u8bdd\u603b\u7ed3 project \u5c31\u662f\u544a\u8bc9 opencode \u201c\u8981\u5728\u54ea\u4e2a\u6587\u4ef6\u5939\u91cc\u5e72\u6d3b\u201d \u7684\u8def\u5f84\u53c2\u6570&#xff0c;\u56e0\u4e3a\u52a0\u4e86\u65b9\u62ec\u53f7\u6240\u4ee5\u53ef\u4ee5\u4e0d\u4f20&#xff08;\u4e0d\u4f20\u5c31\u7528\u5f53\u524d\u76ee\u5f55&#xff09;\u3002<\/p>\n<hr \/>\n<p>OK&#xff0c;\u672c\u7bc7\u5148\u5230\u8fd9\u91cc&#xff0c;\u5982\u6709\u7591\u95ee&#xff0c;\u6b22\u8fce\u8bc4\u8bba\u533a\u7559\u8a00\u8ba8\u8bba&#xff0c;\u795d\u5404\u4f4d\u529f\u529b\u5927\u6da8&#xff0c;\u6280\u672f\u66f4\u4e0a\u4e00\u5c42\u697c&#xff01;&#xff01;&#xff01;\u66f4\u591a\u5185\u5bb9\u89c1\u4e0b\u7bc7 blog<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u58f0\u660e\u3011\u672c\u535a\u5ba2\u6240\u6709\u5185\u5bb9\u5747\u4e3a\u4e2a\u4eba\u4e1a\u4f59\u65f6\u95f4\u521b\u4f5c&#xff0c;\u6240\u8ff0\u6280\u672f\u6848\u4f8b\u5747\u6765\u81ea\u516c\u5f00\u5f00\u6e90\u9879\u76ee&#xff08;\u5982Github&#xff0c;Apache\u57fa\u91d1\u4f1a&#xff09;&#xff0c;\u4e0d\u6d89\u53ca\u4efb\u4f55\u4f01\u4e1a\u673a\u5bc6\u6216\u672a\u516c\u5f00\u6280\u672f&#xff0c;\u5982\u6709\u4fb5\u6743\u8bf7\u8054\u7cfb\u5220\u9664 \u6807\u9898<br \/>\n171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;\u5165\u53e3\u547d\u4ee4&#xff09;<br \/>\n\u80cc\u666f<br \/>\n\u4e0a\u7bc7 blog \u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;Worker&amp;<\/p>\n","protected":false},"author":2,"featured_media":92057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7616,74,50],"topic":[],"class_list":["post-92059","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-opencode","tag-agent","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\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\/92059.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010\u58f0\u660e\u3011\u672c\u535a\u5ba2\u6240\u6709\u5185\u5bb9\u5747\u4e3a\u4e2a\u4eba\u4e1a\u4f59\u65f6\u95f4\u521b\u4f5c&#xff0c;\u6240\u8ff0\u6280\u672f\u6848\u4f8b\u5747\u6765\u81ea\u516c\u5f00\u5f00\u6e90\u9879\u76ee&#xff08;\u5982Github&#xff0c;Apache\u57fa\u91d1\u4f1a&#xff09;&#xff0c;\u4e0d\u6d89\u53ca\u4efb\u4f55\u4f01\u4e1a\u673a\u5bc6\u6216\u672a\u516c\u5f00\u6280\u672f&#xff0c;\u5982\u6709\u4fb5\u6743\u8bf7\u8054\u7cfb\u5220\u9664 \u6807\u9898 171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;\u5165\u53e3\u547d\u4ee4&#xff09; \u80cc\u666f \u4e0a\u7bc7 blog \u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;Worker&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92059.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-08T22:24:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260808222443-6a77acab5bccf.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\/92059.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92059.html\",\"name\":\"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-08T22:24:44+00:00\",\"dateModified\":\"2026-08-08T22:24:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92059.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92059.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92059.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\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":"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\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\/92059.html","og_locale":"zh_CN","og_type":"article","og_title":"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010\u58f0\u660e\u3011\u672c\u535a\u5ba2\u6240\u6709\u5185\u5bb9\u5747\u4e3a\u4e2a\u4eba\u4e1a\u4f59\u65f6\u95f4\u521b\u4f5c&#xff0c;\u6240\u8ff0\u6280\u672f\u6848\u4f8b\u5747\u6765\u81ea\u516c\u5f00\u5f00\u6e90\u9879\u76ee&#xff08;\u5982Github&#xff0c;Apache\u57fa\u91d1\u4f1a&#xff09;&#xff0c;\u4e0d\u6d89\u53ca\u4efb\u4f55\u4f01\u4e1a\u673a\u5bc6\u6216\u672a\u516c\u5f00\u6280\u672f&#xff0c;\u5982\u6709\u4fb5\u6743\u8bf7\u8054\u7cfb\u5220\u9664 \u6807\u9898 171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;\u5165\u53e3\u547d\u4ee4&#xff09; \u80cc\u666f \u4e0a\u7bc7 blog \u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd&#xff08;Worker&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/92059.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-08T22:24:44+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260808222443-6a77acab5bccf.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\/92059.html","url":"https:\/\/www.wsisp.com\/helps\/92059.html","name":"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-08T22:24:44+00:00","dateModified":"2026-08-08T22:24:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92059.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92059.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92059.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"171\u3001\u3010Agent\u3011\u3010OpenCode\u3011TuiThreadCmd\uff08\u5165\u53e3\u547d\u4ee4\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\/92059","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=92059"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92059\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/92057"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92059"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}