
GitHub Copilot CLI
CLIGitHub 官方终端编码 Agent,与 Copilot 编码代理共用同一套 harness,默认内置 GitHub MCP,可用自然语言处理仓库、Issue 与 PR,每步操作执行前需确认。需要 Copilot 订阅。
GitHub Copilot CLI
The power of GitHub Copilot, now in your terminal.
GitHub Copilot CLI brings AI-powered coding assistance directly to your command line, enabling you to build, debug, and understand code through natural language conversations. Powered by the same agentic harness as GitHub's Copilot coding agent, it provides intelligent assistance while staying deeply integrated with your GitHub workflow.
See our official documentation for more information.
🚀 Introduction and Overview
We're bringing the power of GitHub Copilot coding agent directly to your terminal. With GitHub Copilot CLI, you can work locally and synchronously with an AI agent that understands your code and GitHub context.
- Terminal-native development: Work with Copilot coding agent directly in your command line — no context switching required.
- GitHub integration out of the box: Access your repositories, issues, and pull requests using natural language, all authenticated with your existing GitHub account.
- Agentic capabilities: Build, edit, debug, and refactor code with an AI collaborator that can plan and execute complex tasks.
- MCP-powered extensibility: Take advantage of the fact that the coding agent ships with GitHub's MCP server by default and supports custom MCP servers to extend capabilities.
- Full control: Preview every action before execution — nothing happens without your explicit approval.
We're still early in our journey, but with your feedback, we're rapidly iterating to make the GitHub Copilot CLI the best possible companion in your terminal.
📦 Getting Started
Supported Platforms
- Linux
- macOS
- Windows
Prerequisites
- (On Windows) PowerShell v6 or higher
- An active Copilot subscription. See Copilot plans.
If you have access to GitHub Copilot via your organization or enterprise, you cannot use GitHub Copilot CLI if your organization owner or enterprise administrator has disabled it in the organization or enterprise settings. See Managing policies and features for GitHub Copilot in your organization for more information.
Installation
Install with the install script (macOS and Linux):
curl -fsSL https://gh.io/copilot-install | bash
Or
wget -qO- https://gh.io/copilot-install | bash
Use | sudo bash to run as root and install to /usr/local/bin.
Set PREFIX to install to $PREFIX/bin/ directory. Defaults to /usr/local
when run as root or $HOME/.local when run as a non-root user.
Set VERSION to install a specific version. Defaults to the latest version.
For example, to install version v0.0.369 to a custom directory:
curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash
Install with Homebrew (macOS and Linux):
brew install copilot-cli
brew install copilot-cli@prerelease
Install with WinGet (Windows):
winget install GitHub.Copilot
winget install GitHub.Copilot.Prerelease
Install with npm (macOS, Linux, and Windows):
npm install -g @github/copilot
npm install -g @github/copilot@prerelease
Launching the CLI
copilot
On first launch, you'll be greeted with our adorable animated banner! If you'd like to see this banner again, launch copilot with the --banner flag.
If you're not currently logged in to GitHub, you'll be prompted to use the /login slash command. Enter this command and follow the on-screen instructions to authenticate.
Authenticate with a Personal Access Token (PAT)
You can also authenticate using a fine-grained PAT with the "Copilot Requests" permission enabled.
- Visit https://github.com/settings/personal-access-tokens/new
- Under "Permissions," click "add permissions" and select "Copilot Requests"
- Generate your token
- Add the token to your environment via the environment variable
GH_TOKENorGITHUB_TOKEN(in order of precedence)
Using the CLI
Launch copilot in a folder that contains code you want to work with.
By default, copilot utilizes Claude Sonnet 4.5. Run the /model slash command to choose from other available models, including Claude Sonnet 4 and GPT-5.
Experimental Mode
Experimental mode enables access to new features that are still in development. You can activate experimental mode by:
- Launching with the
--experimentalflag:copilot --experimental - Using the
/experimentalslash command from within the CLI
Once activated, the setting is persisted in your config, so the --experimental flag is no longer needed on subsequent launches.
Experimental Features
- Autopilot mode: Autopilot is a new mode (press
Shift+Tabto cycle through modes), which encourages the agent to continue working until a task is completed.
Each time you submit a prompt to GitHub Copilot CLI, your monthly quota of premium requests is reduced by one. For information about premium requests, see About premium requests.
For more information about how to use the GitHub Copilot CLI, see our official documentation.
🔧 Configuring LSP Servers
GitHub Copilot CLI supports Language Server Protocol (LSP) for enhanced code intelligence. This feature provides intelligent code features like go-to-definition, hover information, and diagnostics.
Installing Language Servers
Copilot CLI does not bundle LSP servers. You need to install them separately. For example, to set up TypeScript support:
npm install -g typescript-language-server
For other languages, install the corresponding LSP server and configure it following the same pattern shown below.
Configuring LSP Servers
LSP servers are configured through a dedicated LSP configuration file. You can configure LSP servers at the user level or repository level:
User-level configuration (applies to all projects):
Edit ~/.copilot/lsp-config.json
Repository-level configuration (applies to specific project):
Create .github/lsp.json in your repository root
Example configuration:
{
"lspServers": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"],
"fileExtensions": {
".ts": "typescript",
".tsx": "typescript"
}
}
}
}
Viewing LSP Server Status
Check configured LSP servers using the /lsp command in an interactive session, or view your configuration files directly.
For more information, see the changelog.
📢 Feedback and Participation
We're excited to have you join us early in the Copilot CLI journey.
We're building quickly. Expect frequent updates--please keep your client up to date for the latest features and fixes!
Your insights are invaluable! Open an issue in this repo, join Discussions, and run /feedback from the CLI to submit a confidential feedback survey!
相關資源

GitHub CLI
CLIGitHub 官方命令行:在终端里管理 PR、Issue、Release 与 Actions 工作流,多数命令支持 --json 输出便于 agent 解析,并提供官方 agent skill。需先 gh auth login 登录。
cli/cli46.7k
GitHub
Plugin接入 GitHub 官方远程 MCP 服务器,在 Claude Code 里管理 Issue 与 PR、评审代码、搜索仓库并调用 GitHub API;需要配置 GITHUB_PERSONAL_ACCESS_TOKEN。
anthropics/claude-plugins-official40.3k
GitHub MCP Server
MCPGitHub 官方 MCP 服务器:让 agent 读写仓库与代码,管理 Issue 和 PR,查看 Actions 工作流与代码扫描告警。可接托管远程服务或用 Docker 本地运行,需个人访问令牌或 OAuth 授权。
github/github-mcp-server33.7k
Aider
CLI终端里的 AI 结对编程工具:为整个代码库建立仓库地图,改动自动提交 git,可接入 Claude、DeepSeek、OpenAI 等几乎所有模型及本地模型,改完可自动跑 lint 与测试。
Aider-AI/aider49.6k
Claude Code
CLIAnthropic 官方终端编码 Agent:读懂代码库、修改代码、执行命令、处理 git 流程,支持插件、MCP 与无头模式(claude -p)。需要登录 Claude 账号或配置 API Key。
anthropics/claude-code151k
Commit Commands
PluginGit 提交命令集:/commit 按仓库风格生成提交信息,/commit-push-pr 一步完成建分支、提交、推送与创建 PR(需要 gh CLI),/clean_gone 清理远端已删除的本地分支。Anthropic 官方插件。
anthropics/claude-code151k