Skip to content
FunCoding

Search

Search docs, Skills and MCP

CLI 终端命令

查找主要子命令,设置 Shell 补全,并了解资源列表的覆盖范围。

This page has not been translated into English yet. The original Chinese version is shown below.

不带子命令运行 copilot 打开交互界面。copilot help TOPIC 可查看 billing、config、commands、environment、logging、monitoring、permissions、providers 和 sandbox 等主题。

常用入口

命令作用
copilot login登录 GitHub,支持浏览器、设备码和 stdin 令牌
copilot init生成或更新项目 Copilot 指令
copilot config在终端读取和修改设置
copilot mcp管理 MCP 服务器
copilot skill管理 Skills
copilot plugin管理插件与市场,plugins 是兼容别名
copilot instruction list列出发现的自定义指令
copilot lsp list列出配置的语言服务器
copilot sandbox ca管理沙箱代理 CA
copilot workflow run NAME运行已注册的动态 workflow
copilot update下载并安装最新版本
copilot version显示版本并检查更新
copilot app从当前目录打开 app 新会话,无法处理时回退下载入口

普通任务的非交互入口是 copilot -p "PROMPT",详细权限与输出见程序化运行。

Shell 补全

支持 Bash、Zsh、Fish。补全覆盖子命令、选项、已知枚举值,以及 config 的设置键、布尔值和路径。

Bash 当前会话:

source <(copilot completion bash)

Zsh 写入 fpath 中的补全目录,之后重启 Shell:

copilot completion zsh > "${fpath[1]}/_copilot"

Fish:

copilot completion fish > ~/.config/fish/completions/copilot.fish

后两条会写文件,先确保目录存在并可写。不要把为一种 Shell 生成的脚本交给另一种执行。

非交互资源查询

copilot instruction list --json
copilot lsp list --json

instruction 的 JSON 包含 id、label、location、type、sourcePath、defaultDisabled 以及可选 description、applyTo。它只按全局用户设置解析插件贡献的指令;仓库或托管策略启用的指令可能在真实会话生效,却不出现在这份列表中。完整会话检查用 /instructions 和 /env。

lsp list 是只读检查,JSON 包含 id 及可选 fileExtensions、sourcePlugin;启动、停止和重载需会话内 /lsp。这些独立资源命令不覆盖自定义 agents 和会话级 Hooks,后者需要活动会话。

初始化项目

copilot init 或 /init 分析代码库,写入 .github/copilot-instructions.md,通常包括构建、测试、lint、架构与约定。已有文件时会提出可接受或拒绝的改进。

不需要生成文件时,/init suppress 可隐藏当前仓库的启动提醒。初始化也接受 --sandbox / --no-sandbox,仅影响本次初始化,仍受企业沙箱策略约束。