Linux command
github-copilot-cli 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Launch the interactive Copilot agent
gh copilot
Run a one-off prompt
gh copilot -p "[how do I rebase onto main?]"
Pick a specific model
gh copilot --model [claude-sonnet-4.5]
Remove the bundled Copilot binary
gh copilot --remove
说明
gh copilot (previously an extension with suggest and explain subcommands) is now a thin launcher that downloads and runs the standalone copilot binary — GitHub's agentic coding assistant. The older suggest/explain/config/alias subcommands are deprecated; invoke copilot for an interactive agent session or pass -p for scripted use. The tool supports various shells and command-line tools, providing interactive suggestions that can be copied or executed directly.
参数
- -p, --prompt _TEXT_
- Run a one-off prompt and print the response.
- --model _MODEL_
- Select the LLM model used by Copilot.
- --allow-tool _TOOL_, --deny-tool _TOOL_, --allow-all-tools
- Per-tool execution policy for the agent's built-in tools.
- --banner
- Force the startup banner (useful inside scripts).
- --experimental
- Opt in to experimental features.
- --remove
- Uninstall the bundled standalone copilot binary managed by gh.
FAQ
What is the github-copilot-cli command used for?
gh copilot (previously an extension with suggest and explain subcommands) is now a thin launcher that downloads and runs the standalone copilot binary — GitHub's agentic coding assistant. The older suggest/explain/config/alias subcommands are deprecated; invoke copilot for an interactive agent session or pass -p for scripted use. The tool supports various shells and command-line tools, providing interactive suggestions that can be copied or executed directly.
How do I run a basic github-copilot-cli example?
Run `gh copilot` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --prompt _TEXT_ do in github-copilot-cli?
Run a one-off prompt and print the response.