⚠️ DEPRECATION NOTICE: Thegh copilotCLI extension has been deprecated. This repository now covers the new standalone GitHub Copilot CLI.Migration Info: The new CLI is installed via
npm install -g @github/copilotand invoked withcopilot(notgh copilot).
A comprehensive guide to using GitHub Copilot CLI effectively.
- Installation
- Basic Configuration
- Global Configuration
- Model Management
- Tools and Extensions
- Usage Information
- Common Commands
- Tips and Tricks
Important: The new standalone GitHub Copilot CLI requires specific minimum versions:
| Component | Minimum Version | Recommended |
|---|---|---|
| Node.js | 22.x | 22.x (Required) |
| npm | 10.x | Latest |
| PowerShell (Windows) | 6+ | Latest |
Breaking Changes:
- GitHub CLI is no longer required - the new CLI is standalone
- Node.js 22 is now required (not just recommended)
- Windows users need PowerShell 6+ (not Windows PowerShell)
Common Issue: If you encounter installation errors, you likely need to update Node.js to version 22.
Using NVM (Recommended):
# Install NVM if not already installed
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc # or ~/.zshrc
# Install and use Node.js 22
nvm install 22
nvm use 22
nvm alias default 22
# Verify
node --version # Should show v22.x.xAlternative methods:
# macOS (Homebrew)
brew install node@22
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejsNew Installation Method:
# Install the standalone GitHub Copilot CLI
npm install -g @github/copilot
# Verify installation
copilot --versionMigration from old extension:
# Remove the old extension (if installed)
gh extension remove github/gh-copilot
# Install the new standalone CLI
npm install -g @github/copilot# Download and run our verification script
curl -sSL https://raw.githubusercontent.com/your-username/gh-copilot-cli/main/docs/prerequisites-check.sh | bashFor detailed prerequisites information, see System Requirements Guide.
⚠️ Note: The automated setup script is being updated to support the new standalone CLI. Manual installation is recommended for now.
Manual Installation Steps:
# 1. Install the new standalone CLI
npm install -g @github/copilot
# 2. Launch and authenticate
copilot
# (Follow the /login command prompts)New Standalone Installation:
# Install the standalone GitHub Copilot CLI
npm install -g @github/copilot
# Launch for first time setup
copilotAuthentication Options:
-
OAuth Flow (Recommended):
copilot # Enter /login and follow the prompts -
Personal Access Token:
# Create a PAT with "Copilot Requests" permission at: # https://github.com/settings/personal-access-tokens/new # Set environment variable export GH_TOKEN="your-pat-here" # or export GITHUB_TOKEN="your-pat-here" # Launch copilot copilot
The new standalone CLI handles authentication internally:
# Launch copilot and use /login command
copilot
# In the copilot shell, run:
# /loginThe new CLI uses an interactive approach:
# Launch copilot - configuration is done through the interactive interface
copilot
⚠️ Note: The new standalone CLI uses a different configuration system. Global configuration is managed through environment variables and the interactive interface.
# Use environment variable to set model
export COPILOT_MODEL=gpt-5 # or claude-sonnet-4 (default)
# Launch with specific model
COPILOT_MODEL=gpt-5 copilot# Set up authentication token
export GH_TOKEN="your-personal-access-token"
# or
export GITHUB_TOKEN="your-personal-access-token"# Environment variables for the new CLI
export COPILOT_MODEL=claude-sonnet-4 # Default model
export GH_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx" # Your PAT
# Launch options
copilot --banner # Show the animated banner
COPILOT_MODEL=gpt-5 copilot # Launch with GPT-5Error: "Cannot find module '@github/copilot'"
# Solution: Install using npm
npm install -g @github/copilot
# Verify installation
copilot --versionError: Node.js version issues
# The new CLI requires Node.js 22+
nvm install 22
nvm use 22
npm install -g @github/copilotError: "Authentication failed"
Solution:
- Create a fine-grained PAT with "Copilot Requests" permission
- Set environment variable:
export GH_TOKEN="your-pat-here" copilot
- Or use the
/logincommand in copilot for OAuth flow
Why this happens: The new standalone CLI requires direct authentication, not through GitHub CLI.
For more troubleshooting information, see System Requirements Guide.
For detailed configuration instructions, see:
- Global Configuration Guide - Complete setup instructions
- Git Integration - Commit signing and workflow preferences
- Python Project Setup - Pipenv and project structure preferences
The new CLI supports these models:
- Claude Sonnet 4 (default)
- GPT-5 (via environment variable)
# Use environment variable
export COPILOT_MODEL=gpt-5
# Launch with specific model
COPILOT_MODEL=gpt-5 copilot
# Or on Windows
set COPILOT_MODEL=gpt-5
copilotThe current model is displayed in the copilot interface or set by environment variable.
The new CLI has built-in tools and GitHub integration:
- Terminal-native development
- GitHub integration (repos, issues, PRs)
- Code execution and file operations
- MCP-powered extensibility
# Launch in your project directory
cd /path/to/your/project
copilot
# The CLI automatically detects your GitHub contextEach prompt to GitHub Copilot CLI consumes one premium request from your monthly quota.
# Check basic information - run within copilot
/help # Show available commands
/feedback # Submit feedback survey
# Environment check
node --version # Should be 22+
copilot --version# Basic launch
copilot
# With animated banner
copilot --banner
# With specific model
COPILOT_MODEL=gpt-5 copilot/login # Authenticate with GitHub
/help # Show available commands
/feedback # Submit feedback surveyThe new CLI uses natural language within the interactive session:
- "Help me debug this error"
- "Review my staged changes"
- "Create a Python REST API"
- "Explain this codebase"
- Launch copilot from your project directory for automatic context
- The CLI can access your GitHub repositories, issues, and pull requests
- Use clear, specific natural language prompts
- Claude Sonnet 4 (default): Excellent for most development tasks
- GPT-5: Available via
COPILOT_MODEL=gpt-5environment variable - Models are set at launch time
- Launch from your project root directory
- The CLI automatically detects your GitHub context
- Ask about issues, PRs, and repository information naturally
- Each session is independent - no persistent conversation history
- Use descriptive prompts to provide context in each request
- Be mindful of premium request quota
# Create aliases for common usage
alias cop="copilot"
alias copr="COPILOT_MODEL=gpt-5 copilot"
# Environment setup in your shell profile
export COPILOT_MODEL=claude-sonnet-4 # Set default model
export GH_TOKEN="your-pat-here" # Set authenticationThe new CLI integrates directly with your development environment:
- Automatic detection of project context
- Access to GitHub repositories and metadata
- Direct terminal integration without context switching
The new CLI uses environment variables for configuration:
COPILOT_MODEL: Set the model (claude-sonnet-4 or gpt-5)GH_TOKENorGITHUB_TOKEN: Personal access token for authentication
# In your shell profile (.bashrc, .zshrc, etc.)
export COPILOT_MODEL=claude-sonnet-4
export GH_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx"
# Create aliases
alias cop="copilot"
alias cop5="COPILOT_MODEL=gpt-5 copilot"# Update Node.js to version 22
nvm install 22 && nvm use 22
# Reinstall the CLI
npm install -g @github/copilot
# Verify installation
copilot --version# Check your PAT has "Copilot Requests" permission
# Set environment variable
export GH_TOKEN="your-pat-here"
# Or use OAuth flow
copilot
# Then use /login command# Verify model setting
echo $COPILOT_MODEL
# Try different model
COPILOT_MODEL=claude-sonnet-4 copilot
⚠️ Note: Advanced features like templates and batch operations are not yet available in the new standalone CLI. These were features of the oldgh copilotextension.
The new CLI focuses on interactive, conversational development:
# Work with your entire project context
cd /path/to/your/project
copilot
# Ask: "Help me understand this codebase structure"
# Ask: "Review my recent changes"
# Ask: "Create tests for the authentication module"The new CLI is rapidly evolving. Check the official repository for updates on:
- Batch operations
- Custom prompt templates
- Advanced configuration options
This project is licensed under the MIT License - see the LICENSE file for details.
For more information, visit: