agentsclimarketplace

Copilot cli guide

Skill trsdn/github-copilot-cli/.github/skills/copilot-cli-guide

Blueprint for customizing GitHub Copilot CLI — custom agents, instructions, skills, and MCP configurations. Terminal-only. No VS Code.

Install
npx -y skills add trsdn/github-copilot-cli --skill copilot-cli-guide

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Quick reference for GitHub Copilot CLI features, slash commands, keyboard shortcuts, modes, and advanced usage. Use when the user asks about CLI capabilities, commands, or how to use specific features.

SKILL.md

13.6 KB, as published. Nobody here has run it

Copilot CLI Guide

Quick reference for GitHub Copilot CLI — the terminal-native AI coding agent.

When to use this skill

  • User asks about Copilot CLI features or capabilities
  • User needs help with slash commands or keyboard shortcuts
  • User wants to understand modes (interactive, plan, autopilot)
  • User asks about context management or session handling

Getting Started

# Install (macOS/Linux)
curl -fsSL https://gh.io/copilot-install | bash

# Install (Homebrew)
brew install copilot-cli

# Install (npm, cross-platform)
npm install -g @github/copilot

# Install (Windows)
winget install GitHub.Copilot

# Launch
copilot

Keyboard Shortcuts

Global

ShortcutAction
@Mention files, include contents in context
#Include a GitHub issue or pull request in context
!Execute shell command directly (bypass Copilot)
?Open quick help on an empty prompt
EscCancel current operation
Ctrl+CCancel operation / clear input; press twice to exit
Ctrl+DShutdown
Ctrl+Enter / Ctrl+QQueue a message while the agent is busy
Ctrl+GEdit prompt in external editor
Ctrl+LClear the screen
Ctrl+RReverse search command history
Ctrl+VPaste from clipboard as an attachment
Ctrl+X then /Run a slash command after typing a prompt
Ctrl+X then eEdit the prompt in an external editor
Ctrl+X then oOpen the most recent link from the timeline
Shift+Enter / Option+EnterInsert a newline in the input
Shift+TabCycle modes (standard → plan → autopilot)

Timeline

ShortcutAction
Ctrl+TExpand/collapse reasoning display
Ctrl+OExpand recent timeline items when prompt is empty
Ctrl+EExpand all timeline items when prompt is empty
Page Up / Page DownScroll the timeline

Editing

ShortcutAction
Ctrl+AMove to beginning of line
Ctrl+EMove to end of line
Ctrl+HDelete previous character
Ctrl+WDelete previous word
Ctrl+UDelete from cursor to beginning of line
Ctrl+KDelete from cursor to end of line
Alt+← / Alt+→Move cursor by word on Windows/Linux
Option+← / Option+→Move cursor by word on macOS
/ Navigate command history
Tab / Ctrl+YAccept inline completion suggestion

Slash Commands

Agent & Customization

CommandPurpose
/initInitialize Copilot instructions and agentic features for this repository
/agentBrowse and select from available agents
/skillsManage skills for enhanced capabilities
/mcpManage MCP server configuration
/pluginManage plugins and plugin marketplaces
/instructionsView and toggle custom instruction files
/envShow loaded instructions, MCP servers, skills, agents, plugins, LSPs, and extensions

Models & Subagents

CommandPurpose
/modelSelect AI model to use
/fleetEnable fleet mode for parallel subagent execution
/tasksView and manage background tasks

Code & Review

CommandPurpose
/ideConnect to an IDE workspace
/diffReview changes made in current directory
/prView, create, fix, or automate pull requests
/reviewRun code review agent
/lspManage language server configuration
/planCreate implementation plan before coding
/researchRun deep research investigation
/delegateDelegate changes to a remote repository with an AI-generated pull request

Permissions

CommandPurpose
/allow-all, /yoloEnable, disable, or show all permissions
/add-dirAdd a directory to allowed list
/list-dirsDisplay all allowed directories
/cwd, /cdChange working directory
/reset-allowed-toolsReset allowed tools

Session

CommandPurpose
/resume, /continueResume a previous session
/renameRename current session
/contextShow context window token usage
/usageDisplay session usage metrics
/compactSummarize conversation to reduce context
/share, /exportShare session or research to Markdown, HTML, or GitHub gist
/copyCopy last response to clipboard
/sessionShow session info

Help & Feedback

CommandPurpose
/helpShow help for interactive commands
/changelog, /release-notesDisplay changelog for CLI versions
/feedbackProvide feedback about the CLI
/themeView or configure terminal theme
/updateUpdate CLI to latest version
/experimentalManage experimental features
/clear, /new, /resetStart a new conversation
/versionDisplay version information and check for updates

Other

CommandPurpose
/exit, /quitExit the CLI
/loginLog in to Copilot
/logoutLog out of Copilot
/userManage GitHub user list
/remoteEnable or end remote steering
/undo, /rewindRewind the last turn and revert file changes
/keep-alivePrevent sleep while the CLI session is active or busy
/terminal-setupConfigure terminal for multiline input (shift+enter)

Modes

Standard Mode (default)

Standard chat mode. Copilot asks for approval before modifying files or executing tools unless permissions allow them.

Plan Mode

Press Shift+Tab to enter plan mode. Copilot creates an implementation plan before writing any code. Great for complex tasks.

Autopilot Mode (experimental)

Copilot continues working on tasks until completion with less manual intervention. Enable with --mode autopilot, --autopilot, or by cycling modes with Shift+Tab.

Context Management

Include files

Use @ followed by a relative path to include file contents:

Explain @config/ci/ci-required-checks.yml
Fix the bug in @src/app.js

Manage context window

/context    # Visual overview of token usage
/usage      # Detailed session statistics
/compact    # Compress conversation history

Copilot CLI automatically compresses history when approaching 95% of the token limit.

Working with directories

/add-dir /path/to/directory    # Add trusted directory
/cwd /path/to/directory        # Change working directory
/list-dirs                     # Show allowed directories

Session Management

# Resume previous session
/resume

# Resume most recent session from terminal
copilot --continue

# Start with a specific agent
copilot --agent=my-agent --prompt "Do something"

Built-in Agents

Use built-in agents before creating a custom project agent when the task matches their purpose.

AgentPurpose
exploreFast read-only codebase exploration and focused answers
researchDeeper investigation across code, GitHub, and web sources
taskBuild, test, lint, and command execution summaries
code-reviewHigh signal-to-noise review of diffs for bugs, security, and logic issues
general-purposeComplex multi-step work in a separate context window
configure-copilotExperimental configuration helper for MCP servers, agents, and skills
rubber-duckExperimental critique of plans, designs, implementations, or tests

MCP Servers

Built-in MCP servers include GitHub, Playwright, fetch, and time. Additional MCP servers can be configured at repository, workspace, user, agent, or one-session scope.

/mcp show               # Show configured MCP servers
/mcp add                # Add a new MCP server interactively
copilot mcp list        # List servers from the shell
copilot mcp add NAME -- COMMAND ARGS...

Common config locations:

  • .github/mcp.json for repository-level MCP config
  • .mcp.json for workspace MCP config
  • ~/.copilot/mcp-config.json for user-level MCP config
  • --additional-mcp-config for a single session

Advanced MCP considerations:

  • Use /mcp auth SERVER-NAME when a remote OAuth server needs re-authentication.
  • Use filterMapping to control how MCP output is cleaned or formatted before it reaches the model.
  • Use OIDC only when the server is designed to receive Copilot-issued identity tokens.
  • Expect enterprise allowlists to block non-default servers until approved by policy.
  • Migrate VS Code .vscode/mcp.json to .mcp.json by remapping servers to mcpServers.

LSP Configuration

For enhanced code intelligence, configure language servers:

  • User-level: ~/.copilot/lsp-config.json
  • Repository-level: .github/lsp.json
{
  "lspServers": {
    "typescript": {
      "command": "typescript-language-server",
      "args": ["--stdio"],
      "fileExtensions": {
        ".ts": "typescript",
        ".tsx": "typescript"
      }
    }
  }
}

Custom Instructions Locations

Copilot CLI reads instructions from these locations (in order):

  1. CLAUDE.md (git root & cwd)
  2. GEMINI.md (git root & cwd)
  3. AGENTS.md (git root & cwd)
  4. .github/instructions/**/*.instructions.md (git root & cwd)
  5. .github/copilot-instructions.md
  6. $HOME/.copilot/copilot-instructions.md
  7. COPILOT_CUSTOM_INSTRUCTIONS_DIRS (additional directories via env var)

Path-specific instruction files require applyTo frontmatter and can include comma-separated glob patterns.

Useful CLI Flags

copilot --banner          # Show animated banner
copilot --experimental    # Enable experimental features
copilot --mode plan       # Start in plan mode
copilot --mode autopilot  # Start in autopilot mode
copilot --plan            # Shorthand for --mode plan
copilot --autopilot       # Enable autopilot in prompt mode
copilot --continue        # Resume most recent session
copilot --resume SESSION  # Resume specific session
copilot --agent=NAME      # Use specific agent
copilot --prompt "..."    # Start with a prompt
copilot --interactive "..." # Start interactive mode and run a prompt
copilot --allow-all       # Enable all permissions
copilot --yolo            # Alias for --allow-all
copilot --available-tools=read,grep,edit # Restrict tools available to the model
copilot --allow-tool='shell(git:*)'      # Pre-approve matching tool calls
copilot --deny-tool='shell(git push)'    # Deny matching tool calls
copilot --add-dir=/path/to/project       # Allow access to another directory
copilot --config-dir=/path/to/config     # Use a different config directory

Programmatic Usage

Use prompt mode for scripts, CI helpers, or repeatable local automation. In non-interactive contexts, provide explicit tool and path permissions so the run does not stop for approval prompts.

copilot --prompt "Update the changelog" --allow-tool=read,grep,edit --add-dir="$PWD"
copilot --prompt "Review this branch" --output-format=json --silent
copilot --prompt "Run the test task" --share=./copilot-session.md

Token environment variables are checked in this order: COPILOT_GITHUB_TOKEN, GH_TOKEN, then GITHUB_TOKEN. Prefer fine-grained tokens with the minimum required permissions for automation.

Permission Patterns

Permission flags accept broad tool names or structured patterns. Deny rules take precedence over allow rules.

copilot --allow-tool='shell(git:*)' --deny-tool='shell(git push)'
copilot --allow-url='https://github.com' --deny-url='https://example.com/private'
copilot --allow-tool='MyMCP(create_issue)'
copilot --allow-tool='MyMCP'

Common pattern kinds include read, write, shell, url, memory, and MCP server names.

OpenTelemetry Monitoring

Copilot CLI can export traces and metrics for agent turns, LLM requests, tool calls, token usage, and errors. Monitoring is off by default and activates when an OpenTelemetry endpoint or file exporter is configured.

export COPILOT_OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.example.com/v1/traces
export OTEL_SERVICE_NAME=github-copilot

Do not enable full content capture in shared or untrusted environments. It may record prompts, code, tool arguments, and tool results.

Reference Documentation

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.