Skip to content

GitHub Copilot CLI Slash Commands

Slash commands provide quick, explicit controls inside the interactive GitHub Copilot CLI session. Type / to browse available commands, or use /help for the command list supported by the installed version.

Session and Context

Command Description
/clear Clear the current session's conversation history and context
/compact Summarize the current session to free context space
/context Show the context currently available to the session
/session Show information about the current session
/usage Show session usage metrics
/exit Exit Copilot CLI (alias: /quit)

Workspace and File Access

Command Description
/cwd [directory] Show or change the working directory
/add-dir <directory> Add a directory to Copilot's allowed file-access scope
/list-dirs List directories Copilot can access

Use /add-dir and /list-dirs to make the active file-access boundary explicit before working in a larger or sensitive directory tree.

Configuration and Workflow

Command Description
/model [model] Select the AI model used by Copilot CLI
/theme [show\|set\|list] View or configure the terminal theme
/terminal-setup Enable multiline terminal input
/reset-allowed-tools Reset the allowed external tools
/agent Select a custom agent
/mcp [show\|add\|edit\|delete\|disable\|enable] Manage MCP server configurations
/init Initialize Copilot custom instructions for the repository

Code Changes and Review

Command Description
/plan Create an implementation plan before making changes
/review Review code changes and report issues or improvements
/test Generate or improve tests for the code in context
/diff Open a diff view for the current changes
/undo Revert the most recent Copilot change

Collaboration and Account Management

Command Description
/delegate <prompt> Delegate work and create an AI-generated pull request
/share [file\|gist] [path] Export or share the current session
/login Log in to Copilot
/logout Log out of Copilot
/user [show\|list\|switch] Show, list, or switch GitHub accounts
/feedback Submit feedback about Copilot CLI

Help and Discovery

Command Description
/help Show the available slash commands and descriptions

The command set can change between Copilot CLI releases. Treat /help as the runtime source of truth for the current installation.

Customization

Unlike OpenCode, Copilot CLI does not document a simple .md file convention that turns an arbitrary filename into a new /command. The supported customization options are:

Feature Location or command Use it for
Custom instructions .github/copilot-instructions.md, .github/instructions/**/*.instructions.md, or AGENTS.md Project conventions and persistent context
Custom agents .github/agents/CUSTOM-AGENT-NAME.md and /agent Specialized workflows with tailored prompts and tools
Agent skills Project or user skill directories and copilot skill Reusable task capabilities
Hooks Copilot CLI hook configuration Running custom shell commands at agent lifecycle points
Plugins Copilot CLI plugin configuration Packaging and sharing custom agents, skills, MCP servers, and instructions

For a reusable task shortcut, use a custom agent or skill and select it through the supported CLI workflow. Prompt files (*.prompt.md) are documented primarily for supported IDEs, not as a general Copilot CLI slash-command mechanism.

These are interactive input shortcuts rather than slash commands:

Shortcut Description
@ FILENAME Include a file in the prompt context
# NUMBER Include a GitHub issue or pull request in the context
! COMMAND Run a command in the local shell
? Open quick help on an empty prompt

Top-level commands such as copilot login, copilot init, and copilot completion are CLI commands, not interactive slash commands.

Sources: - GitHub Copilot CLI command reference - A cheat sheet to slash commands in GitHub Copilot CLI - Customize GitHub Copilot CLI - About custom agents - Adding custom instructions for GitHub Copilot CLI