github-copilot-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Copilot CLI Expert
GitHub Copilot CLI Expert
Comprehensive knowledge of GitHub Copilot CLI installation, configuration, usage, and extensibility.
全面掌握GitHub Copilot CLI的安装、配置、使用及扩展性相关知识。
Purpose
用途
This skill provides expert guidance on:
- Installing and updating GitHub Copilot CLI
- Authentication and configuration
- Core usage patterns and slash commands
- Extensibility (MCP servers, skills, custom agents)
- Troubleshooting common issues
本技能提供以下方面的专业指导:
- GitHub Copilot CLI的安装与更新
- 身份验证与配置
- 核心使用模式与斜杠命令
- 扩展性(MCP服务器、技能、自定义Agent)
- 常见问题的故障排查
When I Activate
触发场景
Automatically when you mention:
- "copilot cli", "github copilot cli", "gh copilot"
- "install copilot", "update copilot"
- "copilot commands", "copilot slash commands"
- "copilot mcp", "add mcp server"
- "copilot skills", "create copilot skill"
- "copilot custom agent"
当你提及以下内容时,将自动激活本技能:
- "copilot cli", "github copilot cli", "gh copilot"
- "install copilot", "update copilot"
- "copilot commands", "copilot slash commands"
- "copilot mcp", "add mcp server"
- "copilot skills", "create copilot skill"
- "copilot custom agent"
Quick Reference
快速参考
Installation (All Platforms)
安装(全平台)
Always fetch latest version - use these commands:
| Platform | Command |
|---|---|
| Windows (WinGet) | |
| macOS/Linux (Homebrew) | |
| All (npm, Node.js 22+) | |
| macOS/Linux (Script) | |
Prerelease versions: Add or use
@prereleaseGitHub.Copilot.Prerelease始终获取最新版本 - 使用以下命令:
| 平台 | 命令 |
|---|---|
| Windows (WinGet) | |
| macOS/Linux (Homebrew) | |
| 全平台(npm,Node.js 22+) | |
| macOS/Linux(脚本) | |
预发布版本:添加或使用
@prereleaseGitHub.Copilot.PrereleaseAuthentication
身份验证
bash
copilot # Launch and follow /login promptbash
copilot # 启动并按照/login提示操作OR use PAT with "Copilot Requests" permission:
或者使用具备"Copilot Requests"权限的PAT:
export GH_TOKEN=your_token
undefinedexport GH_TOKEN=your_token
undefinedEssential Slash Commands
核心斜杠命令
| Command | Purpose |
|---|---|
| Show all commands and shortcuts |
| Select AI model (Claude Sonnet 4.5, GPT-5, etc.) |
| Browse and select available agents |
| Manage skills |
| Manage MCP server configuration |
| Hand off to Copilot coding agent (creates PR) |
| Reduce context window usage |
| Show token usage visualization |
| 命令 | 用途 |
|---|---|
| 显示所有命令和快捷方式 |
| 选择AI模型(如Claude Sonnet 4.5、GPT-5等) |
| 浏览并选择可用的Agent |
| 管理技能 |
| 管理MCP服务器配置 |
| 转交任务给Copilot编码Agent(创建PR) |
| 减少上下文窗口的使用 |
| 显示令牌使用情况可视化界面 |
Keyboard Shortcuts
键盘快捷方式
| Shortcut | Action |
|---|---|
| Mention files to include in context |
| Execute shell command directly |
| Cancel current operation |
| Cancel / clear / exit |
| Clear screen |
| Expand/collapse timeline |
| 快捷键 | 操作 |
|---|---|
| 提及要纳入上下文的文件 |
| 直接执行Shell命令 |
| 取消当前操作 |
| 取消/清除/退出 |
| 清屏 |
| 展开/折叠时间线 |
Extensibility Overview
扩展性概述
- MCP Servers - Extend Copilot with external tools
- Skills - Task-specific instructions and scripts
- Custom Agents - Specialized agent profiles
- Custom Instructions - Repository-wide guidance
- MCP服务器 - 使用外部工具扩展Copilot的功能
- 技能 - 特定任务的指令和脚本
- 自定义Agent - 专业化的Agent配置文件
- 自定义指令 - 仓库级别的指导说明
Navigation Guide
导航指南
When to Read Supporting Files
何时阅读支持文件
reference.md - Read when you need:
- Complete slash command reference with all options
- Detailed MCP server configuration and JSON schema
- Full permissions system documentation
- Advanced configuration options
- Environment variables reference
examples.md - Read when you need:
- Step-by-step installation walkthroughs
- Working MCP server configurations
- Skill creation examples
- Custom agent examples
- Real-world usage scenarios
reference.md - 当你需要以下内容时阅读:
- 包含所有选项的完整斜杠命令参考
- 详细的MCP服务器配置和JSON schema
- 完整的权限系统文档
- 高级配置选项
- 环境变量参考
examples.md - 当你需要以下内容时阅读:
- 分步安装指南
- 可用的MCP服务器配置示例
- 技能创建示例
- 自定义Agent示例
- 实际使用场景
Core Concepts
核心概念
MCP Servers (Model Context Protocol)
MCP服务器(Model Context Protocol)
Copilot CLI includes GitHub MCP server by default. Add custom MCP servers:
bash
/mcp add # Interactive configuration
/mcp show # List configured servers
/mcp edit <name> # Modify existing serverConfig stored in:
~/.copilot/mcp-config.jsonCopilot CLI默认包含GitHub MCP服务器。添加自定义MCP服务器:
bash
/mcp add # 交互式配置
/mcp show # 列出已配置的服务器
/mcp edit <name> # 修改现有服务器配置文件存储于:
~/.copilot/mcp-config.jsonSkills
技能
Skills enhance Copilot's task performance with instructions and scripts.
Locations:
- Project: or
.github/skills/.claude/skills/ - Personal: or
~/.copilot/skills/~/.claude/skills/
Structure:
.github/skills/my-skill/
└── SKILL.md # Instructions with YAML frontmatter技能通过指令和脚本提升Copilot的任务处理性能。
存储位置:
- 项目级:或
.github/skills/.claude/skills/ - 个人级:或
~/.copilot/skills/~/.claude/skills/
结构:
.github/skills/my-skill/
└── SKILL.md # 包含YAML前置元数据的指令文档Custom Agents
自定义Agent
Specialized agent profiles stored as Markdown files.
Locations:
- User:
~/.copilot/agents/ - Repository:
.github/agents/ - Organization:
.github-private/agents/
专业化的Agent配置文件以Markdown格式存储。
存储位置:
- 用户级:
~/.copilot/agents/ - 仓库级:
.github/agents/ - 组织级:
.github-private/agents/
Custom Instructions
自定义指令
Repository-specific guidance for Copilot:
- - Repository-wide
.github/copilot-instructions.md - - Path-specific
.github/instructions/**/*.instructions.md - - Agent behavior instructions
AGENTS.md
针对Copilot的仓库专属指导说明:
- - 仓库全局指导
.github/copilot-instructions.md - - 路径专属指导
.github/instructions/**/*.instructions.md - - Agent行为指导
AGENTS.md
Troubleshooting Quick Tips
故障排查快速提示
| Issue | Solution |
|---|---|
| Not installed | |
| Not authenticated | Run |
| Policy disabled | Check org/enterprise Copilot settings |
| MCP server not loading | Verify |
| Skill not activating | Restart Copilot CLI, check SKILL.md YAML |
Version: 1.0.0 | Status: Public Preview
Note: GitHub Copilot CLI is in public preview and subject to change.
| 问题 | 解决方案 |
|---|---|
| 未安装 | 执行 |
| 未通过身份验证 | 在Copilot CLI中运行 |
| 策略已禁用 | 检查组织/企业级Copilot设置 |
| MCP服务器无法加载 | 验证 |
| 技能未激活 | 重启Copilot CLI,检查SKILL.md的YAML配置 |
版本:1.0.0 | 状态:公开预览
说明:GitHub Copilot CLI目前处于公开预览阶段,功能可能会有所变更。