mirror of
https://github.com/zenlm/zen-code-docs.git
synced 2026-10-30 14:58:40 +00:00
27 lines
70 KiB
Plaintext
27 lines
70 KiB
Plaintext
3:I[4707,[],""]
|
|
6:I[36423,[],""]
|
|
8:I[78400,["3185","static/chunks/app/layout-38b548b4f4d27f80.js"],"FontLoader"]
|
|
4:["lang","zh","d"]
|
|
5:["mdxPath","tools/shell","oc"]
|
|
0:["0y8u-WGJo2VFWAF7bkrdx",[[["",{"children":[["lang","zh","d"],{"children":[["mdxPath","tools/shell","oc"],{"children":["__PAGE__?{\"lang\":\"zh\",\"mdxPath\":[\"tools\",\"shell\"]}",{}]}]}]},"$undefined","$undefined",true],["",{"children":[["lang","zh","d"],{"children":[["mdxPath","tools/shell","oc"],{"children":["__PAGE__",{},[["$L1","$L2",[["$","link","0",{"rel":"stylesheet","href":"/qwen-code-docs/_next/static/css/04d76539cc2c4ebd.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[null,["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","$4","children","$5","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,"$L7"],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/qwen-code-docs/_next/static/css/7fba7395046b8eaa.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$undefined",["$","style",null,{"children":":root {\n --nextra-primary-hue: 248deg;\n --nextra-primary-saturation: 74%;\n --nextra-primary-lightness: 45%;\n --nextra-bg: 250,250,250;\n --nextra-content-width: 90rem;\n}\n.dark {\n --nextra-primary-hue: 248deg;\n --nextra-primary-saturation: 74%;\n --nextra-primary-lightness: 55%;\n --nextra-bg: 17,17,17;\n}\n::selection {\n background: hsla(var(--nextra-primary-hue),var(--nextra-primary-saturation),var(--nextra-primary-lightness),.3);\n}\nhtml {\n background: rgb(var(--nextra-bg));\n}"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"rgb(250,250,250)"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"rgb(17,17,17)"}],"$undefined"]}],["$","body",null,{"children":[["$","$L8",null,{}],["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]]}]],null],null],["$L9",null]]]]
|
|
a:I[54108,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ThemeConfigProvider"]
|
|
b:I[16016,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"LastUpdated"]
|
|
c:I[30763,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"Search"]
|
|
d:I[25922,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ThemeProvider"]
|
|
e:I[94328,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"SkipNavLink"]
|
|
f:I[17691,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ConfigProvider"]
|
|
10:I[72972,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],""]
|
|
11:I[88212,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ClientNavbar"]
|
|
13:I[32594,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"LanguageDropdown"]
|
|
14:I[57191,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"MobileNav"]
|
|
15:I[18960,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"TOCProvider"]
|
|
16:"$Sreact.fragment"
|
|
17:I[57191,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"Sidebar"]
|
|
18:I[98270,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ClientWrapper"]
|
|
19:I[56099,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"HeadingAnchor"]
|
|
1a:I[98451,["5501","static/chunks/c16f53c3-b998f97655e65347.js","1105","static/chunks/1105-e07e82095c5c7b4a.js","5524","static/chunks/5524-d228bcaedae4ecb3.js","2770","static/chunks/2770-e894e62890be5e00.js","1084","static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js"],"ToggleWordWrapButton"]
|
|
12:T481,M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z7:["$","$La",null,{"value":{"children":"$undefined","darkMode":true,"docsRepositoryBase":"https://github.com/QwenLM/qwen-code/blob/main/docs","editLink":"Edit this page","feedback":{"content":"Question? Give us feedback","labels":"feedback"},"i18n":[{"locale":"en","name":"English"},{"locale":"zh","name":"中文"},{"locale":"de","name":"Deutsch"},{"locale":"fr","name":"Français"},{"locale":"ru","name":"Русский"},{"locale":"ja","name":"日本語"}],"lastUpdated":["$","$Lb",null,{}],"navigation":{"next":true,"prev":true},"search":["$","$Lc",null,{}],"sidebar":{"defaultMenuCollapseLevel":1,"defaultOpen":true,"toggleButton":true,"autoCollapse":true},"themeSwitch":{"dark":"Dark","light":"Light","system":"System"},"toc":{"backToTop":"Scroll to top","float":true,"title":"On This Page"}},"children":["$","$Ld",null,{"attribute":"class","defaultTheme":"light","disableTransitionOnChange":true,"storageKey":"theme","children":[["$","$Le",null,{}],"$undefined",["$","$Lf",null,{"pageMap":[{"data":{"index":{"title":"欢迎阅读 Qwen Code 文档"},"deployment":{"title":"执行与部署"},"architecture":{"title":"架构概述"},"cli":{"title":"CLI 使用指南"},"core":{"title":"核心详情"},"tools":{"title":"工具集合"},"checkpointing":{"title":"检查点功能"},"extension":{"title":"扩展开发"},"ide-integration":{"title":"IDE 集成"},"telemetry":{"title":"可观测性"},"examples":{"title":"示例代码"},"npm":{"title":"包管理"},"gemini-ignore":{"title":"忽略文件配置"},"integration-tests":{"title":"集成测试"},"keyboard-shortcuts":{"title":"快捷键参考"},"sandbox":{"title":"沙箱机制"},"issue-and-pr-automation":{"title":"自动化处理"},"troubleshooting":{"title":"故障排除"},"tos-privacy":{"title":"服务条款与隐私"},"Uninstall":{"title":"卸载指南"}}},{"name":"index","route":"/zh","frontMatter":{"title":"欢迎阅读 Qwen Code 文档","filePath":"content/zh/index.md","timestamp":1789666354000},"title":"欢迎阅读 Qwen Code 文档"},{"name":"deployment","route":"/zh/deployment","frontMatter":{"title":"Qwen Code 执行与部署","filePath":"content/zh/deployment.md","timestamp":1789666354000},"title":"执行与部署"},{"name":"architecture","route":"/zh/architecture","frontMatter":{"title":"Qwen Code 架构概述","filePath":"content/zh/architecture.md","timestamp":1789666354000},"title":"架构概述"},{"name":"cli","route":"/zh/cli","children":[{"data":{"index":{"title":"CLI 概述"},"commands":{"title":"命令参考"},"configuration":{"title":"配置指南"},"authentication":{"title":"认证设置"},"openai-auth":{"title":"OpenAI 认证"},"token-caching":{"title":"Token 缓存"},"themes":{"title":"主题配置"},"tutorials":{"title":"使用教程"}}},{"name":"index","route":"/zh/cli","frontMatter":{"title":"Qwen Code CLI","filePath":"content/zh/cli/index.md","timestamp":1789666354000},"title":"CLI 概述"},{"name":"commands","route":"/zh/cli/commands","frontMatter":{"title":"CLI 命令","filePath":"content/zh/cli/commands.md","timestamp":1789666354000},"title":"命令参考"},{"name":"configuration","route":"/zh/cli/configuration","frontMatter":{"title":"Qwen Code 配置","filePath":"content/zh/cli/configuration.md","timestamp":1789666354000},"title":"配置指南"},{"name":"authentication","route":"/zh/cli/authentication","frontMatter":{"title":"认证设置","filePath":"content/zh/cli/authentication.md","timestamp":1789666354000},"title":"认证设置"},{"name":"openai-auth","route":"/zh/cli/openai-auth","frontMatter":{"title":"OpenAI 认证","filePath":"content/zh/cli/openai-auth.md","timestamp":1789666354000},"title":"OpenAI 认证"},{"name":"token-caching","route":"/zh/cli/token-caching","frontMatter":{"title":"Token 缓存与成本优化","filePath":"content/zh/cli/token-caching.md","timestamp":1789666354000},"title":"Token 缓存"},{"name":"themes","route":"/zh/cli/themes","frontMatter":{"title":"主题","filePath":"content/zh/cli/themes.md","timestamp":1789666354000},"title":"主题配置"},{"name":"tutorials","route":"/zh/cli/tutorials","frontMatter":{"title":"教程","filePath":"content/zh/cli/tutorials.md","timestamp":1789666354000},"title":"使用教程"},{"name":"welcome-back","route":"/zh/cli/welcome-back","frontMatter":{"title":"欢迎回来功能","filePath":"content/zh/cli/welcome-back.md","timestamp":1789666354000},"title":"欢迎回来功能"}],"title":"CLI 使用指南"},{"name":"core","route":"/zh/core","children":[{"data":{"index":{"title":"核心概述"},"tools-api":{"title":"工具 API"},"memport":{"title":"内存导入处理器"}}},{"name":"index","route":"/zh/core","frontMatter":{"title":"Qwen Code Core","filePath":"content/zh/core/index.md","timestamp":1789666354000},"title":"核心概述"},{"name":"tools-api","route":"/zh/core/tools-api","frontMatter":{"title":"Qwen Code Core: Tools API","filePath":"content/zh/core/tools-api.md","timestamp":1789666354000},"title":"工具 API"},{"name":"memport","route":"/zh/core/memport","frontMatter":{"title":"Memory Import Processor","filePath":"content/zh/core/memport.md","timestamp":1789666354000},"title":"内存导入处理器"}],"title":"核心详情"},{"name":"tools","route":"/zh/tools","children":[{"data":{"index":{"title":"工具概述"},"file-system":{"title":"文件系统工具"},"multi-file":{"title":"多文件读取工具"},"shell":{"title":"Shell 工具"},"web-fetch":{"title":"Web 获取工具"},"web-search":{"title":"Web 搜索工具"},"memory":{"title":"内存工具"},"todo-write":{"title":"Todo 写入工具"},"mcp-server":{"title":"MCP 服务器"}}},{"name":"index","route":"/zh/tools","frontMatter":{"title":"Qwen Code 工具","filePath":"content/zh/tools/index.md","timestamp":1789666354000},"title":"工具概述"},{"name":"file-system","route":"/zh/tools/file-system","frontMatter":{"title":"Qwen Code 文件系统工具","filePath":"content/zh/tools/file-system.md","timestamp":1789666354000},"title":"文件系统工具"},{"name":"multi-file","route":"/zh/tools/multi-file","frontMatter":{"title":"多文件读取工具 (read_many_files)","filePath":"content/zh/tools/multi-file.md","timestamp":1789666354000},"title":"多文件读取工具"},{"name":"shell","route":"/zh/tools/shell","frontMatter":{"title":"Shell 工具 (run_shell_command)","filePath":"content/zh/tools/shell.md","timestamp":1789666354000},"title":"Shell 工具"},{"name":"web-fetch","route":"/zh/tools/web-fetch","frontMatter":{"title":"Web Fetch Tool (web_fetch)","filePath":"content/zh/tools/web-fetch.md","timestamp":1789666354000},"title":"Web 获取工具"},{"name":"web-search","route":"/zh/tools/web-search","frontMatter":{"title":"Web Search Tool (web_search)","filePath":"content/zh/tools/web-search.md","timestamp":1789666354000},"title":"Web 搜索工具"},{"name":"memory","route":"/zh/tools/memory","frontMatter":{"title":"Memory Tool (save_memory)","filePath":"content/zh/tools/memory.md","timestamp":1789666354000},"title":"内存工具"},{"name":"todo-write","route":"/zh/tools/todo-write","frontMatter":{"title":"Todo Write Tool (todo_write)","filePath":"content/zh/tools/todo-write.md","timestamp":1789666354000},"title":"Todo 写入工具"},{"name":"mcp-server","route":"/zh/tools/mcp-server","frontMatter":{"title":"使用 Qwen Code 的 MCP 服务器","filePath":"content/zh/tools/mcp-server.md","timestamp":1789666354000},"title":"MCP 服务器"}],"title":"工具集合"},{"name":"checkpointing","route":"/zh/checkpointing","frontMatter":{"title":"Checkpointing","filePath":"content/zh/checkpointing.md","timestamp":1789666354000},"title":"检查点功能"},{"name":"extension","route":"/zh/extension","frontMatter":{"title":"Qwen Code Extensions","filePath":"content/zh/extension.md","timestamp":1789666354000},"title":"扩展开发"},{"name":"ide-integration","route":"/zh/ide-integration","frontMatter":{"title":"IDE 集成","filePath":"content/zh/ide-integration.md","timestamp":1789666354000},"title":"IDE 集成"},{"name":"telemetry","route":"/zh/telemetry","frontMatter":{"title":"Qwen Code 可观测性指南","filePath":"content/zh/telemetry.md","timestamp":1789666354000},"title":"可观测性"},{"name":"examples","route":"/zh/examples","children":[{"data":{"proxy-script":{"title":"代理脚本示例"}}},{"name":"proxy-script","route":"/zh/examples/proxy-script","frontMatter":{"title":"示例代理脚本","filePath":"content/zh/examples/proxy-script.md","timestamp":1789666354000},"title":"代理脚本示例"}],"title":"示例代码"},{"name":"npm","route":"/zh/npm","frontMatter":{"title":"Package Overview","filePath":"content/zh/npm.md","timestamp":1789666354000},"title":"包管理"},{"name":"gemini-ignore","route":"/zh/gemini-ignore","frontMatter":{"title":"忽略文件","filePath":"content/zh/gemini-ignore.md","timestamp":1789666354000},"title":"忽略文件配置"},{"name":"integration-tests","route":"/zh/integration-tests","frontMatter":{"title":"集成测试","filePath":"content/zh/integration-tests.md","timestamp":1789666354000},"title":"集成测试"},{"name":"keyboard-shortcuts","route":"/zh/keyboard-shortcuts","frontMatter":{"title":"Qwen Code 键盘快捷键","filePath":"content/zh/keyboard-shortcuts.md","timestamp":1789666354000},"title":"快捷键参考"},{"name":"sandbox","route":"/zh/sandbox","frontMatter":{"title":"Qwen Code 中的沙箱机制","filePath":"content/zh/sandbox.md","timestamp":1789666354000},"title":"沙箱机制"},{"name":"issue-and-pr-automation","route":"/zh/issue-and-pr-automation","frontMatter":{"title":"自动化与分类处理流程","filePath":"content/zh/issue-and-pr-automation.md","timestamp":1789666354000},"title":"自动化处理"},{"name":"troubleshooting","route":"/zh/troubleshooting","frontMatter":{"title":"故障排除指南","filePath":"content/zh/troubleshooting.md","timestamp":1789666354000},"title":"故障排除"},{"name":"tos-privacy","route":"/zh/tos-privacy","frontMatter":{"title":"Qwen Code:服务条款与隐私声明","filePath":"content/zh/tos-privacy.md","timestamp":1789666354000},"title":"服务条款与隐私"},{"name":"Uninstall","route":"/zh/Uninstall","frontMatter":{"title":"卸载 CLI","filePath":"content/zh/Uninstall.md","timestamp":1789666354000},"title":"卸载指南"},{"name":"subagents","route":"/zh/subagents","frontMatter":{"title":"Subagents","filePath":"content/zh/subagents.md","timestamp":1789666354000},"title":"Subagents"}],"navbar":["$","header",null,{"className":"nextra-navbar x:sticky x:top-0 x:z-30 x:w-full x:bg-transparent x:print:hidden x:max-md:[.nextra-banner:not([class$=hidden])~&]:top-(--nextra-banner-height)","children":[["$","div",null,{"className":"nextra-navbar-blur x:absolute x:-z-1 x:size-full nextra-border x:border-b x:backdrop-blur-md x:bg-nextra-bg/70"}],["$","nav",null,{"style":{"height":"var(--nextra-navbar-height)"},"className":"x:mx-auto x:flex x:max-w-(--nextra-content-width) x:items-center x:gap-4 x:pl-[max(env(safe-area-inset-left),1.5rem)] x:pr-[max(env(safe-area-inset-right),1.5rem)] x:justify-end","children":[["$","$L10",null,{"href":"/","className":"x:flex x:items-center x:me-auto x:transition-opacity x:focus-visible:nextra-focus x:hover:opacity-75","aria-label":"Home page","children":["$","span",null,{"className":"ms-2 select-none font-extrabold flex items-center","title":"Qwen Code: AI Coding Agent","children":[["$","img",null,{"src":"https://assets.alicdn.com/g/qwenweb/qwen-webui-fe/0.0.191/static/favicon.png","alt":"Qwen Code","width":32,"height":32,"className":"inline-block align-middle mr-2 ","style":{"verticalAlign":"middle"}}],["$","span",null,{"className":"text-[1.3rem] font-normal align-middle mr-1 max-md:hidden","children":"Qwen"}],["$","span",null,{"className":"text-[1.3rem] font-normal align-middle max-md:hidden","children":"Code"}]]}]}],["$","$L11",null,{"className":"","children":[["$","a",null,{"href":"https://github.com/QwenLM/qwen-code","target":"_blank","rel":"noreferrer","children":[["$","svg",null,{"fill":"currentColor","viewBox":"3 3 18 18","height":"24","aria-label":"Project repository","children":["$","path",null,{"d":"$12"}]}],false],"className":"x:focus-visible:nextra-focus"}],"$undefined",["$","$L13",null,{"currentLang":"zh"}]]}]]}]]}],"footer":null,"children":[["$","$L14",null,{}],["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]]}]]}]}]
|
|
2:["$","div",null,{"className":"x:mx-auto x:flex x:max-w-(--nextra-content-width)","sourceCode":"$undefined","children":["$","$L15",null,{"value":[{"value":"描述","id":"描述","depth":2},{"value":"参数","id":"参数","depth":3},{"value":[["$","$16",".0",{"children":["如何在 Qwen Code 中使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]]}]],"id":"如何在-qwen-code-中使用-run_shell_command","depth":2},{"value":"必需的 Background 参数","id":"必需的-background-参数","depth":3},{"value":"后台 vs 前台执行","id":"后台-vs-前台执行","depth":3},{"value":"执行信息","id":"执行信息","depth":3},{"value":[["$","$16",".0",{"children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 示例"]}]],"id":"run_shell_command-示例","depth":2},{"value":"重要说明","id":"重要说明","depth":2},{"value":"环境变量","id":"环境变量","depth":2},{"value":"命令限制","id":"命令限制","depth":2},{"value":"命令限制示例","id":"命令限制示例","depth":3},{"value":[["$","$16",".0",{"children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 安全提醒"]}]],"id":"excludetools-安全提醒","depth":2}],"children":[["$","$L17",null,{}],["$","$L18",null,{"metadata":{"title":"Shell 工具 (run_shell_command)","filePath":"content/zh/tools/shell.md","timestamp":1789666354000},"bottomContent":"$undefined","children":[["$","div",null,{"id":"nextra-skip-nav"}],["$","main",null,{"data-pagefind-body":true,"children":[["$","h1",null,{"id":"$undefined","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-bold x:mt-2 x:text-4xl","children":[["Shell 工具 (",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}],")"],"$undefined"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["本文档描述了用于 Qwen Code 的 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 工具。"]}],"\n",["$","h2",null,{"id":"描述","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":["描述",["$","$L19",null,{"id":"描述"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 与底层系统交互、运行脚本或执行命令行操作。",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 会执行给定的 shell 命令。在 Windows 上,命令将通过 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"cmd.exe /c"}]," 执行;在其他平台上,命令将通过 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"bash -c"}]," 执行。"]}],"\n",["$","h3",null,{"id":"参数","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-8 x:text-2xl","children":["参数",["$","$L19",null,{"id":"参数"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 接受以下参数:"]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"command"}]," (string, 必填): 要执行的确切 shell 命令。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"description"}]," (string, 可选): 命令用途的简要描述,将显示给用户。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"directory"}]," (string, 可选): 执行命令的目录(相对于项目根目录)。如果未提供,则命令在项目根目录中运行。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," (boolean, 必填): 是否在后台运行命令。此参数是必需的,以确保对命令执行模式进行明确的决策。对于应该在不阻塞后续命令的情况下继续运行的长时间运行进程(如开发服务器、监听器或守护进程),设置为 true。对于应在继续执行之前完成的一次性命令,设置为 false。"]}],"\n"]}],"\n",["$","h2",null,{"id":"如何在-qwen-code-中使用-run_shell_command","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":[["如何在 Qwen Code 中使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]],["$","$L19",null,{"id":"如何在-qwen-code-中使用-run_shell_command"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 时,命令会作为子进程执行。你可以通过 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," 参数控制命令是在后台还是前台运行,或者显式地在命令后添加 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"&"}],"。该工具会返回详细的执行信息,包括:"]}],"\n",["$","h3",null,{"id":"必需的-background-参数","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-8 x:text-2xl","children":["必需的 Background 参数",["$","$L19",null,{"id":"必需的-background-参数"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," 参数对于所有命令执行来说都是",["$","strong",null,{"children":"必需的"}],"。这样设计是为了确保 LLM(以及用户)必须显式决定每个命令是在后台还是前台运行,从而促进命令执行行为的明确性和可预测性。通过将此参数设为必填项,我们可以避免在处理长时间运行的进程时,意外回退到前台执行而导致后续操作被阻塞。"]}],"\n",["$","h3",null,{"id":"后台-vs-前台执行","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-8 x:text-2xl","children":["后台 vs 前台执行",["$","$L19",null,{"id":"后台-vs-前台执行"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"该工具会根据你的明确选择智能地处理后台和前台执行:"}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":["使用后台执行 (",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background: true"}],") 适用于:"]}]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":["长时间运行的开发服务器:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm run start"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm run dev"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"yarn dev"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["构建监听器:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm run watch"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"webpack --watch"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["数据库服务器:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"mongod"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"mysql"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"redis-server"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["Web 服务器:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"python -m http.server"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"php -S localhost:8000"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":"任何预期会无限期运行直到手动停止的命令"}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":["使用前台执行 (",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background: false"}],") 适用于:"]}]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":["一次性命令:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"ls"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"cat"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"grep"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["构建命令:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm run build"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"make"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["安装命令:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm install"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"pip install"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["Git 操作:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git commit"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git push"}]]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":["测试运行:",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm test"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"pytest"}]]}],"\n"]}],"\n",["$","h3",null,{"id":"执行信息","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-8 x:text-2xl","children":["执行信息",["$","$L19",null,{"id":"执行信息"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"该工具会返回详细的执行信息,包括:"}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Command"}],":执行的命令。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Directory"}],":命令运行的目录。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Stdout"}],":标准输出流的输出内容。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Stderr"}],":标准错误流的输出内容。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Error"}],":子进程报告的任何错误信息。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Exit Code"}],":命令的退出码。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Signal"}],":如果命令被信号终止,则为信号编号。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Background PIDs"}],":启动的任何后台进程的 PID 列表。"]}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"用法:"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"Your commands.\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Your description of the command.\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" directory=\"Your execution directory.\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"false"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":[["$","strong",null,{"children":"注意:"}]," ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," 参数是必需的,每次命令执行时都必须明确指定。"]}],"\n",["$","h2",null,{"id":"run_shell_command-示例","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":[[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 示例"],["$","$L19",null,{"id":"run_shell_command-示例"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"列出当前目录中的文件:"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"ls -la\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"false"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"在指定目录中运行脚本:"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"./my_script.sh\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" directory=\"scripts\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Run my custom script\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"false"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"启动后台开发服务器(推荐方式):"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"npm run dev\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Start development server in background\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"true"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"启动后台服务器(使用显式 & 的替代方式):"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"npm run dev &\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Start development server in background\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"false"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"在前台运行构建命令:"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"npm run build\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Build the project\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"false"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"启动多个后台服务:"}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"run_shell_command(command"}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"="}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":"\"docker-compose up\""}],["$","span",null,{"style":{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},"children":","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" description=\"Start all services\","}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":" is_background="}],["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":"true"}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":")"}]]}]}]]}]]}],"\n",["$","h2",null,{"id":"重要说明","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":["重要说明",["$","$L19",null,{"id":"重要说明"}]]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"安全性:"}]," 执行命令时要谨慎,特别是那些由用户输入构造的命令,以防止安全漏洞。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"交互式命令:"}]," 避免使用需要交互式用户输入的命令,因为这可能导致工具挂起。如果可用,请使用非交互式标志(例如 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm init -y"}],")。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"错误处理:"}]," 检查 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Stderr"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Error"}]," 和 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Exit Code"}]," 字段以确定命令是否成功执行。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"后台进程:"}]," 当 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background=true"}]," 或命令包含 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"&"}]," 时,工具将立即返回,进程将在后台继续运行。",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"Background PIDs"}]," 字段将包含后台进程的进程 ID。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"后台执行选择:"}]," ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," 参数是必需的,它提供了对执行模式的显式控制。你也可以在命令中添加 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"&"}]," 来手动后台执行,但仍然必须指定 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background"}]," 参数。该参数提供了更清晰的意图,并自动处理后台执行设置。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"命令描述:"}]," 当使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"is_background=true"}]," 时,命令描述将包含 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"[background]"}]," 指示器,以清楚地显示执行模式。"]}],"\n"]}],"\n",["$","h2",null,{"id":"环境变量","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":["环境变量",["$","$L19",null,{"id":"环境变量"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["当 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 执行命令时,它会在子进程的环境中设置 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"QWEN_CODE=1"}]," 环境变量。这允许脚本或工具检测它们是否是从 CLI 中运行的。"]}],"\n",["$","h2",null,{"id":"命令限制","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":["命令限制",["$","$L19",null,{"id":"命令限制"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["你可以通过在配置文件中使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}]," 和 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 设置来限制 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 工具可以执行的命令。"]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}],":要将 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 限制为特定的一组命令,请在 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}]," 列表中添加格式为 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command(<command>)"}]," 的条目。例如,",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"\"coreTools\": [\"run_shell_command(git)\"]"}]," 将只允许执行 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git"}]," 命令。如果包含通用的 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}],",则相当于通配符,允许执行任何未被明确阻止的命令。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}],":要阻止特定命令,请在 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 列表中添加格式为 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command(<command>)"}]," 的条目。例如,",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"\"excludeTools\": [\"run_shell_command(rm)\"]"}]," 将阻止执行 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"rm"}]," 命令。"]}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":"验证逻辑设计得既安全又灵活:"}],"\n",["$","ol",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"禁用命令链"}],":工具会自动将使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"&&"}],"、",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"||"}]," 或 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":";"}]," 连接的命令拆分,并分别验证每个部分。如果链条中的任何部分不被允许,则整个命令将被阻止。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"前缀匹配"}],":工具使用前缀匹配。例如,如果你允许 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git"}],",那么你可以运行 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git status"}]," 或 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git log"}],"。"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","strong",null,{"children":"黑名单优先"}],":始终优先检查 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 列表。如果命令匹配了被阻止的前缀,即使它也匹配了 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}]," 中允许的前缀,该命令仍将被拒绝。"]}],"\n"]}],"\n",["$","h3",null,{"id":"命令限制示例","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-8 x:text-2xl","children":["命令限制示例",["$","$L19",null,{"id":"命令限制示例"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":"仅允许特定命令前缀"}]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["若只允许执行 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git"}]," 和 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm"}]," 命令,其他命令均被阻止:"]}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":[["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"{"}]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"coreTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command(git)\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":", "}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command(npm)\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"]"}]]}],"\n",["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"}"}]}]]}]]}]]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git status"}],":允许"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm install"}],":允许"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"ls -l"}],":阻止"]}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":"阻止特定命令前缀"}]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["若要阻止 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"rm"}]," 命令,但允许所有其他命令:"]}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":[["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"{"}]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"coreTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"],"}]]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"excludeTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command(rm)\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"]"}]]}],"\n",["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"}"}]}]]}]]}]]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"rm -rf /"}],":阻止"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git status"}],":允许"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"npm install"}],":允许"]}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":"黑名单优先级更高"}]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["如果某个命令前缀同时出现在 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}]," 和 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 中,则该命令会被阻止。"]}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":[["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"{"}]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"coreTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command(git)\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"],"}]]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"excludeTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command(git push)\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"]"}]]}],"\n",["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"}"}]}]]}]]}]]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git push origin main"}],":阻止"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"git status"}],":允许"]}],"\n"]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["$","strong",null,{"children":"阻止所有 shell 命令"}]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":["要阻止所有 shell 命令,可以将 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 通配符添加到 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 中:"]}],"\n",["$","div",null,{"data-pagefind-ignore":"all","className":"nextra-code x:relative x:not-first:mt-[1.25em]","children":["$undefined",["$","pre",null,{"className":"x:group x:focus-visible:nextra-focus x:overflow-x-auto x:subpixel-antialiased x:text-[.9em] x:bg-white x:dark:bg-black x:py-4 x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700 x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50 x:contrast-more:contrast-150 x:rounded-md not-prose","tabIndex":"0","children":[["$","div",null,{"className":"x:group-hover:opacity-100 x:group-focus:opacity-100 x:opacity-0 x:transition x:focus-within:opacity-100 x:flex x:gap-1 x:absolute x:right-4 x:top-2","children":[["$","$L1a",null,{"children":["$","svg",null,{"viewBox":"0 0 24 24","fill":"currentColor","height":"1em","children":["$","path",null,{"d":"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}]}]}],false]}],["$","code",null,{"className":"nextra-code","dir":"ltr","children":[["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"{"}]}],"\n",["$","span",null,{"children":[["$","span",null,{"style":{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},"children":" \"excludeTools\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":": ["}],["$","span",null,{"style":{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},"children":"\"run_shell_command\""}],["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"]"}]]}],"\n",["$","span",null,{"children":["$","span",null,{"style":{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},"children":"}"}]}]]}]]}]]}],"\n",["$","ul",null,{"className":"x:[:is(ol,ul)_&]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]","children":["\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"ls -l"}],":阻止"]}],"\n",["$","li",null,{"className":"x:my-[.5em]","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"any other command"}],":阻止"]}],"\n"]}],"\n",["$","h2",null,{"id":"excludetools-安全提醒","className":"x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-semibold x:target:animate-[fade-in_1.5s] x:mt-10 x:border-b x:pb-1 x:text-3xl nextra-border","children":[[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 安全提醒"],["$","$L19",null,{"id":"excludetools-安全提醒"}]]}],"\n",["$","p",null,{"className":"x:not-first:mt-[1.25em] x:leading-7","children":[["$","code",null,{"className":"nextra-code","dir":"ltr","children":"excludeTools"}]," 中针对 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"run_shell_command"}]," 的命令限制是基于简单的字符串匹配实现的,很容易被绕过。此功能",["$","strong",null,{"children":"不是一种安全机制"}],",不应依赖它来安全地执行不受信任的代码。建议使用 ",["$","code",null,{"className":"nextra-code","dir":"ltr","children":"coreTools"}]," 来显式选择可以执行的命令。"]}]]}]]}]]}]}]
|
|
9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Shell 工具 (run_shell_command) | "}],["$","meta","3",{"name":"description","content":"x"}],["$","meta","4",{"name":"msapplication-TileColor","content":"#fff"}],["$","meta","5",{"name":"apple-mobile-web-app-capable","content":"yes"}],["$","meta","6",{"name":"apple-mobile-web-app-title","content":"Qwen Code"}],["$","meta","7",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","meta","8",{"property":"og:title","content":"Shell 工具 (run_shell_command) | "}],["$","meta","9",{"property":"og:description","content":"x"}],["$","meta","10",{"property":"og:image","content":"https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg"}],["$","meta","11",{"name":"twitter:card","content":"summary"}],["$","meta","12",{"name":"twitter:site","content":"@qwenLLM"}],["$","meta","13",{"name":"twitter:title","content":"Shell 工具 (run_shell_command) | "}],["$","meta","14",{"name":"twitter:description","content":"x"}],["$","meta","15",{"name":"twitter:image","content":"https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg"}]]
|
|
1:null
|