github-copilot-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub 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:
  1. Installing and updating GitHub Copilot CLI
  2. Authentication and configuration
  3. Core usage patterns and slash commands
  4. Extensibility (MCP servers, skills, custom agents)
  5. Troubleshooting common issues
本技能提供以下方面的专业指导:
  1. GitHub Copilot CLI的安装与更新
  2. 身份验证与配置
  3. 核心使用模式与斜杠命令
  4. 扩展性(MCP服务器、技能、自定义Agent)
  5. 常见问题的故障排查

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:
PlatformCommand
Windows (WinGet)
winget install GitHub.Copilot
macOS/Linux (Homebrew)
brew install copilot-cli
All (npm, Node.js 22+)
npm install -g @github/copilot
macOS/Linux (Script)
curl -fsSL https://gh.io/copilot-install | bash
Prerelease versions: Add
@prerelease
or use
GitHub.Copilot.Prerelease
始终获取最新版本 - 使用以下命令:
平台命令
Windows (WinGet)
winget install GitHub.Copilot
macOS/Linux (Homebrew)
brew install copilot-cli
全平台(npm,Node.js 22+)
npm install -g @github/copilot
macOS/Linux(脚本)
curl -fsSL https://gh.io/copilot-install | bash
预发布版本:添加
@prerelease
或使用
GitHub.Copilot.Prerelease

Authentication

身份验证

bash
copilot                    # Launch and follow /login prompt
bash
copilot                    # 启动并按照/login提示操作

OR use PAT with "Copilot Requests" permission:

或者使用具备"Copilot Requests"权限的PAT:

export GH_TOKEN=your_token
undefined
export GH_TOKEN=your_token
undefined

Essential Slash Commands

核心斜杠命令

CommandPurpose
/help
Show all commands and shortcuts
/model
Select AI model (Claude Sonnet 4.5, GPT-5, etc.)
/agent
Browse and select available agents
/skills
Manage skills
/mcp
Manage MCP server configuration
/delegate [prompt]
Hand off to Copilot coding agent (creates PR)
/compact
Reduce context window usage
/context
Show token usage visualization
命令用途
/help
显示所有命令和快捷方式
/model
选择AI模型(如Claude Sonnet 4.5、GPT-5等)
/agent
浏览并选择可用的Agent
/skills
管理技能
/mcp
管理MCP服务器配置
/delegate [prompt]
转交任务给Copilot编码Agent(创建PR)
/compact
减少上下文窗口的使用
/context
显示令牌使用情况可视化界面

Keyboard Shortcuts

键盘快捷方式

ShortcutAction
@
Mention files to include in context
!
Execute shell command directly
Esc
Cancel current operation
Ctrl+C
Cancel / clear / exit
Ctrl+L
Clear screen
Ctrl+O
Expand/collapse timeline
快捷键操作
@
提及要纳入上下文的文件
!
直接执行Shell命令
Esc
取消当前操作
Ctrl+C
取消/清除/退出
Ctrl+L
清屏
Ctrl+O
展开/折叠时间线

Extensibility Overview

扩展性概述

  1. MCP Servers - Extend Copilot with external tools
  2. Skills - Task-specific instructions and scripts
  3. Custom Agents - Specialized agent profiles
  4. Custom Instructions - Repository-wide guidance
  1. MCP服务器 - 使用外部工具扩展Copilot的功能
  2. 技能 - 特定任务的指令和脚本
  3. 自定义Agent - 专业化的Agent配置文件
  4. 自定义指令 - 仓库级别的指导说明

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 server
Config stored in:
~/.copilot/mcp-config.json
Copilot CLI默认包含GitHub MCP服务器。添加自定义MCP服务器:
bash
/mcp add             # 交互式配置
/mcp show            # 列出已配置的服务器
/mcp edit <name>     # 修改现有服务器
配置文件存储于:
~/.copilot/mcp-config.json

Skills

技能

Skills enhance Copilot's task performance with instructions and scripts.
Locations:
  • Project:
    .github/skills/
    or
    .claude/skills/
  • Personal:
    ~/.copilot/skills/
    or
    ~/.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:
  • .github/copilot-instructions.md
    - Repository-wide
  • .github/instructions/**/*.instructions.md
    - Path-specific
  • AGENTS.md
    - Agent behavior instructions
针对Copilot的仓库专属指导说明:
  • .github/copilot-instructions.md
    - 仓库全局指导
  • .github/instructions/**/*.instructions.md
    - 路径专属指导
  • AGENTS.md
    - Agent行为指导

Troubleshooting Quick Tips

故障排查快速提示

IssueSolution
Not installed
brew install copilot-cli
or
npm i -g @github/copilot
Not authenticatedRun
/login
in Copilot CLI
Policy disabledCheck org/enterprise Copilot settings
MCP server not loadingVerify
~/.copilot/mcp-config.json
syntax
Skill not activatingRestart 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.
问题解决方案
未安装执行
brew install copilot-cli
npm i -g @github/copilot
未通过身份验证在Copilot CLI中运行
/login
指令
策略已禁用检查组织/企业级Copilot设置
MCP服务器无法加载验证
~/.copilot/mcp-config.json
的语法正确性
技能未激活重启Copilot CLI,检查SKILL.md的YAML配置

版本:1.0.0 | 状态:公开预览 说明:GitHub Copilot CLI目前处于公开预览阶段,功能可能会有所变更。