clowlove/hermes-house/copilot-cli
Claude Code and agent skill by clowlove/hermes-house
- community
Checking that the SKILL.md file is still in the repository.
GitHub Copilot CLI — 安装、认证、三种模式、工具权限、上下文管理、GitHub 集成、Custom Agents、MCP、Hooks
Install
npx vskill@latest install clowlove/hermes-house/copilot-cliSKILL.md
The same SKILL.md was published earlier as clowlove/hermes-house/copilot-cli.
GitHub Copilot CLI v1.0.40+
安装
推荐(Linux/macOS):
Homebrew:
pip(任意平台):
验证:
⚠️ 注意:gh copilot扩展已于 2025 年 9 月废弃,所有功能已迁移到独立的copilotCLI。
认证
关键:需要 Fine-Grained PAT(`ghp_` 开头的不行)
Fine-Grained PAT 创建:https://github.com/settings/tokens 需要勾选 Copilot scope。
三种认证方式:
三种运行模式
用 Shift+Tab 循环切换模式。
交互模式(默认)
- 每条指令需要确认后才执行
- 按需提问澄清
- 文件修改和命令执行前会弹出权限确认
Plan 模式(推荐复杂任务)
- 不直接写代码,先生成结构化实施计划
- 可在执行前修改、调整单个步骤
- 适合多步骤重构、复杂功能设计
自动驾驶模式(Autopilot)
- 自动执行,不需要手动确认
- 适合已充分理解的任务
工具权限控制
权限标志说明
| 标志 | 说明 | |
|---|---|---|
--allow-tool 'shell(COMMAND)' | 允许特定 shell 命令(可重复使用) | |
--allow-tool 'write' | 允许所有文件修改 | |
--allow-tool 'shell' | 允许所有 shell 命令 | |
--allow-all-tools / --yolo | 全部允许(谨慎使用) | |
--deny-tool 'shell(rm)' | 拒绝特定命令(优先级最高) | |
--allow-tool 'postgres' | 允许 MCP server 的工具 |
权限示例
交互模式内权限
模型选择
/model 命令
交互模式内输入:
可选 Auto(自动选最优模型)或指定模型。
常见模型(2026年2月):
| 模型 | 倍率 | 备注 | |
|---|---|---|---|
| Claude Sonnet 4.6 | 1× | 默认,代码能力强 | |
| Claude Opus 4.6 | varies | 复杂规划任务 | |
| GPT-5.3-Codex | varies | Agentic 任务更快 | |
| Auto | — | 自动选择最优模型 |
启动时指定
Auto 模式比手动选择便宜 10%(Pro+ 及以上)。Auto 不会选有 premium multiplier > 1× 的模型。
上下文管理
/context — 查看 token 使用
显示:系统提示词 / 对话历史 / 剩余可用 token。
/compact — 压缩上下文
压缩对话历史,保留关键信息。需要时按 Escape 取消。
自动压缩在会话达到 95% token 限制时自动触发,可实现几乎无限的会话长度。
GitHub.com 集成(内置 MCP)
Copilot CLI 内置 GitHub MCP server,无需额外配置即可使用:
常用指令
在 Issue 上工作
Copilot 会:读取 Issue → 创建分支 → 实现 → 运行测试 → 汇报。
创建 PR
远程 Agent Task(gh agent-task)
在云端 Codespace 运行,不占用本地资源,适合长任务。
Agent Task 需要 Copilot Pro 或更高版本。
Custom Agents(自定义代理)
创建 Agent
在项目 .github/agents/ 目录下创建:
使用 Agent
Agent 名称前加 @ 调用。
Custom Instructions(自定义指令)
在 .github/ 目录创建 copilot-instructions.md:
作用域指令
在 .github/instructions/ 下按目录应用:
MCP Servers(扩展工具)
配置文件
用户级(所有项目):~/.copilot/mcp-config.json 项目级:.github/mcp.json
示例:PostgreSQL MCP
使用 MCP 工具
交互模式内查看已配置的 MCP servers:
然后用自然语言调用:
预批准 MCP 工具
Copilot Memory(跨会话记忆)
Copilot 会记住项目规范、偏好设置,下次启动无需重复说明。
Hooks(写文件后自动执行)
创建 Hook
.github/hooks/post-write.sh:
注册 Hook
.github/hooks/config.json:
Community Extensions(Awesome Copilot)
然后在交互模式内:
实际工作流模板
完整 Python 功能开发流程
表格式总结
| 阶段 | 模式 | 工具 | 动作 | |
|---|---|---|---|---|
| 探索 | 默认 | Copilot CLI | 自然语言映射文件 | |
| 设计 | Plan | Copilot CLI | 构建实施计划 | |
| 构建 | 默认/Plan | Copilot CLI | 实现 + pytest + 自我修正 | |
| 上下文 | — | /context + /compact | 管理 token 使用 | |
| 交付 | — | GitHub MCP | 提交 + PR | |
| 完善 | — | gh agent-task | 异步文档生成 |
参考资源
- 官方文档:https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli
- 安装指南:https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli
- Copilot CLI 参考:https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli
- 官方课程(微软):https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming
- Awesome Copilot:https://github.com/github/awesome-copilot
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/copilot-cli/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 4
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/clowlove/hermes-house/copilot-cli)