GitHub Copilot CLI: AI Coding Directly in Your Terminal


On September 25, 2025, GitHub launched Copilot CLI in public preview, marking a significant evolution in how developers interact with AI coding assistants. This isn’t just another autocomplete tool—it’s a full agentic AI that understands your code, GitHub context, and development workflows, all accessible directly from your terminal.

What is GitHub Copilot CLI?

GitHub Copilot CLI brings the power of AI pair programming to your command line. It’s a terminal-native development experience where you can build, edit, debug, and refactor code with an AI collaborator that can plan and execute complex tasks.

Unlike traditional Copilot integrations that focus on code completion, Copilot CLI is designed for conversational, task-oriented development work directly in your terminal.

Installation and Setup

Getting started with Copilot CLI is straightforward:

# Install via npm
npm install -g @github/copilot

# Authenticate with your GitHub account
gh auth login

# Start your AI coding session
gh copilot

Requirements:

  • GitHub Copilot Pro, Pro+, Business, or Enterprise subscription
  • Supported on macOS, Linux, and Windows (via WSL)
  • Existing GitHub credentials for authentication

Key Features

Terminal-Native Development

Work entirely in your terminal without context switching. Ask questions, request code changes, and execute development tasks all from the command line:

gh copilot chat "add error handling to the authentication middleware"
gh copilot chat "explain how the database connection pooling works"
gh copilot chat "refactor this function to be more efficient"

GitHub Integration

Copilot CLI has deep integration with your GitHub repositories:

  • Access repository history and context
  • Work with issues and pull requests using natural language
  • Leverage your GitHub authentication seamlessly
  • Understand your project structure and dependencies

Agentic Capabilities

Unlike simple code completion, Copilot CLI can:

  • Plan complex tasks: Break down feature requests into steps
  • Execute multi-file changes: Modify multiple files coherently
  • Reason about architecture: Suggest design improvements
  • Debug systematically: Analyze errors and propose fixes

Safety with Approval Gates

Nothing happens without your explicit approval. Copilot CLI shows you exactly what it plans to do before executing any changes:

# Copilot shows proposed changes
# You review them
# You approve or reject

This approval-based workflow ensures you maintain full control while benefiting from AI assistance.

Model Selection (October 2025 Update)

As of October 3, 2025, GitHub introduced enhanced model selection, giving you direct control over which AI model powers your CLI sessions:

# Switch between models using the /model command
/model claude-sonnet-4-5
/model gpt-4o
/model o3-mini

Available Models:

  • Claude Sonnet 4.5: Anthropic’s most advanced coding model (public preview)
  • GPT-4o: OpenAI’s flagship model for general tasks
  • o3-mini: Optimized for fast, cost-effective responses
  • Claude Haiku 4.5: Quick responses for simpler tasks

This flexibility lets you choose the right model for each task—use powerful models for complex refactoring, lighter models for quick questions.

Custom Agents (October 2025)

On October 28, 2025, GitHub released one of Copilot CLI’s most powerful features: custom agents. These allow you to define agent personas that capture your team’s workflows, conventions, and unique needs.

Creating Custom Agents

# .github/copilot-agents/backend-reviewer.yml
name: Backend Code Reviewer
description: Reviews backend code for our Node.js microservices
prompt: |
  You are an expert backend developer reviewing Node.js microservices.
  Follow our team's conventions:
  - Use TypeScript strict mode
  - Always include error handling
  - Write unit tests for all new functions
  - Follow RESTful API design patterns
tools:
  - read
  - grep
  - bash
mcp_servers:
  - database-schema
  - api-documentation

Using Custom Agents

# Invoke your custom agent
gh copilot agent backend-reviewer "review these API changes"

Custom agents enable teams to codify best practices and ensure consistency across development work.

MCP-Powered Extensibility

Copilot CLI ships with GitHub’s Model Context Protocol (MCP) server by default and supports custom MCP servers to extend capabilities:

Built-in GitHub MCP

  • Access repository data
  • Query issues and PRs
  • Read branch information
  • Understand project structure

Custom MCP Servers

Extend Copilot CLI to connect to:

  • Internal databases
  • Company APIs
  • Development tools
  • Custom services

Example MCP configuration:

{
  "mcpServers": {
    "database": {
      "command": "node",
      "args": ["./mcp-servers/database/index.js"]
    },
    "api-docs": {
      "command": "python",
      "args": ["-m", "mcp_servers.api_docs"]
    }
  }
}

This extensibility makes Copilot CLI adaptable to any development environment.

Image Support (October 2025)

The October 3, 2025 update added multimodal capabilities:

# Include screenshots for context
gh copilot chat --image error-screenshot.png "why is this failing?"

# Reference UI designs
gh copilot chat --image wireframe.jpg "implement this component"

This is particularly useful for:

  • Debugging visual issues
  • Implementing UI from designs
  • Understanding error screenshots
  • Converting mockups to code

The Delegation Feature

The /delegate command introduces background coding workflows:

# Commit your changes to a new branch
/delegate "implement user authentication with JWT"

What happens:

  1. Copilot commits unstaged changes to a new branch
  2. Opens a draft pull request
  3. Implements the requested changes in the background
  4. Updates the PR with the completed work

This allows you to continue working while Copilot handles tasks in parallel.

Multiline Input and Enhanced UX

The October 17, 2025 update introduced:

  • Multiline input: Write longer, more detailed prompts
  • Claude Haiku 4.5: Faster model for quick interactions
  • MCP enhancements: Improved reliability and performance
  • Streamlined UI: Cleaner, more intuitive interface

Real-World Use Cases

Feature Development

gh copilot chat "add pagination to the user listing endpoint with cursor-based pagination"

Copilot will:

  • Understand your existing API patterns
  • Implement pagination logic
  • Update routes and controllers
  • Generate appropriate tests

Debugging

gh copilot chat --image stack-trace.png "analyze this error and suggest a fix"

Copilot can:

  • Parse error messages
  • Identify root causes
  • Suggest specific fixes
  • Explain the underlying issue

Code Review

gh copilot chat "review the changes in this PR for security issues"

Leverage Copilot as an initial reviewer to catch:

  • Security vulnerabilities
  • Performance issues
  • Potential bugs
  • Style violations

Refactoring

gh copilot chat "refactor the auth service to use dependency injection"

Copilot can:

  • Understand architectural patterns
  • Apply refactorings across multiple files
  • Maintain consistency
  • Preserve functionality

Comparison to Other Tools

vs. Claude Code

  • GitHub Integration: Copilot CLI has deeper GitHub-specific features
  • Model Choice: Copilot CLI offers more model options
  • Pricing: Both require subscriptions; pricing varies by plan
  • Context: Claude Code may have larger context windows

vs. Aider

  • Ease of Use: Copilot CLI has simpler setup (uses GitHub auth)
  • Open Source: Aider is open-source; Copilot CLI is proprietary
  • Model Support: Aider supports more custom models
  • Git Integration: Both have strong git workflows

vs. IDE Extensions

  • Environment: CLI is terminal-native; extensions are editor-specific
  • Workflow: CLI suits terminal-heavy workflows; extensions suit GUI preferences
  • Capabilities: Similar AI features with different interfaces

Best Practices

1. Be Specific in Prompts

Poor:

gh copilot chat "fix the bug"

Better:

gh copilot chat "fix the null reference error in getUserProfile when user.settings is undefined"

2. Leverage Custom Agents

Create team-specific agents for:

  • Code review with your standards
  • Feature implementation following patterns
  • Testing with your frameworks
  • Deployment to your infrastructure

3. Choose the Right Model

  • Use Claude Sonnet 4.5 for complex refactoring
  • Use GPT-4o for general coding tasks
  • Use Haiku 4.5 for quick questions
  • Use o3-mini for fast iterations

4. Review Everything

Always review Copilot’s proposed changes before approving. AI is powerful but not perfect—your judgment is essential.

5. Use Images for Context

When debugging visual issues or implementing UIs, include screenshots to give Copilot better context.

Limitations

Requires GitHub Subscription

Copilot CLI requires a paid GitHub Copilot subscription (Pro, Pro+, Business, or Enterprise). There’s no free tier.

Internet Connectivity Required

As a cloud-based service, Copilot CLI requires internet connectivity to function. Offline work isn’t supported.

Context Limitations

While powerful, Copilot CLI has context window limitations. Very large codebases may require breaking work into smaller chunks.

Learning Curve

The agentic approach takes time to learn. Effective prompting and workflow integration require practice.

Pricing

GitHub Copilot CLI is included with:

  • Copilot Pro: $10/month (individual developers)
  • Copilot Pro+: $39/month (enhanced features)
  • Copilot Business: $19/user/month (teams)
  • Copilot Enterprise: $39/user/month (organizations)

No additional cost beyond your existing Copilot subscription.

The Future of Terminal-Based AI Coding

GitHub Copilot CLI represents a significant evolution in AI-assisted development. By bringing agentic capabilities directly to the terminal with:

  • Deep GitHub integration
  • Custom agents for team workflows
  • MCP extensibility for custom tools
  • Multiple model options
  • Multimodal support

It offers a compelling option for developers who prefer terminal-based workflows.

The October 2025 updates (custom agents, delegation, enhanced models) show GitHub’s commitment to rapidly iterating and improving the tool based on developer feedback.

Getting Started Today

  1. Ensure you have a GitHub Copilot subscription
  2. Install: npm install -g @github/copilot
  3. Authenticate: gh auth login
  4. Start coding: gh copilot chat
  5. Explore: Try different models, create custom agents, connect MCP servers

Resources

Conclusion

GitHub Copilot CLI brings professional-grade AI coding assistance to your terminal with deep GitHub integration, custom agent support, and MCP extensibility. Whether you’re debugging, implementing features, or refactoring code, Copilot CLI offers a powerful, flexible, and terminal-native AI pair programming experience.

If you’re already in the GitHub ecosystem and prefer terminal workflows, Copilot CLI is worth exploring. The combination of agentic capabilities, approval-based safety, and seamless integration makes it a strong choice for 2025 and beyond.