github

GitHub Copilot CLI for Beginners: Overview of common slash commands (opens in new tab)

GitHub Copilot CLI’s slash commands provide a central way to control sessions directly from the terminal. They help users select models, manage context, inspect changes, switch projects, resume work, and control permissions. The article recommends typing / to explore the available commands and build a more deliberate CLI workflow.

Slash Commands as Copilot CLI Controls

  • Slash commands are built-in terminal controls for:
    • Guiding Copilot’s behavior
    • Inspecting project changes
    • Managing conversation context
    • Moving between sessions and repositories
    • Resetting tool permissions
  • Typing / displays a scrollable list of supported commands.

Selecting a Model

  • /model opens the list of available models.
  • Model information includes:
    • Capabilities for lightweight tasks or deeper reasoning
    • Availability based on the user’s plan or organization
    • Cost multipliers indicating relative usage cost
  • Choosing an appropriate model can balance speed, quality, and cost.

Managing Context and Tokens

  • /context shows remaining tokens, system usage, and available buffer.
  • /compact summarizes the current conversation to free context space without starting over.
  • Copilot may compact automatically near the context limit, but users can trigger it manually when changing tasks.
  • /clear completely resets the current session.

Resuming Previous Sessions

  • /resume lists earlier local and remote sessions.
  • Users can select a session to review its history and continue where they left off.

Reviewing Changes

  • /diff displays recent modifications made during the session.
  • This helps users inspect and validate Copilot’s changes before proceeding.

Switching Projects

  • /cwd changes Copilot’s current working directory.
  • It allows users to move between repositories or project directories without exiting the CLI.

Resetting Permissions

  • /reset-allowed-tools removes previously granted permissions for actions such as editing files.
  • This is useful when switching to a repository that requires more cautious access controls.

Users should start by typing / in Copilot CLI to discover available commands, then use commands such as /model, /context, /compact, /diff, and /cwd to maintain control over their coding sessions.