Files
2026-09-17 17:35:03 +00:00

199 lines
203 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="image" href="https://assets.alicdn.com/g/qwenweb/qwen-webui-fe/0.0.191/static/favicon.png"/><link rel="stylesheet" href="/qwen-code-docs/_next/static/css/7fba7395046b8eaa.css" data-precedence="next"/><link rel="stylesheet" href="/qwen-code-docs/_next/static/css/04d76539cc2c4ebd.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/qwen-code-docs/_next/static/chunks/webpack-6175f18c4ffcc31c.js"/><script src="/qwen-code-docs/_next/static/chunks/fd9d1056-c4d7023cbe01becc.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/2117-2a033efae9becbf0.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/main-app-96783a02d9726921.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/app/layout-38b548b4f4d27f80.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/c16f53c3-b998f97655e65347.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/1105-e07e82095c5c7b4a.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/5524-d228bcaedae4ecb3.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/2770-e894e62890be5e00.js" async=""></script><script src="/qwen-code-docs/_next/static/chunks/app/%5Blang%5D/layout-11fe9b7075b678bf.js" async=""></script><meta name="theme-color" media="(prefers-color-scheme: light)" content="rgb(250,250,250)"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="rgb(17,17,17)"/><title>Package Overview | </title><meta name="description" content="x"/><meta name="msapplication-TileColor" content="#fff"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Qwen Code"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="Package Overview | "/><meta property="og:description" content="x"/><meta property="og:image" content="https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@qwenLLM"/><meta name="twitter:title" content="Package Overview | "/><meta name="twitter:description" content="x"/><meta name="twitter:image" content="https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg"/><style>:root {
--nextra-primary-hue: 248deg;
--nextra-primary-saturation: 74%;
--nextra-primary-lightness: 45%;
--nextra-bg: 250,250,250;
--nextra-content-width: 90rem;
}
.dark {
--nextra-primary-hue: 248deg;
--nextra-primary-saturation: 74%;
--nextra-primary-lightness: 55%;
--nextra-bg: 17,17,17;
}
::selection {
background: hsla(var(--nextra-primary-hue),var(--nextra-primary-saturation),var(--nextra-primary-lightness),.3);
}
html {
background: rgb(var(--nextra-bg));
}</style><script src="/qwen-code-docs/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script>((e,i,s,n,l,r,d,h)=>{let t=document.documentElement,a=["light","dark"];function c(i){(Array.isArray(e)?e:[e]).forEach(e=>{let s="class"===e,n=s&&r?l.map(e=>r[e]||e):l;s?(t.classList.remove(...n),t.classList.add(r&&r[i]?r[i]:i)):t.setAttribute(e,i)}),h&&a.includes(i)&&(t.style.colorScheme=i)}if(n)c(n);else try{let e=localStorage.getItem(i)||s,n=d&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(n)}catch(e){}})("class","theme","light",null,["light","dark"],null,true,true)</script><a href="#nextra-skip-nav" class="nextra-skip-nav x:sr-only" type="button" data-headlessui-state="">Skip to Content</a><header class="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])~&amp;]:top-(--nextra-banner-height)"><div class="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"></div><nav style="height:var(--nextra-navbar-height)" class="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"><a class="x:flex x:items-center x:me-auto x:transition-opacity x:focus-visible:nextra-focus x:hover:opacity-75" aria-label="Home page" href="/qwen-code-docs/"><span class="ms-2 select-none font-extrabold flex items-center" title="Qwen Code: AI Coding Agent"><img src="https://assets.alicdn.com/g/qwenweb/qwen-webui-fe/0.0.191/static/favicon.png" alt="Qwen Code" width="32" height="32" class="inline-block align-middle mr-2 " style="vertical-align:middle"/><span class="text-[1.3rem] font-normal align-middle mr-1 max-md:hidden">Qwen</span><span class="text-[1.3rem] font-normal align-middle max-md:hidden">Code</span></span></a><div class="x:flex x:gap-4 x:overflow-x-auto nextra-scrollbar x:py-1.5 x:max-md:hidden"></div><div class="x:max-md:hidden"><div class="nextra-search x:relative x:flex x:items-center x:text-gray-900 x:dark:text-gray-300 x:contrast-more:text-gray-800 x:contrast-more:dark:text-gray-300"><input spellCheck="false" autoComplete="off" class="x:rounded-lg x:px-3 x:py-2 x:transition-all x:w-full x:md:w-64 x:text-base x:leading-tight x:md:text-sm x:bg-black/[.05] x:dark:bg-gray-50/10 x:placeholder:text-gray-600 x:dark:placeholder:text-gray-400 x:contrast-more:border x:contrast-more:border-current x:[&amp;::-webkit-search-cancel-button]:appearance-none" placeholder="Search documentation…" id="headlessui-combobox-input-:Rbdaf9ukq:" role="combobox" type="search" aria-expanded="false" aria-autocomplete="list" data-headlessui-state="" value=""/><kbd class="x:absolute x:my-1.5 x:select-none x:pointer-events-none x:end-1.5 x:transition-all x:h-5 x:rounded x:bg-nextra-bg x:px-1.5 x:font-mono x:text-[11px] x:font-medium x:text-gray-600 x:dark:text-gray-400 x:border nextra-border x:contrast-more:text-current x:items-center x:gap-1 x:flex x:max-sm:hidden not-prose x:invisible x:opacity-0">CTRL K</kbd></div></div><a href="https://github.com/QwenLM/qwen-code" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus"><svg fill="currentColor" viewBox="3 3 18 18" height="24" aria-label="Project repository"><path d="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 3Z"></path></svg></a><div class="flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 rounded-md"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe w-4 h-4" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"></path><path d="M2 12h20"></path></svg><span>中文</span></div><button class="x:transition x:cursor-pointer nextra-hamburger x:md:hidden" aria-label="Menu" type="button" data-headlessui-state=""><svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" height="24" class=""><g><path d="M4 6h16"></path></g><path d="M4 12h16"></path><g><path d="M4 18h16"></path></g></svg></button></nav></header><aside class="nextra-mobile-nav x:flex x:flex-col x:fixed x:inset-0 x:pt-(--nextra-navbar-height) x:z-20 x:overscroll-contain x:[contain:layout_style] x:md:hidden x:[.nextra-banner:not([class$=hidden])~&amp;]:pt-[calc(var(--nextra-banner-height)+var(--nextra-navbar-height))] x:bg-nextra-bg x:[transform:translate3d(0,-100%,0)]"><div class="x:px-4 x:pt-4"><div class="nextra-search x:relative x:flex x:items-center x:text-gray-900 x:dark:text-gray-300 x:contrast-more:text-gray-800 x:contrast-more:dark:text-gray-300"><input spellCheck="false" autoComplete="off" class="x:rounded-lg x:px-3 x:py-2 x:transition-all x:w-full x:md:w-64 x:text-base x:leading-tight x:md:text-sm x:bg-black/[.05] x:dark:bg-gray-50/10 x:placeholder:text-gray-600 x:dark:placeholder:text-gray-400 x:contrast-more:border x:contrast-more:border-current x:[&amp;::-webkit-search-cancel-button]:appearance-none" placeholder="Search documentation…" id="headlessui-combobox-input-:R1dln9ukq:" role="combobox" type="search" aria-expanded="false" aria-autocomplete="list" data-headlessui-state="" value=""/><kbd class="x:absolute x:my-1.5 x:select-none x:pointer-events-none x:end-1.5 x:transition-all x:h-5 x:rounded x:bg-nextra-bg x:px-1.5 x:font-mono x:text-[11px] x:font-medium x:text-gray-600 x:dark:text-gray-400 x:border nextra-border x:contrast-more:text-current x:items-center x:gap-1 x:flex x:max-sm:hidden not-prose x:invisible x:opacity-0">CTRL K</kbd></div></div><ul class="x:grid x:gap-1 x:p-4 x:overflow-y-auto nextra-scrollbar nextra-mask"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/">欢迎阅读 Qwen Code 文档</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/deployment/">执行与部署</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/architecture/">架构概述</a></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/cli" type="button" data-headlessui-state="">CLI 使用指南<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/">CLI 概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/commands/">命令参考</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/configuration/">配置指南</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/authentication/">认证设置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/openai-auth/">OpenAI 认证</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/token-caching/">Token 缓存</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/themes/">主题配置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/tutorials/">使用教程</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/welcome-back/">欢迎回来功能</a></li></ul></div></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/core" type="button" data-headlessui-state="">核心详情<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/">核心概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/tools-api/">工具 API</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/memport/">内存导入处理器</a></li></ul></div></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/tools" type="button" data-headlessui-state="">工具集合<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/">工具概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/file-system/">文件系统工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/multi-file/">多文件读取工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/shell/">Shell 工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/web-fetch/">Web 获取工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/web-search/">Web 搜索工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/memory/">内存工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/todo-write/">Todo 写入工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/mcp-server/">MCP 服务器</a></li></ul></div></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/checkpointing/">检查点功能</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/extension/">扩展开发</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/ide-integration/">IDE 集成</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/telemetry/">可观测性</a></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/examples" type="button" data-headlessui-state="">示例代码<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/examples/proxy-script/">代理脚本示例</a></li></ul></div></li><li class="active"><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:bg-primary-100 x:font-semibold x:text-primary-800 x:dark:bg-primary-400/10 x:dark:text-primary-600 x:contrast-more:border-primary-500!" href="/qwen-code-docs/zh/npm/">包管理</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/gemini-ignore/">忽略文件配置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/integration-tests/">集成测试</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/keyboard-shortcuts/">快捷键参考</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/sandbox/">沙箱机制</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/issue-and-pr-automation/">自动化处理</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/troubleshooting/">故障排除</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tos-privacy/">服务条款与隐私</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/Uninstall/">卸载指南</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/subagents/">Subagents</a></li></ul><div class="nextra-sidebar-footer x:border-t nextra-border x:flex x:items-center x:gap-2 x:py-4 x:mx-4 x:mt-auto"><button title="Change theme" class="x:cursor-pointer x:h-7 x:rounded-md x:px-2 x:text-xs x:font-medium x:transition-colors x:text-gray-600 x:dark:text-gray-400 x:flex x:items-center x:gap-2 x:grow" id="headlessui-listbox-button-:R1mtn9ukq:" type="button" aria-haspopup="listbox" aria-expanded="false" data-headlessui-state=""><svg fill="currentColor" viewBox="2 2 20 20" stroke="currentColor" height="12"><path stroke-linecap="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>Light</button><button title="Change language" class="x:cursor-pointer x:h-7 x:rounded-md x:px-2 x:text-xs x:font-medium x:transition-colors x:text-gray-600 x:dark:text-gray-400 x:flex x:items-center x:gap-2 x:grow x:justify-end" id="headlessui-listbox-button-:R1ndn9ukq:" type="button" aria-haspopup="listbox" aria-expanded="false" data-headlessui-state=""><svg viewBox="2 2 16 16" fill="currentColor" height="12"><path fill-rule="evenodd" d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z"></path></svg>中文</button></div></aside><div class="x:mx-auto x:flex x:max-w-(--nextra-content-width)"><aside id=":Rpuun9ukq:" class="nextra-sidebar x:print:hidden x:transition-all x:ease-in-out x:max-md:hidden x:flex x:flex-col x:h-[calc(100dvh-var(--nextra-navbar-height))] x:top-(--nextra-navbar-height) x:shrink-0 x:w-64 x:sticky"><div class="x:p-4 x:overflow-y-auto nextra-scrollbar nextra-mask x:grow"><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-100" style="transition-duration:500ms"><ul class="x:grid x:gap-1"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/">欢迎阅读 Qwen Code 文档</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/deployment/">执行与部署</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/architecture/">架构概述</a></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/cli" type="button" data-headlessui-state="">CLI 使用指南<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/">CLI 概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/commands/">命令参考</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/configuration/">配置指南</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/authentication/">认证设置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/openai-auth/">OpenAI 认证</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/token-caching/">Token 缓存</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/themes/">主题配置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/tutorials/">使用教程</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/cli/welcome-back/">欢迎回来功能</a></li></ul></div></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/core" type="button" data-headlessui-state="">核心详情<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/">核心概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/tools-api/">工具 API</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/core/memport/">内存导入处理器</a></li></ul></div></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/tools" type="button" data-headlessui-state="">工具集合<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/">工具概述</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/file-system/">文件系统工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/multi-file/">多文件读取工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/shell/">Shell 工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/web-fetch/">Web 获取工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/web-search/">Web 搜索工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/memory/">内存工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/todo-write/">Todo 写入工具</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tools/mcp-server/">MCP 服务器</a></li></ul></div></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/checkpointing/">检查点功能</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/extension/">扩展开发</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/ide-integration/">IDE 集成</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/telemetry/">可观测性</a></li><li class=""><button class="x:transition x:cursor-pointer x:items-center x:justify-between x:gap-2 x:text-start x:w-full x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" data-href="/zh/examples" type="button" data-headlessui-state="">示例代码<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="18" class="x:shrink-0 x:rounded-sm x:p-0.5 x:hover:bg-gray-800/5 x:dark:hover:bg-gray-100/5 x:motion-reduce:transition-none x:origin-center x:transition-all x:rtl:-rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div class="x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none x:opacity-0 x:overflow-hidden" style="height:0;transition-duration:300ms"><ul class="x:grid x:gap-1 x:relative x:before:absolute x:before:inset-y-1 x:before:w-px x:before:bg-gray-200 x:before:content-[&quot;&quot;] x:dark:before:bg-neutral-800 x:ps-3 x:before:start-0 x:pt-1 x:ms-3"><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/examples/proxy-script/">代理脚本示例</a></li></ul></div></li><li class="active"><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:bg-primary-100 x:font-semibold x:text-primary-800 x:dark:bg-primary-400/10 x:dark:text-primary-600 x:contrast-more:border-primary-500!" href="/qwen-code-docs/zh/npm/">包管理</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/gemini-ignore/">忽略文件配置</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/integration-tests/">集成测试</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/keyboard-shortcuts/">快捷键参考</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/sandbox/">沙箱机制</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/issue-and-pr-automation/">自动化处理</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/troubleshooting/">故障排除</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/tos-privacy/">服务条款与隐私</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/Uninstall/">卸载指南</a></li><li class=""><a class="x:focus-visible:nextra-focus x:flex x:rounded x:px-2 x:py-1.5 x:text-sm x:transition-colors x:[word-break:break-word] x:cursor-pointer x:contrast-more:border x:text-gray-600 x:hover:bg-gray-100 x:hover:text-gray-900 x:dark:text-neutral-400 x:dark:hover:bg-primary-100/5 x:dark:hover:text-gray-50 x:contrast-more:text-gray-900 x:contrast-more:dark:text-gray-50 x:contrast-more:border-transparent x:contrast-more:hover:border-gray-900 x:contrast-more:dark:hover:border-gray-50" href="/qwen-code-docs/zh/subagents/">Subagents</a></li></ul></div></div><div class="x:sticky x:bottom-0 x:bg-nextra-bg nextra-sidebar-footer x:border-t nextra-border x:flex x:items-center x:gap-2 x:py-4 x:mx-4"><button title="Change language" class="x:cursor-pointer x:h-7 x:rounded-md x:px-2 x:text-xs x:font-medium x:transition-colors x:text-gray-600 x:dark:text-gray-400 x:flex x:items-center x:gap-2 x:grow" id="headlessui-listbox-button-:R6rapuun9ukq:" type="button" aria-haspopup="listbox" aria-expanded="false" data-headlessui-state=""><svg viewBox="2 2 16 16" fill="currentColor" height="12"><path fill-rule="evenodd" d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z"></path></svg>中文</button><button title="Change theme" class="x:cursor-pointer x:h-7 x:rounded-md x:px-2 x:text-xs x:font-medium x:transition-colors x:text-gray-600 x:dark:text-gray-400 x:flex x:items-center x:gap-2" id="headlessui-listbox-button-:R6tapuun9ukq:" type="button" aria-haspopup="listbox" aria-expanded="false" data-headlessui-state=""><svg fill="currentColor" viewBox="2 2 20 20" stroke="currentColor" height="12"><path stroke-linecap="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg></button><button class="x:transition x:cursor-pointer x:rounded-md x:p-2 x:text-gray-600 x:dark:text-gray-400" aria-expanded="true" aria-controls=":Rpuun9ukq:" title="Collapse sidebar" type="button" data-headlessui-state=""><svg viewBox="0 0 16 16" fill="currentColor" height="12" class=""><path d="M4.177 7.823l2.396-2.396A.25.25 0 017 5.604v4.792a.25.25 0 01-.427.177L4.177 8.177a.25.25 0 010-.354z"></path><path fill-rule="evenodd" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0114.25 16H1.75A1.75 1.75 0 010 14.25V1.75zm1.75-.25a.25.25 0 00-.25.25v12.5c0 .138.112.25.25.25H9.5v-13H1.75zm12.5 13H11v-13h3.25a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25z"></path></svg></button></div></aside><nav class="nextra-toc x:order-last x:max-xl:hidden x:w-64 x:shrink-0 x:print:hidden" aria-label="table of contents"><div class="x:grid x:grid-rows-[min-content_1fr_min-content] x:sticky x:top-(--nextra-navbar-height) x:text-sm x:max-h-[calc(100vh-var(--nextra-navbar-height))]"><p class="x:pt-6 x:px-4 x:font-semibold x:tracking-tight">On This Page</p><ul class="x:p-4 nextra-scrollbar x:overscroll-y-contain x:overflow-y-auto x:hyphens-auto nextra-mask"><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#qwen-codeqwen-code" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words"><code class="nextra-code" dir="ltr">@qwen-code/qwen-code</code></a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#qwen-codeqwen-code-core" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words"><code class="nextra-code" dir="ltr">@qwen-code/qwen-code-core</code></a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#如何发布" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">如何发布</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#nightly-发布" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">Nightly 发布</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#流程" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">流程</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#故障处理" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">故障处理</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#如何使用-nightly-build" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">如何使用 Nightly Build</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#发布之后" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">发布之后</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#发布验证" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">发布验证</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#何时合并版本变更何时不合并" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">何时合并版本变更,何时不合并?</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#合并回-main-分支以更新稳定补丁和热修复" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">合并回 main 分支以更新稳定补丁和热修复</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#预发布版本rcbetadev不要合并回主分支" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">预发布版本(RC、Beta、Dev)不要合并回主分支</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#本地测试与验证打包和发布流程的变更" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">本地测试与验证:打包和发布流程的变更</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#release-deep-dive" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">Release Deep Dive</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#阶段-1发布前检查与版本更新" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">阶段 1:发布前检查与版本更新</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#阶段-2构建源代码" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">阶段 2:构建源代码</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#阶段-3组装最终可发布的包" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">阶段 3:组装最终可发布的包</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#1-转换-packagejson" class="x:focus-visible:nextra-focus x:ms-6 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">1. 转换 <code class="nextra-code" dir="ltr">package.json</code></a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#2-创建-javascript-bundle" class="x:focus-visible:nextra-focus x:ms-6 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">2. 创建 JavaScript Bundle</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#3-复制静态和支持文件" class="x:focus-visible:nextra-focus x:ms-6 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">3. 复制静态和支持文件</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#阶段-4发布到-npm" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">阶段 4:发布到 NPM</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#文件流转概览" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">文件流转概览</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#npm-workspaces" class="x:focus-visible:nextra-focus x:font-semibold x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">NPM Workspaces</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#工作原理" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">工作原理</a></li><li class="x:my-2 x:scroll-my-6 x:scroll-py-6"><a href="#workspaces-的优势" class="x:focus-visible:nextra-focus x:ms-3 x:block x:transition-colors x:subpixel-antialiased x:text-gray-600 x:hover:text-gray-900 x:dark:text-gray-400 x:dark:hover:text-gray-300 x:contrast-more:text-gray-900 x:contrast-more:underline x:contrast-more:dark:text-gray-50 x:break-words">Workspaces 的优势</a></li></ul><div class="x:grid x:gap-2 x:py-4 x:mx-4 x:border-t nextra-border"><a href="https://github.com/QwenLM/qwen-code/issues/new?title=Feedback%20for%20%E2%80%9CPackage%20Overview%E2%80%9D&amp;labels=feedback" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-xs x:font-medium x:transition x:text-gray-600 x:dark:text-gray-400 x:hover:text-gray-800 x:dark:hover:text-gray-200 x:contrast-more:text-gray-700 x:contrast-more:dark:text-gray-100">Question? Give us feedback<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a><a href="https://github.com/QwenLM/qwen-code/blob/main/docs/content/zh/npm.md" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-xs x:font-medium x:transition x:text-gray-600 x:dark:text-gray-400 x:hover:text-gray-800 x:dark:hover:text-gray-200 x:contrast-more:text-gray-700 x:contrast-more:dark:text-gray-100">Edit this page<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a><button class="x:transition x:cursor-pointer x:flex x:items-center x:gap-1.5 x:whitespace-nowrap x:opacity-0 x:text-xs x:font-medium x:transition x:text-gray-600 x:dark:text-gray-400 x:hover:text-gray-800 x:dark:hover:text-gray-200 x:contrast-more:text-gray-700 x:contrast-more:dark:text-gray-100" aria-hidden="true" type="button" disabled="" data-headlessui-state="disabled" data-disabled="">Scroll to top<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="1.1em" class="x:-rotate-90 x:border x:rounded-full x:border-current"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div></div></nav><article class="x:w-full x:min-w-0 x:break-words x:min-h-[calc(100vh-var(--nextra-navbar-height))] x:text-slate-700 x:dark:text-slate-200 x:pb-8 x:px-4 x:pt-4 x:md:px-12"><div class="nextra-breadcrumb x:mt-1.5 x:flex x:items-center x:gap-1 x:overflow-hidden x:text-sm x:text-gray-600 x:dark:text-gray-400 x:contrast-more:text-current"><span class="x:whitespace-nowrap x:transition-colors x:font-medium x:text-black x:dark:text-gray-100" title="包管理">包管理</span></div><div id="nextra-skip-nav"></div><main data-pagefind-body="true"><h1 class="x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-bold x:mt-2 x:text-4xl">Package Overview</h1>
<p class="x:not-first:mt-[1.25em] x:leading-7">这个 monorepo 包含两个主要 package:<code class="nextra-code" dir="ltr">@qwen-code/qwen-code</code> 和 <code class="nextra-code" dir="ltr">@qwen-code/qwen-code-core</code>。</p>
<h2 id="qwen-codeqwen-code" class="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"><code class="nextra-code" dir="ltr">@qwen-code/qwen-code</code><a href="#qwen-codeqwen-code" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">这是 Qwen Code 的主 package。它负责用户界面、命令解析以及所有其他面向用户的 functionality。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">当这个 package 发布时,会被打包成一个单独的可执行文件。这个 bundle 包含了所有 package 的 dependencies,包括 <code class="nextra-code" dir="ltr">@qwen-code/qwen-code-core</code>。这意味着无论用户是通过 <code class="nextra-code" dir="ltr">npm install -g @qwen-code/qwen-code</code> 安装,还是直接使用 <code class="nextra-code" dir="ltr">npx @qwen-code/qwen-code</code> 运行,他们使用的都是这个单一的、自包含的可执行文件。</p>
<h2 id="qwen-codeqwen-code-core" class="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"><code class="nextra-code" dir="ltr">@qwen-code/qwen-code-core</code><a href="#qwen-codeqwen-code-core" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">这个 package 包含了 CLI 的核心逻辑。它负责向配置的 providers 发起 API 请求、处理身份验证以及管理本地缓存。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">这个 package 并未被打包。发布时,它会作为一个标准的 Node.js package 进行发布,并带有其自身的依赖项。这使得它可以在其他项目中作为独立 package 使用(如有需要)。所有在 <code class="nextra-code" dir="ltr">dist</code> 文件夹中的转译后的 js 代码都会包含在 package 中。</p>
<h1 class="x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:font-bold x:mt-2 x:text-4xl">发布流程</h1>
<p class="x:not-first:mt-[1.25em] x:leading-7">本项目遵循结构化的发布流程,以确保所有 packages 都能被正确地版本化和发布。该流程的设计目标是尽可能实现自动化。</p>
<h2 id="如何发布" class="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">如何发布<a href="#如何发布" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">发布通过 <a href="https://github.com/QwenLM/qwen-code/actions/workflows/release.yml" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">release.yml<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a> GitHub Actions 工作流进行管理。要手动发布一个 patch 或 hotfix 版本:</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">进入仓库的 <strong>Actions</strong> 标签页。</li>
<li class="x:my-[.5em]">从列表中选择 <strong>Release</strong> 工作流。</li>
<li class="x:my-[.5em]">点击 <strong>Run workflow</strong> 下拉按钮。</li>
<li class="x:my-[.5em]">填写所需的输入项:
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>Version</strong>:要发布的具体版本号(例如 <code class="nextra-code" dir="ltr">v0.2.1</code>)。</li>
<li class="x:my-[.5em]"><strong>Ref</strong>:要发布的目标分支或 commit SHA(默认为 <code class="nextra-code" dir="ltr">main</code>)。</li>
<li class="x:my-[.5em]"><strong>Dry Run</strong>:保留为 <code class="nextra-code" dir="ltr">true</code> 可在不实际发布的情况下测试工作流,设置为 <code class="nextra-code" dir="ltr">false</code> 则执行真实发布。</li>
</ul>
</li>
<li class="x:my-[.5em]">点击 <strong>Run workflow</strong>。</li>
</ol>
<h2 id="nightly-发布" class="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">Nightly 发布<a href="#nightly-发布" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">除了手动发布之外,该项目还具有自动化的 nightly 发布流程,用于提供最新的“前沿”版本,供测试和开发使用。</p>
<h3 id="流程" class="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">流程<a href="#流程" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">每天 UTC 时间午夜,<a href="https://github.com/QwenLM/qwen-code/actions/workflows/release.yml" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">Release workflow<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a> 会按计划自动运行。它会执行以下步骤:</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">检出 <code class="nextra-code" dir="ltr">main</code> 分支的最新代码。</li>
<li class="x:my-[.5em]">安装所有依赖项。</li>
<li class="x:my-[.5em]">运行完整的 <code class="nextra-code" dir="ltr">preflight</code> 检查和集成测试套件。</li>
<li class="x:my-[.5em]">如果所有测试都通过,它会计算下一个 nightly 版本号(例如 <code class="nextra-code" dir="ltr">v0.2.1-nightly.20230101</code>)。</li>
<li class="x:my-[.5em]">然后构建并将 packages 发布到 npm,并使用 <code class="nextra-code" dir="ltr">nightly</code> dist-tag。</li>
<li class="x:my-[.5em]">最后,为该 nightly 版本创建一个 GitHub Release。</li>
</ol>
<h3 id="故障处理" class="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">故障处理<a href="#故障处理" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">如果 nightly workflow 中的任何步骤失败,它会自动在仓库中创建一个新 issue,并打上 <code class="nextra-code" dir="ltr">bug</code> 和 <code class="nextra-code" dir="ltr">nightly-failure</code> 标签。该 issue 会包含指向失败 workflow 运行的链接,方便调试。</p>
<h3 id="如何使用-nightly-build" class="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">如何使用 Nightly Build<a href="#如何使用-nightly-build" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">要安装最新的 nightly build,可以使用 <code class="nextra-code" dir="ltr">@nightly</code> tag:</p>
<div data-pagefind-ignore="all" class="nextra-code x:relative x:not-first:mt-[1.25em]"><pre class="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"><div class="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"><button class="x:transition x:cursor-pointer x:border x:border-gray-300 x:dark:border-neutral-700 x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50 x:rounded-md x:p-1.5 x:md:hidden" title="Toggle word wrap" type="button" data-headlessui-state=""><svg viewBox="0 0 24 24" fill="currentColor" height="1em"><path 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"></path></svg></button></div><code class="nextra-code" dir="ltr"><span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -g</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> @qwen-code/qwen-code@nightly</span></span></code></pre></div>
<p class="x:not-first:mt-[1.25em] x:leading-7">我们还会运行一个名为 <a class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]" href="../.gcp/release-docker.yml">release-docker.yml</a> 的 Google Cloud Build,它会发布与你的 release 对应的 sandbox Docker 镜像。一旦 service account 权限问题解决后,这部分也会迁移到 GitHub,并与主 release 文件合并。</p>
<h3 id="发布之后" class="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">发布之后<a href="#发布之后" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">当 workflow 成功完成后,你可以在 <a href="https://github.com/QwenLM/qwen-code/actions/workflows/release.yml" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">GitHub Actions tab<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a> 中监控其进度。完成后,请执行以下操作:</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">前往仓库的 <a href="https://github.com/QwenLM/qwen-code/pulls" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">pull requests 页面<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a>。</li>
<li class="x:my-[.5em]">从 <code class="nextra-code" dir="ltr">release/vX.Y.Z</code> 分支向 <code class="nextra-code" dir="ltr">main</code> 分支创建一个新的 pull request。</li>
<li class="x:my-[.5em]">审查该 pull request(应该只包含 <code class="nextra-code" dir="ltr">package.json</code> 文件中的版本更新),然后合并它。这样可以保持 <code class="nextra-code" dir="ltr">main</code> 分支中的版本为最新。</li>
</ol>
<h2 id="发布验证" class="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">发布验证<a href="#发布验证" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">推送新版本后,应进行冒烟测试以确保包按预期工作。可以通过本地安装包并运行一组测试来验证其功能是否正常。</p>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">npx -y @qwen-code/qwen-code@latest --version</code> 用于验证推送是否成功(如果不使用 rc 或 dev 标签)</li>
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">npx -y @qwen-code/qwen-code@&lt;release tag&gt; --version</code> 用于验证标签是否正确推送</li>
<li class="x:my-[.5em]"><em>这会在本地产生破坏性影响</em>:<code class="nextra-code" dir="ltr">npm uninstall @qwen-code/qwen-code &amp;&amp; npm uninstall -g @qwen-code/qwen-code &amp;&amp; npm cache clean --force &amp;&amp; npm install @qwen-code/qwen-code@&lt;version&gt;</code></li>
<li class="x:my-[.5em]">建议对几个 LLM 命令和工具进行基本的运行测试,以确保包按预期工作。我们未来会进一步规范这一流程。</li>
</ul>
<h2 id="何时合并版本变更何时不合并" class="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">何时合并版本变更,何时不合并?<a href="#何时合并版本变更何时不合并" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">上述从当前或较旧的 commit 创建 patch 或 hotfix 发布的模式会使 repository 处于以下状态:</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">Tag (<code class="nextra-code" dir="ltr">vX.Y.Z-patch.1</code>):这个 tag 正确指向 main 分支上包含稳定代码的原始 commit,这正是你打算发布的代码。这一点至关重要。任何人检出这个 tag 都能得到确切的已发布代码。</li>
<li class="x:my-[.5em]">Branch (<code class="nextra-code" dir="ltr">release-vX.Y.Z-patch.1</code>):这个分支在 tag 指向的 commit 基础上包含一个新的 commit。这个新 commit 只包含 package.json 中的版本号变更(以及其他相关文件如 package-lock.json)。</li>
</ol>
<p class="x:not-first:mt-[1.25em] x:leading-7">这种分离是很好的做法。它让你的 main 分支历史保持干净,不会包含发布特定的版本号提升,直到你决定要合并它们。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">这是关键的决策点,完全取决于发布的性质。</p>
<h3 id="合并回-main-分支以更新稳定补丁和热修复" class="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">合并回 main 分支以更新稳定补丁和热修复<a href="#合并回-main-分支以更新稳定补丁和热修复" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">对于任何稳定补丁或热修复版本,你几乎总是需要将 <code class="nextra-code" dir="ltr">release-&lt;tag&gt;</code> 分支合并回 <code class="nextra-code" dir="ltr">main</code> 分支。</p>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]">
<p class="x:not-first:mt-[1.25em] x:leading-7"><strong>为什么?</strong> 主要原因是为了更新 main 分支中 package.json 的版本号。如果你从一个较旧的 commit 发布了 v1.2.1 版本,但从未将版本号更新合并回 main,那么你的 main 分支的 package.json 仍然会显示 <code class="nextra-code" dir="ltr">&quot;version&quot;: &quot;1.2.0&quot;</code>。下一个开始开发下一个功能版本(v1.3.0)的开发者将会基于一个版本号不正确、较旧的代码库进行开发。这会导致混淆,并需要后续手动更新版本号。</p>
</li>
<li class="x:my-[.5em]">
<p class="x:not-first:mt-[1.25em] x:leading-7"><strong>流程:</strong> 在 release-v1.2.1 分支创建完成并且 package 成功发布后,你应该创建一个 pull request 将 release-v1.2.1 合并到 main 分支。这个 PR 只会包含一个 commit:<code class="nextra-code" dir="ltr">&quot;chore: bump version to v1.2.1&quot;</code>。这是一个干净、简单的集成操作,能够保持你的 main 分支与最新发布的版本同步。</p>
</li>
</ul>
<h3 id="预发布版本rcbetadev不要合并回主分支" class="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">预发布版本(RC、Beta、Dev)不要合并回主分支<a href="#预发布版本rcbetadev不要合并回主分支" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">通常情况下,你不应该将预发布版本的 release 分支合并回 <code class="nextra-code" dir="ltr">main</code> 分支。</p>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]">为什么?预发布版本(例如 v1.3.0-rc.1、v1.3.0-rc.2)本质上是不稳定的临时版本。你不希望用一系列的 RC 版本号更新来污染 main 分支的历史记录。main 分支中的 package.json 应该反映最新的稳定版本,而不是 RC 版本。</li>
<li class="x:my-[.5em]">流程:创建 release-v1.3.0-rc.1 分支,执行 <code class="nextra-code" dir="ltr">npm publish --tag rc</code>,然后……这个分支就完成使命了。你可以直接删除它。RC 版本的代码已经在 main 分支(或某个 feature 分支)上了,所以不会丢失任何功能代码。release 分支只是用来临时承载版本号的载体。</li>
</ul>
<h2 id="本地测试与验证打包和发布流程的变更" class="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">本地测试与验证:打包和发布流程的变更<a href="#本地测试与验证打包和发布流程的变更" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">如果你需要在不实际发布到 NPM 或创建公开 GitHub release 的情况下测试发布流程,你可以通过 GitHub UI 手动触发 workflow。</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">进入仓库的 <a href="https://github.com/QwenLM/qwen-code/actions/workflows/release.yml" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">Actions tab<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a>。</li>
<li class="x:my-[.5em]">点击 “Run workflow” 下拉菜单。</li>
<li class="x:my-[.5em]">保持 <code class="nextra-code" dir="ltr">dry_run</code> 选项为勾选状态(即 <code class="nextra-code" dir="ltr">true</code>)。</li>
<li class="x:my-[.5em]">点击 “Run workflow” 按钮。</li>
</ol>
<p class="x:not-first:mt-[1.25em] x:leading-7">这将运行整个发布流程,但会跳过 <code class="nextra-code" dir="ltr">npm publish</code> 和 <code class="nextra-code" dir="ltr">gh release create</code> 步骤。你可以查看 workflow 日志,确保一切按预期工作。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">在提交任何对打包和发布流程的更改之前,在本地进行测试是至关重要的。这样可以确保包能被正确发布,并且用户安装后能按预期工作。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">要验证你的更改,可以执行一次发布流程的 dry run。这会模拟发布过程,但不会真正将包发布到 npm registry。</p>
<div data-pagefind-ignore="all" class="nextra-code x:relative x:not-first:mt-[1.25em]"><pre class="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"><div class="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"><button class="x:transition x:cursor-pointer x:border x:border-gray-300 x:dark:border-neutral-700 x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50 x:rounded-md x:p-1.5 x:md:hidden" title="Toggle word wrap" type="button" data-headlessui-state=""><svg viewBox="0 0 24 24" fill="currentColor" height="1em"><path 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"></path></svg></button></div><code class="nextra-code" dir="ltr"><span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">npm_package_version</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">9.9.9</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> SANDBOX_IMAGE_REGISTRY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">&quot;registry&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> SANDBOX_IMAGE_NAME</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">&quot;thename&quot;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> publish:npm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --dry-run</span></span></code></pre></div>
<p class="x:not-first:mt-[1.25em] x:leading-7">该命令将执行以下操作:</p>
<ol class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6">
<li class="x:my-[.5em]">构建所有包。</li>
<li class="x:my-[.5em]">运行所有 prepublish 脚本。</li>
<li class="x:my-[.5em]">创建将要发布到 npm 的 tarball 包。</li>
<li class="x:my-[.5em]">打印将要发布的包的摘要信息。</li>
</ol>
<p class="x:not-first:mt-[1.25em] x:leading-7">然后你可以检查生成的 tarball,确保它们包含正确的文件,并且 <code class="nextra-code" dir="ltr">package.json</code> 文件已正确更新。tarball 将会在每个包的根目录下生成(例如:<code class="nextra-code" dir="ltr">packages/cli/qwen-code-0.1.6.tgz</code>)。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">通过执行 dry run,你可以确认对打包流程的修改是正确的,并且包能够成功发布。</p>
<h2 id="release-deep-dive" class="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">Release Deep Dive<a href="#release-deep-dive" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">发布流程的主要目标是从 <code class="nextra-code" dir="ltr">packages/</code> 目录中获取源代码,进行构建,并在项目根目录下的临时 <code class="nextra-code" dir="ltr">bundle</code> 文件夹中组装一个干净、自包含的包。这个 <code class="nextra-code" dir="ltr">bundle</code> 目录就是最终发布到 NPM 的内容。</p>
<p class="x:not-first:mt-[1.25em] x:leading-7">以下是关键阶段:</p>
<h3 id="阶段-1发布前检查与版本更新" class="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">阶段 1:发布前检查与版本更新<a href="#阶段-1发布前检查与版本更新" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:在移动任何文件之前,流程会确保项目处于良好状态。这包括运行测试、linting 和类型检查(<code class="nextra-code" dir="ltr">npm run preflight</code>)。同时,根目录下的 <code class="nextra-code" dir="ltr">package.json</code> 和 <code class="nextra-code" dir="ltr">packages/cli/package.json</code> 中的版本号会被更新为新的发布版本。</li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:这确保了只有高质量、可运行的代码才会被发布。版本更新是新发布的第一个标志。</li>
</ul>
<h3 id="阶段-2构建源代码" class="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">阶段 2:构建源代码<a href="#阶段-2构建源代码" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:将 <code class="nextra-code" dir="ltr">packages/core/src</code> 和 <code class="nextra-code" dir="ltr">packages/cli/src</code> 中的 TypeScript 源代码编译为 JavaScript。</li>
<li class="x:my-[.5em]"><strong>文件移动</strong>:
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">packages/core/src/**/*.ts</code> -&gt; 编译为 -&gt; <code class="nextra-code" dir="ltr">packages/core/dist/</code></li>
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">packages/cli/src/**/*.ts</code> -&gt; 编译为 -&gt; <code class="nextra-code" dir="ltr">packages/cli/dist/</code></li>
</ul>
</li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:开发过程中编写的 TypeScript 需要转换为 Node.js 可执行的纯 JavaScript。core 包会先构建,因为 cli 包依赖它。</li>
</ul>
<h3 id="阶段-3组装最终可发布的包" class="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">阶段 3:组装最终可发布的包<a href="#阶段-3组装最终可发布的包" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">这是最关键的一个阶段,文件会被移动并转换为最终用于发布的状态。项目根目录会创建一个临时的 <code class="nextra-code" dir="ltr">bundle</code> 文件夹,用于存放最终的包内容。</p>
<h4 id="1-转换-packagejson" class="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-xl">1. 转换 <code class="nextra-code" dir="ltr">package.json</code><a href="#1-转换-packagejson" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h4>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:读取 <code class="nextra-code" dir="ltr">packages/cli/package.json</code>,进行修改后写入项目根目录的 <code class="nextra-code" dir="ltr">bundle/</code> 文件夹中。</li>
<li class="x:my-[.5em]"><strong>文件移动</strong>:<code class="nextra-code" dir="ltr">packages/cli/package.json</code> -&gt;(内存中转换)-&gt; <code class="nextra-code" dir="ltr">bundle/package.json</code></li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:最终的 <code class="nextra-code" dir="ltr">package.json</code> 必须与开发时使用的不同。关键变化包括:
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]">移除 <code class="nextra-code" dir="ltr">devDependencies</code>。</li>
<li class="x:my-[.5em]">移除 workspace 特定的依赖项:<code class="nextra-code" dir="ltr">{ &quot;@qwen-code/core&quot;: &quot;workspace:*&quot; }</code>,并确保 core 代码被直接打包进最终的 JavaScript 文件中。</li>
<li class="x:my-[.5em]">确保 <code class="nextra-code" dir="ltr">bin</code>、<code class="nextra-code" dir="ltr">main</code> 和 <code class="nextra-code" dir="ltr">files</code> 字段指向最终包结构中的正确位置。</li>
</ul>
</li>
</ul>
<h4 id="2-创建-javascript-bundle" class="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-xl">2. 创建 JavaScript Bundle<a href="#2-创建-javascript-bundle" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h4>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:将 <code class="nextra-code" dir="ltr">packages/core/dist</code> 和 <code class="nextra-code" dir="ltr">packages/cli/dist</code> 中构建好的 JavaScript 代码打包成一个单独的可执行 JavaScript 文件。</li>
<li class="x:my-[.5em]"><strong>文件移动</strong>:<code class="nextra-code" dir="ltr">packages/cli/dist/index.js</code> + <code class="nextra-code" dir="ltr">packages/core/dist/index.js</code> -&gt;(由 esbuild 打包)-&gt; <code class="nextra-code" dir="ltr">bundle/gemini.js</code>(或类似名称)。</li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:这样可以创建一个包含所有必要应用代码的单一优化文件。它简化了包结构,不再需要将 core 包作为单独的 NPM 依赖项,因为其代码已直接包含在内。</li>
</ul>
<h4 id="3-复制静态和支持文件" class="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-xl">3. 复制静态和支持文件<a href="#3-复制静态和支持文件" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h4>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:将不属于源代码但对包的正常运行或描述必要的文件复制到 <code class="nextra-code" dir="ltr">bundle</code> 目录中。</li>
<li class="x:my-[.5em]"><strong>文件移动</strong>:
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">README.md</code> -&gt; <code class="nextra-code" dir="ltr">bundle/README.md</code></li>
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">LICENSE</code> -&gt; <code class="nextra-code" dir="ltr">bundle/LICENSE</code></li>
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">packages/cli/src/utils/*.sb</code>(沙箱配置文件)-&gt; <code class="nextra-code" dir="ltr">bundle/</code></li>
</ul>
</li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><code class="nextra-code" dir="ltr">README.md</code> 和 <code class="nextra-code" dir="ltr">LICENSE</code> 是任何 NPM 包都应包含的标准文件。</li>
<li class="x:my-[.5em]">沙箱配置文件(.sb 文件)是 CLI 沙箱功能运行所必需的关键运行时资源,必须与最终可执行文件位于同一目录下。</li>
</ul>
</li>
</ul>
<h3 id="阶段-4发布到-npm" class="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">阶段 4:发布到 NPM<a href="#阶段-4发布到-npm" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>发生了什么</strong>:在项目根目录的 <code class="nextra-code" dir="ltr">bundle</code> 文件夹中运行 <code class="nextra-code" dir="ltr">npm publish</code> 命令。</li>
<li class="x:my-[.5em]"><strong>为什么这么做</strong>:通过在 <code class="nextra-code" dir="ltr">bundle</code> 目录中运行 <code class="nextra-code" dir="ltr">npm publish</code>,只有我们在阶段 3 中精心组装的文件会被上传到 NPM registry。这可以防止源代码、测试文件或开发配置被意外发布,从而为用户提供一个干净、最小化的包。</li>
</ul>
<h3 id="文件流转概览" class="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">文件流转概览<a href="#文件流转概览" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<div></div>
<p class="x:not-first:mt-[1.25em] x:leading-7">这个流程确保了最终发布的产物是一个专为发布而构建的、干净且高效的项目表示,而不是开发工作区的直接拷贝。</p>
<h2 id="npm-workspaces" class="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">NPM Workspaces<a href="#npm-workspaces" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h2>
<p class="x:not-first:mt-[1.25em] x:leading-7">本项目使用 <a href="https://docs.npmjs.com/cli/v10/using-npm/workspaces" target="_blank" rel="noreferrer" class="x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]">NPM Workspaces<!-- --> <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" viewBox="0 0 24 24" height="1em" class="x:inline x:align-baseline x:shrink-0"><path d="M7 17L17 7"></path><path d="M7 7h10v10"></path></svg></a> 来管理 monorepo 中的各个 packages。这简化了开发流程,使我们能够从项目根目录统一管理依赖和运行多个 packages 中的 scripts。</p>
<h3 id="工作原理" class="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">工作原理<a href="#工作原理" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<p class="x:not-first:mt-[1.25em] x:leading-7">根目录下的 <code class="nextra-code" dir="ltr">package.json</code> 文件定义了本项目的工作区:</p>
<div data-pagefind-ignore="all" class="nextra-code x:relative x:not-first:mt-[1.25em]"><pre class="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"><div class="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"><button class="x:transition x:cursor-pointer x:border x:border-gray-300 x:dark:border-neutral-700 x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50 x:rounded-md x:p-1.5 x:md:hidden" title="Toggle word wrap" type="button" data-headlessui-state=""><svg viewBox="0 0 24 24" fill="currentColor" height="1em"><path 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"></path></svg></button></div><code class="nextra-code" dir="ltr"><span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> &quot;workspaces&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">&quot;packages/*&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]</span></span>
<span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre></div>
<p class="x:not-first:mt-[1.25em] x:leading-7">这告诉 NPM,<code class="nextra-code" dir="ltr">packages</code> 目录下的任何文件夹都是一个独立的 package,应该作为 workspace 的一部分进行管理。</p>
<h3 id="workspaces-的优势" class="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">Workspaces 的优势<a href="#workspaces-的优势" class="x:focus-visible:nextra-focus subheading-anchor" aria-label="Permalink for this section"></a></h3>
<ul class="x:[:is(ol,ul)_&amp;]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]">
<li class="x:my-[.5em]"><strong>简化的依赖管理</strong>:从项目根目录运行 <code class="nextra-code" dir="ltr">npm install</code> 将会为 workspace 中的所有包安装依赖并相互链接。这意味着你不需要在每个包的目录中分别运行 <code class="nextra-code" dir="ltr">npm install</code>。</li>
<li class="x:my-[.5em]"><strong>自动链接</strong>:workspace 内的包可以相互依赖。当你运行 <code class="nextra-code" dir="ltr">npm install</code> 时,NPM 会自动在包之间创建符号链接(symlinks)。这意味着当你修改某个包时,依赖它的其他包可以立即使用到这些更改。</li>
<li class="x:my-[.5em]"><strong>简化的脚本执行</strong>:你可以使用 <code class="nextra-code" dir="ltr">--workspace</code> 参数从项目根目录运行任意包中的脚本。例如,要在 <code class="nextra-code" dir="ltr">cli</code> 包中运行 <code class="nextra-code" dir="ltr">build</code> 脚本,可以执行 <code class="nextra-code" dir="ltr">npm run build --workspace @qwen-code/qwen-code</code>。</li>
</ul></main><div class="x:mt-12 x:mb-8 x:text-xs x:text-gray-600 x:text-end x:dark:text-gray-400">Last updated on<!-- --> <time dateTime="2026-09-17T17:32:34.000Z">2026年9月17日</time></div><div class="x:mb-8 x:flex x:items-center x:border-t x:pt-8 nextra-border x:print:hidden"><a title="代理脚本示例" class="x:focus-visible:nextra-focus x:text-gray-600 x:dark:text-gray-400 x:hover:text-gray-800 x:dark:hover:text-gray-200 x:contrast-more:text-gray-700 x:contrast-more:dark:text-gray-100 x:flex x:max-w-[50%] x:items-center x:gap-1 x:py-4 x:text-base x:font-medium x:transition-colors x:[word-break:break-word] x:md:text-lg x:pe-4" href="/qwen-code-docs/zh/examples/proxy-script/"><svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="20" class="x:inline x:shrink-0 x:ltr:rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg>代理脚本示例</a><a title="忽略文件配置" class="x:focus-visible:nextra-focus x:text-gray-600 x:dark:text-gray-400 x:hover:text-gray-800 x:dark:hover:text-gray-200 x:contrast-more:text-gray-700 x:contrast-more:dark:text-gray-100 x:flex x:max-w-[50%] x:items-center x:gap-1 x:py-4 x:text-base x:font-medium x:transition-colors x:[word-break:break-word] x:md:text-lg x:ps-4 x:ms-auto x:text-end" href="/qwen-code-docs/zh/gemini-ignore/">忽略文件配置<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" height="20" class="x:inline x:shrink-0 x:rtl:rotate-180"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"></path></svg></a></div></article></div><script src="/qwen-code-docs/_next/static/chunks/webpack-6175f18c4ffcc31c.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/qwen-code-docs/_next/static/css/7fba7395046b8eaa.css\",\"style\"]\n2:HL[\"/qwen-code-docs/_next/static/css/04d76539cc2c4ebd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"3:I[12846,[],\"\"]\n6:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[78400,[\"3185\",\"static/chunks/app/layout-38b548b4f4d27f80.js\"],\"FontLoader\"]\nd:I[61060,[],\"\"]\n7:[\"lang\",\"zh\",\"d\"]\n8:[\"mdxPath\",\"npm\",\"oc\"]\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L3\",null,{\"buildId\":\"0y8u-WGJo2VFWAF7bkrdx\",\"assetPrefix\":\"/qwen-code-docs\",\"urlParts\":[\"\",\"zh\",\"npm\",\"\"],\"initialTree\":[\"\",{\"children\":[[\"lang\",\"zh\",\"d\"],{\"children\":[[\"mdxPath\",\"npm\",\"oc\"],{\"children\":[\"__PAGE__?{\\\"lang\\\":\\\"zh\\\",\\\"mdxPath\\\":[\\\"npm\\\"]}\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[[\"lang\",\"zh\",\"d\"],{\"children\":[[\"mdxPath\",\"npm\",\"oc\"],{\"children\":[\"__PAGE__\",{},[[\"$L4\",\"$L5\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/qwen-code-docs/_next/static/css/04d76539cc2c4ebd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$7\",\"children\",\"$8\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[null,\"$La\"],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\":[[\"$\",\"$Lb\",null,{}],[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]\n"])</script><script>self.__next_f.push([1,"f: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\"]\n10: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\"]\n11: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\"]\n12: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\"]\n13: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\"]\n14: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\"]\n15: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\"],\"\"]\n16:I[88212,[\"5501\",\"static/ch"])</script><script>self.__next_f.push([1,"unks/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\"]\n18: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\"]\n19: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\"]\n1a: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\"]\n1b:\"$Sreact.fragment\"\n1c: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\"]\n1d: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\"]\n1e: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\"]\n1f:I[98451,[\"5501\",\"static/c"])</script><script>self.__next_f.push([1,"hunks/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\"]\n20:I[20735,[\"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\"],\"Mermaid\"]\n17: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 3Z"])</script><script>self.__next_f.push([1,"a:[\"$\",\"$Lf\",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\":[\"$\",\"$L10\",null,{}],\"navigation\":{\"next\":true,\"prev\":true},\"search\":[\"$\",\"$L11\",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\":[\"$\",\"$L12\",null,{\"attribute\":\"class\",\"defaultTheme\":\"light\",\"disableTransitionOnChange\":true,\"storageKey\":\"theme\",\"children\":[[\"$\",\"$L13\",null,{}],\"$undefined\",[\"$\",\"$L14\",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])~\u0026]: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\":[[\"$\",\"$L15\",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\"}]]}]}],[\"$\",\"$L16\",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\":\"$17\"}]}],false],\"className\":\"x:focus-visible:nextra-focus\"}],\"$undefined\",[\"$\",\"$L18\",null,{\"currentLang\":\"zh\"}]]}]]}]]}],\"footer\":null,\"children\":[[\"$\",\"$L19\",null,{}],[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$7\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]]}]]}]}]\n"])</script><script>self.__next_f.push([1,"5:[\"$\",\"div\",null,{\"className\":\"x:mx-auto x:flex x:max-w-(--nextra-content-width)\",\"sourceCode\":\"$undefined\",\"children\":[\"$\",\"$L1a\",null,{\"value\":[{\"value\":[[\"$\",\"$1b\",\".0\",{\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@qwen-code/qwen-code\"}]]}]],\"id\":\"qwen-codeqwen-code\",\"depth\":2},{\"value\":[[\"$\",\"$1b\",\".0\",{\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@qwen-code/qwen-code-core\"}]]}]],\"id\":\"qwen-codeqwen-code-core\",\"depth\":2},{\"value\":\"如何发布\",\"id\":\"如何发布\",\"depth\":2},{\"value\":\"Nightly 发布\",\"id\":\"nightly-发布\",\"depth\":2},{\"value\":\"流程\",\"id\":\"流程\",\"depth\":3},{\"value\":\"故障处理\",\"id\":\"故障处理\",\"depth\":3},{\"value\":\"如何使用 Nightly Build\",\"id\":\"如何使用-nightly-build\",\"depth\":3},{\"value\":\"发布之后\",\"id\":\"发布之后\",\"depth\":3},{\"value\":\"发布验证\",\"id\":\"发布验证\",\"depth\":2},{\"value\":\"何时合并版本变更,何时不合并?\",\"id\":\"何时合并版本变更何时不合并\",\"depth\":2},{\"value\":\"合并回 main 分支以更新稳定补丁和热修复\",\"id\":\"合并回-main-分支以更新稳定补丁和热修复\",\"depth\":3},{\"value\":\"预发布版本(RC、Beta、Dev)不要合并回主分支\",\"id\":\"预发布版本rcbetadev不要合并回主分支\",\"depth\":3},{\"value\":\"本地测试与验证:打包和发布流程的变更\",\"id\":\"本地测试与验证打包和发布流程的变更\",\"depth\":2},{\"value\":\"Release Deep Dive\",\"id\":\"release-deep-dive\",\"depth\":2},{\"value\":\"阶段 1:发布前检查与版本更新\",\"id\":\"阶段-1发布前检查与版本更新\",\"depth\":3},{\"value\":\"阶段 2:构建源代码\",\"id\":\"阶段-2构建源代码\",\"depth\":3},{\"value\":\"阶段 3:组装最终可发布的包\",\"id\":\"阶段-3组装最终可发布的包\",\"depth\":3},{\"value\":[[\"$\",\"$1b\",\".0\",{\"children\":[\"1. 转换 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}]]}]],\"id\":\"1-转换-packagejson\",\"depth\":4},{\"value\":\"2. 创建 JavaScript Bundle\",\"id\":\"2-创建-javascript-bundle\",\"depth\":4},{\"value\":\"3. 复制静态和支持文件\",\"id\":\"3-复制静态和支持文件\",\"depth\":4},{\"value\":\"阶段 4:发布到 NPM\",\"id\":\"阶段-4发布到-npm\",\"depth\":3},{\"value\":\"文件流转概览\",\"id\":\"文件流转概览\",\"depth\":3},{\"value\":\"NPM Workspaces\",\"id\":\"npm-workspaces\",\"depth\":2},{\"value\":\"工作原理\",\"id\":\"工作原理\",\"depth\":3},{\"value\":\"Workspaces 的优势\",\"id\":\"workspaces-的优势\",\"depth\":3}],\"children\":[[\"$\",\"$L1c\",null,{}],[\"$\",\"$L1d\",null,{\"metadata\":{\"title\":\"Package Overview\",\"filePath\":\"content/zh/npm.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\":[\"Package Overview\",\"$undefined\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"这个 monorepo 包含两个主要 package:\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@qwen-code/qwen-code\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@qwen-code/qwen-code-core\"}],\"。\"]}],\"\\n\",[\"$\",\"h2\",null,{\"id\":\"qwen-codeqwen-code\",\"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\":\"@qwen-code/qwen-code\"}],[\"$\",\"$L1e\",null,{\"id\":\"qwen-codeqwen-code\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"这是 Qwen Code 的主 package。它负责用户界面、命令解析以及所有其他面向用户的 functionality。\"}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"当这个 package 发布时,会被打包成一个单独的可执行文件。这个 bundle 包含了所有 package 的 dependencies,包括 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@qwen-code/qwen-code-core\"}],\"。这意味着无论用户是通过 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm install -g @qwen-code/qwen-code\"}],\" 安装,还是直接使用 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npx @qwen-code/qwen-code\"}],\" 运行,他们使用的都是这个单一的、自包含的可执行文件。\"]}],\"\\n\",[\"$\",\"h2\",null,{\"id\":\"qwen-codeqwen-code-core\",\"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\":\"@qwen-code/qwen-code-core\"}],[\"$\",\"$L1e\",null,{\"id\":\"qwen-codeqwen-code-core\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"这个 package 包含了 CLI 的核心逻辑。它负责向配置的 providers 发起 API 请求、处理身份验证以及管理本地缓存。\"}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"这个 package 并未被打包。发布时,它会作为一个标准的 Node.js package 进行发布,并带有其自身的依赖项。这使得它可以在其他项目中作为独立 package 使用(如有需要)。所有在 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"dist\"}],\" 文件夹中的转译后的 js 代码都会包含在 package 中。\"]}],\"\\n\",[\"$\",\"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\":[\"发布流程\",\"$undefined\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"本项目遵循结构化的发布流程,以确保所有 packages 都能被正确地版本化和发布。该流程的设计目标是尽可能实现自动化。\"}],\"\\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\":[\"如何发布\",[\"$\",\"$L1e\",null,{\"id\":\"如何发布\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"发布通过 \",[\"$\",\"a\",null,{\"href\":\"https://github.com/QwenLM/qwen-code/actions/workflows/release.yml\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"release.yml\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\" GitHub Actions 工作流进行管理。要手动发布一个 patch 或 hotfix 版本:\"]}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"Actions\"}],\" 标签页。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"从列表中选择 \",[\"$\",\"strong\",null,{\"children\":\"Release\"}],\" 工作流。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"点击 \",[\"$\",\"strong\",null,{\"children\":\"Run workflow\"}],\" 下拉按钮。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"填写所需的输入项:\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"Version\"}],\":要发布的具体版本号(例如 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"v0.2.1\"}],\")。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"Ref\"}],\":要发布的目标分支或 commit SHA(默认为 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\")。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"Dry Run\"}],\":保留为 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"true\"}],\" 可在不实际发布的情况下测试工作流,设置为 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"false\"}],\" 则执行真实发布。\"]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"点击 \",[\"$\",\"strong\",null,{\"children\":\"Run workflow\"}],\"。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h2\",null,{\"id\":\"nightly-发布\",\"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\":[\"Nightly 发布\",[\"$\",\"$L1e\",null,{\"id\":\"nightly-发布\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"除了手动发布之外,该项目还具有自动化的 nightly 发布流程,用于提供最新的“前沿”版本,供测试和开发使用。\"}],\"\\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\":[\"流程\",[\"$\",\"$L1e\",null,{\"id\":\"流程\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"每天 UTC 时间午夜,\",[\"$\",\"a\",null,{\"href\":\"https://github.com/QwenLM/qwen-code/actions/workflows/release.yml\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"Release workflow\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\" 会按计划自动运行。它会执行以下步骤:\"]}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"检出 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 分支的最新代码。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"安装所有依赖项。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"运行完整的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"preflight\"}],\" 检查和集成测试套件。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"如果所有测试都通过,它会计算下一个 nightly 版本号(例如 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"v0.2.1-nightly.20230101\"}],\")。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"然后构建并将 packages 发布到 npm,并使用 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"nightly\"}],\" dist-tag。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"最后,为该 nightly 版本创建一个 GitHub Release。\"}],\"\\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\":[\"故障处理\",[\"$\",\"$L1e\",null,{\"id\":\"故障处理\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"如果 nightly workflow 中的任何步骤失败,它会自动在仓库中创建一个新 issue,并打上 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bug\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"nightly-failure\"}],\" 标签。该 issue 会包含指向失败 workflow 运行的链接,方便调试。\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"如何使用-nightly-build\",\"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\":[\"如何使用 Nightly Build\",[\"$\",\"$L1e\",null,{\"id\":\"如何使用-nightly-build\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"要安装最新的 nightly build,可以使用 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"@nightly\"}],\" tag:\"]}],\"\\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\":[[\"$\",\"$L1f\",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\":\"npm\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\" install\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#005CC5\",\"--shiki-dark\":\"#79B8FF\"},\"children\":\" -g\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\" @qwen-code/qwen-code@nightly\"}]]}]}]]}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"我们还会运行一个名为 \",[\"$\",\"$L15\",null,{\"href\":\"../.gcp/release-docker.yml\",\"prefetch\":\"$undefined\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":\"release-docker.yml\"}],\" 的 Google Cloud Build,它会发布与你的 release 对应的 sandbox Docker 镜像。一旦 service account 权限问题解决后,这部分也会迁移到 GitHub,并与主 release 文件合并。\"]}],\"\\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\":[\"发布之后\",[\"$\",\"$L1e\",null,{\"id\":\"发布之后\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"当 workflow 成功完成后,你可以在 \",[\"$\",\"a\",null,{\"href\":\"https://github.com/QwenLM/qwen-code/actions/workflows/release.yml\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"GitHub Actions tab\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\" 中监控其进度。完成后,请执行以下操作:\"]}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"前往仓库的 \",[\"$\",\"a\",null,{\"href\":\"https://github.com/QwenLM/qwen-code/pulls\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"pull requests 页面\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\"。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"从 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"release/vX.Y.Z\"}],\" 分支向 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 分支创建一个新的 pull request。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"审查该 pull request(应该只包含 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}],\" 文件中的版本更新),然后合并它。这样可以保持 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 分支中的版本为最新。\"]}],\"\\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\":[\"发布验证\",[\"$\",\"$L1e\",null,{\"id\":\"发布验证\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"推送新版本后,应进行冒烟测试以确保包按预期工作。可以通过本地安装包并运行一组测试来验证其功能是否正常。\"}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"npx -y @qwen-code/qwen-code@latest --version\"}],\" 用于验证推送是否成功(如果不使用 rc 或 dev 标签)\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npx -y @qwen-code/qwen-code@\u003crelease tag\u003e --version\"}],\" 用于验证标签是否正确推送\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"em\",null,{\"children\":\"这会在本地产生破坏性影响\"}],\":\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm uninstall @qwen-code/qwen-code \u0026\u0026 npm uninstall -g @qwen-code/qwen-code \u0026\u0026 npm cache clean --force \u0026\u0026 npm install @qwen-code/qwen-code@\u003cversion\u003e\"}]]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"建议对几个 LLM 命令和工具进行基本的运行测试,以确保包按预期工作。我们未来会进一步规范这一流程。\"}],\"\\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\":[\"何时合并版本变更,何时不合并?\",[\"$\",\"$L1e\",null,{\"id\":\"何时合并版本变更何时不合并\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"上述从当前或较旧的 commit 创建 patch 或 hotfix 发布的模式会使 repository 处于以下状态:\"}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"Tag (\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"vX.Y.Z-patch.1\"}],\"):这个 tag 正确指向 main 分支上包含稳定代码的原始 commit,这正是你打算发布的代码。这一点至关重要。任何人检出这个 tag 都能得到确切的已发布代码。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"Branch (\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"release-vX.Y.Z-patch.1\"}],\"):这个分支在 tag 指向的 commit 基础上包含一个新的 commit。这个新 commit 只包含 package.json 中的版本号变更(以及其他相关文件如 package-lock.json)。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"这种分离是很好的做法。它让你的 main 分支历史保持干净,不会包含发布特定的版本号提升,直到你决定要合并它们。\"}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"这是关键的决策点,完全取决于发布的性质。\"}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"合并回-main-分支以更新稳定补丁和热修复\",\"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\":[\"合并回 main 分支以更新稳定补丁和热修复\",[\"$\",\"$L1e\",null,{\"id\":\"合并回-main-分支以更新稳定补丁和热修复\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"对于任何稳定补丁或热修复版本,你几乎总是需要将 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"release-\u003ctag\u003e\"}],\" 分支合并回 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 分支。\"]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么?\"}],\" 主要原因是为了更新 main 分支中 package.json 的版本号。如果你从一个较旧的 commit 发布了 v1.2.1 版本,但从未将版本号更新合并回 main,那么你的 main 分支的 package.json 仍然会显示 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"\\\"version\\\": \\\"1.2.0\\\"\"}],\"。下一个开始开发下一个功能版本(v1.3.0)的开发者将会基于一个版本号不正确、较旧的代码库进行开发。这会导致混淆,并需要后续手动更新版本号。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"流程:\"}],\" 在 release-v1.2.1 分支创建完成并且 package 成功发布后,你应该创建一个 pull request 将 release-v1.2.1 合并到 main 分支。这个 PR 只会包含一个 commit:\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"\\\"chore: bump version to v1.2.1\\\"\"}],\"。这是一个干净、简单的集成操作,能够保持你的 main 分支与最新发布的版本同步。\"]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"预发布版本rcbetadev不要合并回主分支\",\"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\":[\"预发布版本(RC、Beta、Dev)不要合并回主分支\",[\"$\",\"$L1e\",null,{\"id\":\"预发布版本rcbetadev不要合并回主分支\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"通常情况下,你不应该将预发布版本的 release 分支合并回 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 分支。\"]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-disc x:ms-[1.5em]\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"为什么?预发布版本(例如 v1.3.0-rc.1、v1.3.0-rc.2)本质上是不稳定的临时版本。你不希望用一系列的 RC 版本号更新来污染 main 分支的历史记录。main 分支中的 package.json 应该反映最新的稳定版本,而不是 RC 版本。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"流程:创建 release-v1.3.0-rc.1 分支,执行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm publish --tag rc\"}],\",然后……这个分支就完成使命了。你可以直接删除它。RC 版本的代码已经在 main 分支(或某个 feature 分支)上了,所以不会丢失任何功能代码。release 分支只是用来临时承载版本号的载体。\"]}],\"\\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\":[\"本地测试与验证:打包和发布流程的变更\",[\"$\",\"$L1e\",null,{\"id\":\"本地测试与验证打包和发布流程的变更\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"如果你需要在不实际发布到 NPM 或创建公开 GitHub release 的情况下测试发布流程,你可以通过 GitHub UI 手动触发 workflow。\"}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"进入仓库的 \",[\"$\",\"a\",null,{\"href\":\"https://github.com/QwenLM/qwen-code/actions/workflows/release.yml\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"Actions tab\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\"。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"点击 “Run workflow” 下拉菜单。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"保持 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"dry_run\"}],\" 选项为勾选状态(即 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"true\"}],\")。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"点击 “Run workflow” 按钮。\"}],\"\\n\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"这将运行整个发布流程,但会跳过 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm publish\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"gh release create\"}],\" 步骤。你可以查看 workflow 日志,确保一切按预期工作。\"]}],\"\\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\":\"要验证你的更改,可以执行一次发布流程的 dry run。这会模拟发布过程,但不会真正将包发布到 npm registry。\"}],\"\\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\":[[\"$\",\"$L1f\",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\":\"npm_package_version\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#D73A49\",\"--shiki-dark\":\"#F97583\"},\"children\":\"=\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\"9.9.9\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#24292E\",\"--shiki-dark\":\"#E1E4E8\"},\"children\":\" SANDBOX_IMAGE_REGISTRY\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#D73A49\",\"--shiki-dark\":\"#F97583\"},\"children\":\"=\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\"\\\"registry\\\"\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#24292E\",\"--shiki-dark\":\"#E1E4E8\"},\"children\":\" SANDBOX_IMAGE_NAME\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#D73A49\",\"--shiki-dark\":\"#F97583\"},\"children\":\"=\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\"\\\"thename\\\"\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#6F42C1\",\"--shiki-dark\":\"#B392F0\"},\"children\":\" npm\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\" run\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\" publish:npm\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#005CC5\",\"--shiki-dark\":\"#79B8FF\"},\"children\":\" --dry-run\"}]]}]}]]}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"该命令将执行以下操作:\"}],\"\\n\",[\"$\",\"ol\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]:my-[.75em] x:not-first:mt-[1.25em] x:list-decimal x:ms-6\",\"children\":[\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"构建所有包。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"运行所有 prepublish 脚本。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"创建将要发布到 npm 的 tarball 包。\"}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"打印将要发布的包的摘要信息。\"}],\"\\n\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"然后你可以检查生成的 tarball,确保它们包含正确的文件,并且 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}],\" 文件已正确更新。tarball 将会在每个包的根目录下生成(例如:\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/qwen-code-0.1.6.tgz\"}],\")。\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"通过执行 dry run,你可以确认对打包流程的修改是正确的,并且包能够成功发布。\"}],\"\\n\",[\"$\",\"h2\",null,{\"id\":\"release-deep-dive\",\"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\":[\"Release Deep Dive\",[\"$\",\"$L1e\",null,{\"id\":\"release-deep-dive\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"发布流程的主要目标是从 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/\"}],\" 目录中获取源代码,进行构建,并在项目根目录下的临时 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 文件夹中组装一个干净、自包含的包。这个 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 目录就是最终发布到 NPM 的内容。\"]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"以下是关键阶段:\"}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"阶段-1发布前检查与版本更新\",\"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\":[\"阶段 1:发布前检查与版本更新\",[\"$\",\"$L1e\",null,{\"id\":\"阶段-1发布前检查与版本更新\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":在移动任何文件之前,流程会确保项目处于良好状态。这包括运行测试、linting 和类型检查(\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm run preflight\"}],\")。同时,根目录下的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/package.json\"}],\" 中的版本号会被更新为新的发布版本。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":这确保了只有高质量、可运行的代码才会被发布。版本更新是新发布的第一个标志。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"阶段-2构建源代码\",\"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\":[\"阶段 2:构建源代码\",[\"$\",\"$L1e\",null,{\"id\":\"阶段-2构建源代码\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":将 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/core/src\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/src\"}],\" 中的 TypeScript 源代码编译为 JavaScript。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"文件移动\"}],\":\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"packages/core/src/**/*.ts\"}],\" -\u003e 编译为 -\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/core/dist/\"}]]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/src/**/*.ts\"}],\" -\u003e 编译为 -\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/dist/\"}]]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":开发过程中编写的 TypeScript 需要转换为 Node.js 可执行的纯 JavaScript。core 包会先构建,因为 cli 包依赖它。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"阶段-3组装最终可发布的包\",\"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\":[\"阶段 3:组装最终可发布的包\",[\"$\",\"$L1e\",null,{\"id\":\"阶段-3组装最终可发布的包\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"这是最关键的一个阶段,文件会被移动并转换为最终用于发布的状态。项目根目录会创建一个临时的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 文件夹,用于存放最终的包内容。\"]}],\"\\n\",[\"$\",\"h4\",null,{\"id\":\"1-转换-packagejson\",\"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-xl\",\"children\":[[\"1. 转换 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}]],[\"$\",\"$L1e\",null,{\"id\":\"1-转换-packagejson\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":读取 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/package.json\"}],\",进行修改后写入项目根目录的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/\"}],\" 文件夹中。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"文件移动\"}],\":\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/package.json\"}],\" -\u003e(内存中转换)-\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/package.json\"}]]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":最终的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}],\" 必须与开发时使用的不同。关键变化包括:\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"devDependencies\"}],\"。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"移除 workspace 特定的依赖项:\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"{ \\\"@qwen-code/core\\\": \\\"workspace:*\\\" }\"}],\",并确保 core 代码被直接打包进最终的 JavaScript 文件中。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[\"确保 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bin\"}],\"、\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"main\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"files\"}],\" 字段指向最终包结构中的正确位置。\"]}],\"\\n\"]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h4\",null,{\"id\":\"2-创建-javascript-bundle\",\"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-xl\",\"children\":[\"2. 创建 JavaScript Bundle\",[\"$\",\"$L1e\",null,{\"id\":\"2-创建-javascript-bundle\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":将 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/core/dist\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/dist\"}],\" 中构建好的 JavaScript 代码打包成一个单独的可执行 JavaScript 文件。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"文件移动\"}],\":\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/dist/index.js\"}],\" + \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/core/dist/index.js\"}],\" -\u003e(由 esbuild 打包)-\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/gemini.js\"}],\"(或类似名称)。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":这样可以创建一个包含所有必要应用代码的单一优化文件。它简化了包结构,不再需要将 core 包作为单独的 NPM 依赖项,因为其代码已直接包含在内。\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h4\",null,{\"id\":\"3-复制静态和支持文件\",\"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-xl\",\"children\":[\"3. 复制静态和支持文件\",[\"$\",\"$L1e\",null,{\"id\":\"3-复制静态和支持文件\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":将不属于源代码但对包的正常运行或描述必要的文件复制到 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 目录中。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"文件移动\"}],\":\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"README.md\"}],\" -\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/README.md\"}]]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"LICENSE\"}],\" -\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/LICENSE\"}]]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages/cli/src/utils/*.sb\"}],\"(沙箱配置文件)-\u003e \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle/\"}]]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"README.md\"}],\" 和 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"LICENSE\"}],\" 是任何 NPM 包都应包含的标准文件。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":\"沙箱配置文件(.sb 文件)是 CLI 沙箱功能运行所必需的关键运行时资源,必须与最终可执行文件位于同一目录下。\"}],\"\\n\"]}],\"\\n\"]}],\"\\n\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"阶段-4发布到-npm\",\"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\":[\"阶段 4:发布到 NPM\",[\"$\",\"$L1e\",null,{\"id\":\"阶段-4发布到-npm\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"发生了什么\"}],\":在项目根目录的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 文件夹中运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm publish\"}],\" 命令。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"为什么这么做\"}],\":通过在 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"bundle\"}],\" 目录中运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm publish\"}],\",只有我们在阶段 3 中精心组装的文件会被上传到 NPM registry。这可以防止源代码、测试文件或开发配置被意外发布,从而为用户提供一个干净、最小化的包。\"]}],\"\\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\":[\"文件流转概览\",[\"$\",\"$L1e\",null,{\"id\":\"文件流转概览\"}]]}],\"\\n\",[\"$\",\"$L20\",null,{\"chart\":\"graph TD\\\\n subgraph \\\"Source Files\\\"\\\\n A[\\\"packages/core/src/*.ts\u003cbr/\u003epackages/cli/src/*.ts\\\"]\\\\n B[\\\"packages/cli/package.json\\\"]\\\\n C[\\\"README.md\u003cbr/\u003eLICENSE\u003cbr/\u003epackages/cli/src/utils/*.sb\\\"]\\\\n end\\\\n\\\\n subgraph \\\"Process\\\"\\\\n D(Build)\\\\n E(Transform)\\\\n F(Assemble)\\\\n G(Publish)\\\\n end\\\\n\\\\n subgraph \\\"Artifacts\\\"\\\\n H[\\\"Bundled JS\\\"]\\\\n I[\\\"Final package.json\\\"]\\\\n J[\\\"bundle/\\\"]\\\\n end\\\\n\\\\n subgraph \\\"Destination\\\"\\\\n K[\\\"NPM Registry\\\"]\\\\n end\\\\n\\\\n A --\u003e D --\u003e H\\\\n B --\u003e E --\u003e I\\\\n C --\u003e F\\\\n H --\u003e F\\\\n I --\u003e F\\\\n F --\u003e J\\\\n J --\u003e G --\u003e K\"}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":\"这个流程确保了最终发布的产物是一个专为发布而构建的、干净且高效的项目表示,而不是开发工作区的直接拷贝。\"}],\"\\n\",[\"$\",\"h2\",null,{\"id\":\"npm-workspaces\",\"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\":[\"NPM Workspaces\",[\"$\",\"$L1e\",null,{\"id\":\"npm-workspaces\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"本项目使用 \",[\"$\",\"a\",null,{\"href\":\"https://docs.npmjs.com/cli/v10/using-npm/workspaces\",\"target\":\"_blank\",\"rel\":\"noreferrer\",\"className\":\"x:focus-visible:nextra-focus x:text-primary-600 x:underline x:hover:no-underline x:decoration-from-font x:[text-underline-position:from-font]\",\"children\":[\"NPM Workspaces\",[\" \",[\"$\",\"svg\",null,{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"strokeWidth\":1.7,\"viewBox\":\"0 0 24 24\",\"height\":\"1em\",\"className\":\"x:inline x:align-baseline x:shrink-0\",\"children\":[[\"$\",\"path\",null,{\"d\":\"M7 17L17 7\"}],[\"$\",\"path\",null,{\"d\":\"M7 7h10v10\"}]]}]]]}],\" 来管理 monorepo 中的各个 packages。这简化了开发流程,使我们能够从项目根目录统一管理依赖和运行多个 packages 中的 scripts。\"]}],\"\\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\":[\"工作原理\",[\"$\",\"$L1e\",null,{\"id\":\"工作原理\"}]]}],\"\\n\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"根目录下的 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"package.json\"}],\" 文件定义了本项目的工作区:\"]}],\"\\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\":[[\"$\",\"$L1f\",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\":\" \\\"workspaces\\\"\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#24292E\",\"--shiki-dark\":\"#E1E4E8\"},\"children\":\": [\"}],[\"$\",\"span\",null,{\"style\":{\"--shiki-light\":\"#032F62\",\"--shiki-dark\":\"#9ECBFF\"},\"children\":\"\\\"packages/*\\\"\"}],[\"$\",\"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\",[\"$\",\"p\",null,{\"className\":\"x:not-first:mt-[1.25em] x:leading-7\",\"children\":[\"这告诉 NPM,\",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"packages\"}],\" 目录下的任何文件夹都是一个独立的 package,应该作为 workspace 的一部分进行管理。\"]}],\"\\n\",[\"$\",\"h3\",null,{\"id\":\"workspaces-的优势\",\"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\":[\"Workspaces 的优势\",[\"$\",\"$L1e\",null,{\"id\":\"workspaces-的优势\"}]]}],\"\\n\",[\"$\",\"ul\",null,{\"className\":\"x:[:is(ol,ul)_\u0026]: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\":\"简化的依赖管理\"}],\":从项目根目录运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm install\"}],\" 将会为 workspace 中的所有包安装依赖并相互链接。这意味着你不需要在每个包的目录中分别运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm install\"}],\"。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"自动链接\"}],\":workspace 内的包可以相互依赖。当你运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm install\"}],\" 时,NPM 会自动在包之间创建符号链接(symlinks)。这意味着当你修改某个包时,依赖它的其他包可以立即使用到这些更改。\"]}],\"\\n\",[\"$\",\"li\",null,{\"className\":\"x:my-[.5em]\",\"children\":[[\"$\",\"strong\",null,{\"children\":\"简化的脚本执行\"}],\":你可以使用 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"--workspace\"}],\" 参数从项目根目录运行任意包中的脚本。例如,要在 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"cli\"}],\" 包中运行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"build\"}],\" 脚本,可以执行 \",[\"$\",\"code\",null,{\"className\":\"nextra-code\",\"dir\":\"ltr\",\"children\":\"npm run build --workspace @qwen-code/qwen-code\"}],\"。\"]}],\"\\n\"]}]]}]]}]]}]}]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Package Overview | \"}],[\"$\",\"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\":\"Package Overview | \"}],[\"$\",\"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\":\"Package Overview | \"}],[\"$\",\"meta\",\"14\",{\"name\":\"twitter:description\",\"content\":\"x\"}],[\"$\",\"meta\",\"15\",{\"name\":\"twitter:image\",\"content\":\"https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg\"}]]\n4:null\n"])</script></body></html>