PageSourceSearch

https://api-docs.deepseek.com/zh-cn/assets/js/986eb0d7.1fb561b2.js

js deepseek.com collected 2026-10-01 07:28:44 UTC 8,177 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_deepseek_docs=self.webpackChunk_deepseek_docs||[]).push([[418],{29393:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>t,default:()=>h,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var o=i(80678),l=i(41759);const s={sidebar_label:"GitHub Copilot CLI"},t="\u63a5\u5165 GitHub Copilot CLI",c={id:"quick_start/agent_integrations/copilot_cli",title:"\u63a5\u5165 GitHub Copilot CLI",description:"\u901a\u8fc7 BYOK\uff08\u81ea\u5e26\u5bc6\u94a5\uff09\u6a21\u5f0f\u914d\u7f6e GitHub Copilot CLI \u4f7f\u7528 DeepSeek V4 \u6a21\u578b\uff0c\u57fa\u4e8e Anthropic \u517c\u5bb9\u7aef\u70b9\u63a5\u5165\u3002",source:"@site/i18n/zh-cn/docusaurus-plugin-content-docs/current/quick_start/agent_integrations/copilot_cli.md",sourceDirName:"quick_start/agent_integrations",slug:"/quick_start/agent_integrations/copilot_cli",permalink:"/zh-cn/quick_start/agent_integrations/copilot_cli",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"GitHub Copilot CLI"}},r={},d=[{value:"1. \u5b89\u88c5 GitHub Copilot CLI",id:"1-\u5b89\u88c5-github-copilot-cli",level:4},{value:"2. \u83b7\u53d6 DeepSeek API Key",id:"2-\u83b7\u53d6-deepseek-api-key",level:4},{value:"3. \u914d\u7f6e\u73af\u5883\u53d8\u91cf",id:"3-\u914d\u7f6e\u73af\u5883\u53d8\u91cf",level:4},{value:"4. \u542f\u52a8 Copilot CLI",id:"4-\u542f\u52a8-copilot-cli",level:4},{value:"\u53ef\u9009\uff1a\u914d\u7f6e Token \u9650\u5236",id:"\u53ef\u9009\u914d\u7f6e-token-\u9650\u5236",level:4},{value:"\u53ef\u9009\uff1a\u79bb\u7ebf\u6a21\u5f0f",id:"\u53ef\u9009\u79bb\u7ebf\u6a21\u5f0f",level:4},{value:"\u76f8\u5173\u8d44\u6e90",id:"\u76f8\u5173\u8d44\u6e90",level:4}];function p(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"\u63a5\u5165-github-copilot-cli",children:"\u63a5\u5165 GitHub Copilot CLI"}),"\n",(0,o.jsx)(n.p,{children:"\u901a\u8fc7 BYOK\uff08\u81ea\u5e26\u5bc6\u94a5\uff09\u6a21\u5f0f\u914d\u7f6e GitHub Copilot CLI \u4f7f\u7528 DeepSeek V4 \u6a21\u578b\uff0c\u57fa\u4e8e Anthropic \u517c\u5bb9\u7aef\u70b9\u63a5\u5165\u3002"}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"\u91cd\u8981\u63d0\u793a\uff1a"})," \u8bf7\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"anthropic"})," \u4f5c\u4e3a provider type\u3002\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"openai"})," \u7c7b\u578b\u4f1a\u89e6\u53d1 ",(0,o.jsx)(n.code,{children:"400"})," \u9519\u8bef\uff1a",(0,o.jsx)(n.code,{children:"The reasoning_content in the thinking mode must be passed back to the API."})," \u2014 DeepSeek \u8981\u6c42\u5c06\u6a21\u578b\u8f93\u51fa\u7684 ",(0,o.jsx)(n.code,{children:"reasoning_content"})," \u5728\u4e0b\u4e00\u6b21\u8bf7\u6c42\u4e2d\u539f\u6837\u56de\u4f20\uff0cCopilot CLI \u7684 OpenAI \u96c6\u6210\u4e0d\u652f\u6301\u6b64\u673a\u5236\u3002\u6539\u7528 Anthropic Messages API \u7aef\u70b9\u53ef\u4ee5\u5b8c\u5168\u907f\u514d\u6b64\u95ee\u9898\u3002"]}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"1-\u5b89\u88c5-github-copilot-cli",children:"1. \u5b89\u88c5 GitHub Copilot CLI"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-shell",children:"npm install -g @github/copilot\n"})}),"\n",(0,o.jsxs)(n.p,{children:["\u9700\u8981 Node.js 22 \u6216\u66f4\u9ad8\u7248\u672c\u3002\u8be6\u7ec6\u8bf4\u660e\u53c2\u8003",(0,o.jsx)(n.a,{href:"https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started",children:"\u5b98\u65b9\u5165\u95e8\u6307\u5357"}),"\u3002"]}),"\n",(0,o.jsx)(n.h4,{id:"2-\u83b7\u53d6-deepseek-api-key",children:"2. \u83b7\u53d6 DeepSeek API Key"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\u524d\u5f80 ",(0,o.jsx)(n.a,{href:"https://platform.deepseek.com/api_keys",children:"DeepSeek \u5f00\u653e\u5e73\u53f0"})," \u521b\u5efa API Key\u3002"]}),"\n",(0,o.jsxs)(n.li,{children:["\u590d\u5236 Key\uff08\u4ee5 ",(0,o.jsx)(n.code,{children:"sk-"})," \u5f00\u5934\uff09\u3002"]}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"3-\u914d\u7f6e\u73af\u5883\u53d8\u91cf",children:"3. \u914d\u7f6e\u73af\u5883\u53d8\u91cf"}),"\n",(0,o.jsx)(n.p,{children:"Linux / Mac\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-shell",children:"export COPILOT_PROVIDER_TYPE=anthropic\nexport COPILOT_PROVIDER_BASE_URL=https://api.deepseek.com/anthropic\nexport COPILOT_PROVIDER_API_KEY=sk-your-
1deepseek-api-key\nexport COPILOT_MODEL=deepseek-v4-pro\n"})}),"\n",(0,o.jsx)(n.p,{children:"Windows\uff08PowerShell\uff09\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-powershell",children:'$env:COPILOT_PROVIDER_TYPE="anthropic"\n$env:COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com/anthropic"\n$env:COPILOT_PROVIDER_API_KEY="sk-your-deepseek-api-key"\n$env:COPILOT_MODEL="deepseek-v4-pro"\n'})}),"\n",(0,o.jsxs)(n.p,{children:["\u53ef\u9009\u6a21\u578b\uff1a",(0,o.jsx)(n.code,{children:"deepseek-v4-pro"}),"\u3001",(0,o.jsx)(n.code,{children:"deepseek-v4-flash"}),"\uff0c\u4fee\u6539 ",(0,o.jsx)(n.code,{children:"COPILOT_MODEL"})," \u5373\u53ef\u5207\u6362\u3002"]}),"\n",(0,o.jsx)(n.h4,{id:"4-\u542f\u52a8-copilot-cli",children:"4. \u542f\u52a8 Copilot CLI"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-shell",children:"copilot\n"})}),"\n",(0,o.jsx)(n.p,{children:"\u5b8c\u6574\u652f\u6301 Agent \u6a21\u5f0f\u3001\u5de5\u5177\u8c03\u7528\u548c MCP \u2014 \u5168\u90e8\u7531 DeepSeek \u9a71\u52a8\u3002"}),"\n",(0,o.jsx)(n.h4,{id:"\u53ef\u9009\u914d\u7f6e-token-\u9650\u5236",children:"\u53ef\u9009\uff1a\u914d\u7f6e Token \u9650\u5236"}),"\n",(0,o.jsxs)(n.p,{children:["\u7531\u4e8e ",(0,o.jsx)(n.code,{children:"deepseek-v4-pro"})," \u4e0d\u5728 Copilot CLI \u7684\u5185\u7f6e\u6a21\u578b\u76ee\u5f55\u4e2d\uff0c\u5efa\u8bae\u663e\u5f0f\u914d\u7f6e token \u9650\u5236\uff1a"]}),"\n",(0,o.jsx)(n.p,{children:"Linux / Mac\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-shell",children:"export COPILOT_PROVIDER_MAX_PROMPT_TOKENS=840000\nexport COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=128000\n"})}),"\n",(0,o.jsx)(n.p,{children:"Windows\uff08PowerShell\uff09\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-powershell",children:'$env:COPILOT_PROVIDER_MAX_PROMPT_TOKENS="840000"\n$env:COPILOT_PROVIDER_MAX_OUTPUT_TOKENS="128000"\n'})}),"\n",(0,o.jsxs)(n.p,{children:["\u8fd0\u884c ",(0,o.jsx)(n.code,{children:"copilot help providers"})," \u53ef\u67e5\u770b\u6240\u6709\u53ef\u7528\u73af\u5883\u53d8\u91cf\u3002"]}),"\n",(0,o.jsx)(n.h4,{id:"\u53ef\u9009\u79bb\u7ebf\u6a21\u5f0f",children:"\u53ef\u9009\uff1a\u79bb\u7ebf\u6a21\u5f0f"}),"\n",(0,o.jsx)(n.p,{children:"Linux / Mac\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-shell",children:"export COPILOT_OFFLINE=true\n"})}),"\n",(0,o.jsx)(n.p,{children:"Windows\uff08PowerShell\uff09\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-powershell",children:'$env:COPILOT_OFFLINE="true"\n'})}),"\n",(0,o.jsxs)(n.p,{children:["\u6ce8\u610f\uff1a\u63d0\u793a\u8bcd\u4ecd\u4f1a\u53d1\u9001\u5230 ",(0,o.jsx)(n.code,{children:"api.deepseek.com"})," \u2014 \u79bb\u7ebf\u6a21\u5f0f\u4ec5\u963b\u6b62 GitHub \u7684 API \u8c03\u7528\u3002"]}),"\n",(0,o.jsx)(n.h4,{id:"\u76f8\u5173\u8d44\u6e90",children:"\u76f8\u5173\u8d44\u6e90"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models",children:"GitHub Copilot CLI BYOK \u6587\u6863"})}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},41759:(e,n,i)=>{i.d(n,{R:()=>t,x:()=>c});var o=i(26166);const l={},s=o.createContext(l);function t(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.