copilot-cli

A Visual Studio Code guide for running GitHub Copilot CLI coding sessions in the background on your computer.

In plain words
What is it for?
Use it to hand off plans, prototypes, fixes, or features to background agents, monitor their progress, provide requested input, and isolate work in separate worktrees or workspaces.
Why use it?
It lets defined tasks continue while you work elsewhere in the editor, including several independent sessions at once.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/feimacode/feima-copilot-llms-extension/copilot-cli
Clone the repo
git clone --depth 1 https://github.com/feimacode/feima-copilot-llms-extension
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.02684
Opus 5 $0.00018 $0.01342
Sonnet 5 $0.00007 $0.00537
Haiku 4.5 $0.00004 $0.00268

Measured 2d ago against content hash 237e668fe88f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

copilot-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/src/content/docs/zh/vscode-copilot/agents/copilot-cli.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Visual Studio Code 支持通过 GitHub Copilot CLI 在后台运行智能体(Agent)会话(Agent Session)。你可以从 VS Code 的统一聊天视图中启动、监控和管理 Copilot CLI 会话,而智能体(Agent)在本机自主运行,你可以继续在编辑器中进行其他工作。并行运行多个 Copilot CLI 会话,同时处理多个独立任务。

要启动 Copilot CLI 会话,可以创建新会话,也可以将本地智能体(Local Agent)会话(Agent Session)移交给 Copilot CLI,传递现有上下文。

💡 国内用户提示 如果您希望使用国内 AI 模型,安装 飞码扣插件 即可在 GitHub Copilot Chat 中使用通义千问(Qwen3)、DeepSeek、GLM 等模型,按次计费。了解更多 → 打开飞码扣

VS Code 中 Copilot CLI 会话(聊天编辑器)的截图。

提示 OpenAI Codex 等第三方提供商也提供后台能力。了解更多:第三方智能体(Third-party Agent)

什么是 Copilot CLI 会话?

Copilot CLI 会话在本机后台独立运行,使用 Copilot CLI 智能体(Agent)框架。VS Code 通过 Copilot SDK 与这些智能体(Agent)集成,用于启动、停止和监控后台会话的进度。VS Code 会自动为你安装和配置 Copilot CLI。

Copilot SDK 会话在 VS Code 之外运行,当你关闭 VS Code 窗口时仍会继续在后台运行。这与使用 VS Code 智能体(Agent)框架在编辑器内部运行并在 VS Code 停止时也停止的本地智能体(Local Agent)不同。

你可以从统一聊天视图与 Copilot CLI 会话交互。当后台会话需要你的输入或需要权限来执行操作时,你可以在聊天中进行操作。智能体(Agent)状态指示器也会在会话需要输入时提供提示。

由于 Copilot CLI 会话在后台运行,它们非常适合范围明确、拥有所有必要上下文且不需要频繁用户交互的任务。例如,从计划实施功能、创建概念验证的多个变体,或实施明确定义的修复或功能。

Copilot CLI 在聊天中支持斜杠命令(Slash Command),包括可重用提示词(Prompt)智能体(Agent)技能Hooks、用于管理长对话的 /compact,以及用于切换工具自动批准/yolo/autoApprove。在 Copilot CLI 会话的聊天输入框中输入 / 可查看可用命令。

隔离模式

Copilot CLI 支持两种隔离模式来管理智能体(Agent)变更如何应用到代码库:WorktreeWorkspace 隔离。你可以在创建新的 Copilot CLI 会话时选择隔离模式。

要隔离 Copilot CLI 智能体(Agent)的变更并防止干扰你的当前工作,使用 Worktree 隔离。在此模式下,VS Code 为 Copilot CLI 会话在单独的文件夹中创建一个 Git worktree。智能体(Agent)所做的所有变更都应用到 worktree,与你的主工作区保持分离,直到你准备好审查并应用它们。

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 131 lines · 37 tokens per session scan A 237e668fe88f

Subscribe to this mod's changes

copilot-cli is an agent published in the GitHub repository feimacode/feima-copilot-llms-extension (5 stars, last pushed 5d ago), licensed MIT. It adds 37 tokens to every session and 2,684 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.