# github/copilot-cli architecture

> Architecture diagram of the GitHub repository github/copilot-cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github/copilot-cli
- Repository: https://github.com/github/copilot-cli

## Overview

GitHub Copilot CLI is a terminal-based AI coding assistant. The documented workflow starts when a developer launches the CLI and submits a natural-language task; the agent can plan and execute coding work, with actions previewed for explicit approval. It also provides GitHub context, MCP extensibility, model selection, authentication, and optional LSP-based code intelligence. This repository tree contains no application source excerpts, so component paths are unavailable and relationships shown here rely only on README.md documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_cli["Copilot CLI"]
  node_auth["GitHub login"]
  node_models["Model selection"]
end

subgraph group_agent["Agent work"]
  node_agent["Coding agent"]
  node_task["Coding task"]
  node_approval["Action approval"]
end

subgraph group_integrations["Integrations"]
  node_github["GitHub services"]
  node_mcp["Built-in MCP"]
  node_custom_mcp["Custom MCP servers"]
end

subgraph group_code_intel["Code intelligence"]
  node_lsp["LSP servers"]
  node_lsp_config["LSP configuration"]
end

node_developer(("Developer"))
node_workspace["Local codebase"]

node_developer -->|"launches"| node_cli
node_developer -->|"submits prompts"| node_cli
node_cli -->|"prompts login"| node_auth
node_developer -->|"selects model"| node_models
node_cli -->|"provides assistance"| node_agent
node_agent -->|"plans and executes"| node_task
node_agent -->|"previews actions"| node_approval
node_developer -->|"approves actions"| node_approval
node_agent -->|"works with code"| node_workspace
node_cli -->|"accesses context"| node_github
node_agent -->|"uses by default"| node_mcp
node_agent -->|"extends through"| node_custom_mcp
node_cli -->|"reads configuration"| node_lsp_config
node_lsp_config -->|"configures"| node_lsp
node_cli -->|"supports code intelligence"| node_lsp

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_auth,node_models toneBlue
class node_agent,node_task,node_approval toneAmber
class node_github,node_mcp,node_custom_mcp toneMint
class node_lsp,node_lsp_config toneRose
class node_developer,node_workspace toneIndigo
```

## Components

### CLI interaction

- **Copilot CLI**
- **GitHub login**
- **Model selection**

### Agent work

- **Coding agent**
- **Coding task**
- **Action approval**

### Integrations

- **GitHub services**
- **Built-in MCP**
- **Custom MCP servers**

### Code intelligence

- **LSP servers**
- **LSP configuration**

### Other components

- **Developer**
- **Local codebase**

## Connections

- Developer → Copilot CLI: launches (evidence: `README.md`)
- Developer → Copilot CLI: submits prompts (evidence: `README.md`)
- Copilot CLI → GitHub login: prompts login (evidence: `README.md`)
- Developer → Model selection: selects model (evidence: `README.md`)
- Copilot CLI → Coding agent: provides assistance (evidence: `README.md`)
- Coding agent → Coding task: plans and executes (evidence: `README.md`)
- Coding agent → Action approval: previews actions (evidence: `README.md`)
- Developer → Action approval: approves actions (evidence: `README.md`)
- Coding agent → Local codebase: works with code (evidence: `README.md`)
- Copilot CLI → GitHub services: accesses context (evidence: `README.md`)
- Coding agent → Built-in MCP: uses by default (evidence: `README.md`)
- Coding agent → Custom MCP servers: extends through (evidence: `README.md`)
- Copilot CLI → LSP configuration: reads configuration (evidence: `README.md`)
- LSP configuration → LSP servers: configures (evidence: `README.md`)
- Copilot CLI → LSP servers: supports code intelligence (evidence: `README.md`)
