Other coding agents

How to Use GitHub Copilot CLI in Your Terminal

3 min read

GitHub Copilot CLI brings Copilot’s coding agent into your terminal. It needs an active Copilot subscription.

1. Install it

npm install -g @github/copilot

That needs Node.js 22 or later. WinGet, Homebrew, and a standalone install script are also supported. On Windows you need PowerShell v6+.

2. Start it and log in

copilot

If you aren’t logged in to GitHub, Copilot prompts you to run:

/login

Follow the on-screen instructions. For unattended use, it also reads a fine-grained personal access token with the Copilot Requests permission from an environment variable — COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN, in that order of precedence.

3. Ask it something

Start it in the project you want it to work on, then type a plain request:

Explain what the retry logic in fetch_orders() does and why it can loop forever.
Write a make target that runs the test suite with coverage and fails under 80%.

It’s an agent, not an autocomplete: it reads files, proposes commands, and asks before running them. Read each proposed command before approving it.

4. Permissions, directories, and sessions

The commands worth knowing on day one:

There is a --allow-all (alias --yolo) flag that enables all permissions. Use it only in a throwaway container or a sandboxed checkout — it removes the approval step that keeps a bad command from running against your real working tree.


Next: Codex CLI first steps or connect Claude Code to GitHub.

Open the full interactive version (with copy buttons) ↗

← All guides