256 words
1 minutes
GitHub Copilot CLI Installation Guide for Mac

Prerequisites#

  • Active GitHub Copilot subscription (Individual / Business / Enterprise)
  • macOS (zsh)
  • Node.js 22+ / npm 10+
  • Network access to github.com


Node.js Setup#

Skipped in this guide. If not installed yet, please check the Node.js installation guide.


Installation#

Run this in your terminal:

npm install -g @github/copilot
copilot --version

Authentication#

Login via copilot

copilot
# When prompted:
/copilot> /login

Follow the browser authentication instructions.

If gh is installed, you may be automatically logged in via environment variables.

GitHub Copilot CLI login screen

Reusing gh token

export GH_TOKEN=$(gh auth token)
# or
export GITHUB_TOKEN=$(gh auth token)

Note: Personal PATs are no longer supported (as of October 2025) GitHub


Usage#

Try copilot in any repository:

/copilot> How's it going? Summarize in MD

Useful slash commands:

/copilot> /model          # Switch model
/copilot> /files add .    # Add files/folders to context
/copilot> /undo           # Undo last action

By default, it shows diffs and asks for approval before executing.


Update / Uninstall#

Managed via npm, so it’s simple:

# Update (same command)
npm install -g @github/copilot

# Uninstall
npm uninstall -g @github/copilot

Troubleshooting#

  • node -v below 22 / npm -v below 10 → Re-run nvm install 22 && nvm use 22.
  • copilot not found → Add npm prefix -g bin to PATH.
  • Can’t use with enterprise/school account → Copilot CLI may be disabled by organization policy. Contact your admin.
  • gh auth token doesn’t work → Check echo $GH_TOKEN / echo $GITHUB_TOKEN is set. Try restarting shell or source ~/.zshrc.

Premium Requests#

  • Copilot CLI uses “1 prompt = 1 Premium request” (regardless of /model selection).
  • Count resets monthly on 1st at 00:00:00 UTC. Limits vary by plan type.
  • Check usage in GitHub account settings (Usage/Entitlements screen).

Unlike VS Code which has free models, CLI doesn’t. Watch your LLM budget!

GitHub Copilot CLI Installation Guide for Mac
https://naonao-na.com/en/posts/github-copilot-cli-install-mac/
Author
[object Object]
Published at
2025-10-13