If you already pay for GitHub Copilot in your editor, the GitHub Copilot CLI brings the same AI pair programmer into the place Linux users actually live: the terminal. Instead of suggesting a line here and there, GitHub Copilot CLI works as an agent. It explores your repository, plans a change, edits files, runs commands, and shows you everything before it touches your code. This guide installs it on Linux, walks through your first session, and covers the commands and habits that make it genuinely useful for day-to-day development and sysadmin work.
What Is GitHub Copilot CLI?
The GitHub Copilot CLI is GitHub’s terminal-native coding assistant. You launch it inside a project directory and describe what you want in plain English: “explain how authentication works in this repo”, “add input validation to this form”, or “find why this build fails”. The agent reads relevant files, reasons about the codebase, and proposes changes as diffs you can review, accept, or reject. Nothing is modified without your explicit approval.
Because it runs in your shell, it fits naturally into Linux workflows: it can run your test suite, inspect command output, and iterate on failures. It also understands GitHub itself, so it can help with issues, pull requests, and repository context in a way a generic chatbot cannot. The CLI is available with all Copilot plans, although if your plan comes from an organization, an administrator must enable the Copilot CLI policy first.
If you have used terminal helpers before, you may enjoy our guide to Shell-GPT (sgpt) for generating Linux commands with AI. Copilot CLI goes a step further: instead of one-shot command suggestions, it holds a conversation, keeps project context, and executes multi-step tasks under your supervision.

Install GitHub Copilot CLI on Linux
The recommended installation method uses npm and requires Node.js 22 or later. Check your version first, then install the package globally:
node --version
npm install -g @github/copilot
Prefer Homebrew? On macOS and Linux you can use the cask instead:
brew install --cask copilot-cli
GitHub also publishes an install script that drops the binary into $HOME/.local for a regular user or /usr/local/bin when run with sudo:
curl -fsSL https://gh.io/copilot-install | bash
Verify the installation, then move into a project directory:
copilot --version
cd ~/projects/my-app
Sign In and Run Your First Session
Start an interactive session by typing copilot. On first launch, the CLI asks you to confirm that you trust the files in the current directory. This matters: during a session the agent can read, modify, and execute files in that folder, so only confirm directories you trust.
copilot
If you are not signed in, type /login inside the session and follow the prompts. Desktop users get a browser flow; on a headless server you will typically get a device-code flow, where you enter a short code on another device. You only need to do this once. Token environment variables such as GH_TOKEN take precedence over the stored login, which is handy for automation but worth remembering when the CLI suddenly acts as a different account.
Now try a read-only question first, for example “Give me an overview of this project”. Watch how the agent explores the tree before answering. Then move to a small, reviewable change such as adding a missing test or a README section. Small tasks build trust and teach you how the agent behaves on your codebase.
GitHub Copilot CLI Commands and Features You Will Use Daily
Inside a session, two keystrokes unlock most of the power. Typing / lists the slash commands for managing the session, switching models, reviewing changes, and more. Typing @ lets you mention specific files so the agent focuses its context exactly where you want. A few habits make a big difference:
- Use @ mentions for precision. Instead of “fix the login bug”, try “fix the login bug in @src/auth/session.ts”.
- Ask for a plan on big work. Prompts like “plan first, then implement” keep large refactors reviewable.
- Review every diff. The approval step is a feature, not friction. Skim each change the way you would a colleague’s pull request.
- Let it run the tests. Copilot can execute your test command, read the failures, and fix its own mistakes in a loop.
- Switch models when needed. Different Copilot models suit different tasks; the CLI lets you change models from within the session.
The CLI can also be extended with MCP (Model Context Protocol) servers, the same open protocol covered in our guide to setting up an MCP server for your infrastructure, which lets the agent reach tools and data beyond the local filesystem.
Tips for Safe and Effective Terminal Pair Programming
First, treat the agent like a fast junior engineer: brilliant at boilerplate, migrations, and tests, but still worth supervising on security-sensitive code. Second, work on a clean git tree or a throwaway branch so you can diff and roll back with your normal tools. Third, write project instructions down. Copilot reads repository context files, so documenting your build, test, and style conventions in the repo pays off in every session. Finally, keep secrets out of the prompt and the repo; an agent that can read every file will happily read a committed .env.
For teams, remember the policy angle: organization owners control whether the CLI is enabled, and a fine-grained personal access token with the Copilot Requests permission is the supported route for scripted automation.
Conclusion
The GitHub Copilot CLI turns a subscription many developers already have into a full terminal agent: install it with npm or Homebrew, sign in once with /login, and you can explain, edit, and debug code without leaving your shell. Start with read-only questions, graduate to small reviewed edits, and keep git as your safety net. For the complete command reference and the latest changes, read the official GitHub Copilot CLI getting started guide.