You installed GitHub Copilot CLI, the installer reported success, and your shell disagrees:
zsh: command not found: copilot
bash: copilot: command not found
copilot : The term 'copilot' is not recognized as the name of a cmdlet,
function, script file, or operable program.
In almost every case the binary is on disk and your PATH does not include the directory it landed in. Here is how to confirm that and fix it.
First: Confirm Which Product You Installed
copilot and gh copilot are two different things, and mixing them up is the single fastest way to chase a non-existent problem.
| Command | Product | Install |
|---|---|---|
gh copilot suggest | GitHub CLI extension — suggests and explains shell commands | gh extension install github/gh-copilot |
copilot | Standalone agentic Copilot CLI — reads and edits your repo | npm i -g @github/copilot, Homebrew, WinGet, or the install script |
If you only installed the extension, copilot will never resolve. Install the standalone CLI, or use gh copilot instead.
Find the Binary
Before changing anything, establish whether the file exists:
ls -l ~/.local/bin/copilot # install script, non-root
ls -l /usr/local/bin/copilot # install script run as root, Intel Homebrew
ls -l /opt/homebrew/bin/copilot # Homebrew on Apple Silicon
ls -l "$(npm config get prefix)/bin/copilot" # npm install
If one of those exists, this is a PATH problem — go to Fix 1. If none does, the install did not complete — go to Fix 3.
Fix 1: Add the Install Directory to Your PATH
This is the cause behind most reports, and it has a specific reason. The official install script:
curl -fsSL https://gh.io/copilot-install | bash
installs to $HOME/.local/bin for a normal user (or /usr/local/bin when run as root), then offers to add that directory to your shell profile. That offer only appears when the script can read from an interactive terminal. Because you piped it into bash, stdin is the pipe, so the script skips the prompt and merely prints the line you were supposed to add. It scrolls past, and you get command not found on the next command.
Add it yourself:
# zsh (default on macOS)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Then verify:
which copilot
copilot --version
If you installed with npm, use your npm prefix instead:
npm config get prefix # e.g. /Users/you/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Substitute the real path — do not put a command substitution in your shell profile, or every new shell will run npm on startup.
Fix 2: Clear the Shell's Command Cache
If which copilot prints a valid path but running copilot still fails, your shell is using a stale hash table from before the install:
hash -r
Or just open a new terminal window. This one-liner accounts for a surprising share of "I already fixed the PATH and it still doesn't work" cases.
Fix 3: Reinstall With a Method That Manages PATH for You
If the binary is genuinely missing, pick an install method that puts it somewhere already on your PATH.
# macOS / Linux — Homebrew (symlinks into a directory already on PATH)
brew install --cask copilot-cli
# Any platform — npm (requires Node.js 22+)
npm install -g @github/copilot
# Windows
winget install GitHub.Copilot
Two npm-specific failures to watch for:
GitHub Copilot CLI: no platform package found. Reinstall with npm install -g @github/copilot to fetch the package for your platform.— the@github/copilotpackage is a thin loader that spawns a native binary shipped as a separate per-platform package. If that package was skipped (offline install,--omit=optional, a restrictive proxy), the loader has nothing to run. Reinstall with network access.EACCES: permission denied— npm's global prefix is root-owned. Do not usesudo; move the prefix to a directory you own first.
GitHub also documents that an ignore-scripts=true entry in ~/.npmrc can prevent a complete install; in that case run:
npm_config_ignore_scripts=false npm install -g @github/copilot
Windows Specifics
# Confirm where Windows resolves it
where.exe copilot
# If npm-installed, this directory must be on your PATH
echo $env:AppData\npm
After a WinGet install, open a new terminal — the PATH change does not reach shells that were already running. PowerShell 6 or later is required; Windows PowerShell 5.1 is not supported.
Verify the Fix
which copilot # or: where.exe copilot
copilot --version
copilot help
Then start it and authenticate:
copilot
# then, at the prompt:
/login
Prevent It Coming Back
- Prefer Homebrew or WinGet — both install into directories that are already on your PATH.
- If you use the curl install script, run it and then read the last few lines of its output before closing the terminal; that is where the PATH instruction appears.
- Keep one install method. A Homebrew cask and an npm global install both provide
copilot, and whichever appears earlier in your PATH wins — which makes version mismatches very confusing to debug. - After changing your shell profile, always open a new terminal to confirm the change persists rather than relying on
source.
Next Steps
- Install GitHub Copilot CLI for the full platform-by-platform walkthrough
- Migrating from gh copilot if you were using the older extension
- Fix Copilot CLI authorization errors if the command runs but login fails