Technology

GitHub Copilot CLI: Slash Commands Explained

GitHub Copilot CLI enhances developer control with new slash commands for managing AI sessions, models, and context directly from the terminal.

StartupHub.ai Staff

By StartupHub.ai Staff, Editorial team

3 min read

Developer using GitHub Copilot CLI on a laptop with code on screen.
GitHub Copilot CLI's slash commands offer enhanced control for developers.Credit: Github Blog
Visual TL;DR
Copilot CLI EnhancementsDriver
new slash commands for terminal control
From the article 6 mentionsFurther enhancements to GitHub Copilot CLI and its integration with tools like language servers, as seen in the recent update on Copilot CLI Gains Smarts with LSP, continue to position it as a leading platform for developers seeking to leverage advanced AI capabilities.
Slash Commands InterfaceCore
typing '/' reveals scrollable command list
From the article 3 mentionsThese commands are the primary interface for controlling the CLI’s operations.
Command CenterContext
terminal becomes control panel for AI assistant
From the article 9 mentionsA recent update details the integration of slash commands, transforming the command line into a sophisticated control panel for your AI coding partner.
Optimize Model SelectionEffect
switch AI models using /model command
Manage ContextEffect
control AI's understanding of code sessions
From the article 5 mentionsAs outlined on the GitHub Blog, these commands act as built-in controls, allowing users to guide Copilot’s behavior, inspect changes, manage context, and navigate sessions seamlessly.
Inspect CodeEffect
navigate and understand AI-generated changes
From the article 3 mentionsGitHub Copilot CLI is evolving beyond simple code suggestions.
Tool PermissionsEffect
control access to external tools
From the article 5 mentionsUsers can manage the permissions granted to Copilot CLI, such as file editing capabilities.
Developer ControlOutcome
more direct and efficient AI workflow management
From the article 7 mentionsThis evolution of GitHub Copilot CLI empowers developers with greater control and efficiency, making the AI coding assistant a more integrated and responsive tool in their daily workflow.
Contents(5)

GitHub Copilot CLI is evolving beyond simple code suggestions. A recent update details the integration of slash commands, transforming the command line into a sophisticated control panel for your AI coding partner. This move offers developers more direct and efficient ways to manage their AI-assisted workflows directly within the terminal.

As outlined on the GitHub Blog, these commands act as built-in controls, allowing users to guide Copilot’s behavior, inspect changes, manage context, and navigate sessions seamlessly. Typing '/' in the CLI presents a scrollable list of all available commands.

Command Center for Your AI Assistant

The introduction of GitHub Copilot CLI slash commands signifies a significant step in making AI coding tools more interactive and manageable. These commands are the primary interface for controlling the CLI’s operations.

Optimizing Model Selection

Developers can now switch between different AI models using the /model command. This feature highlights key details for each model, including their capabilities, availability, and cost multipliers, enabling users to select the most suitable model for specific tasks like refactoring or complex planning.

Context and Session Management

Maintaining awareness of the AI’s working memory is crucial. The /context command displays current token usage, system usage, and available buffer. When space is limited, /compact summarizes the conversation to free up memory, allowing work to continue without starting a new session. For a complete reset, /clear purges the entire session.

The daily brief

Get the free daily brief with the day's AI news, new AI startups and funding rounds every morning.

Join 64,000 other subscribers.

Resuming past work is simplified with /resume, which lists previous local and remote sessions, letting developers pick up where they left off.

Inspecting and Navigating Code

Understanding changes made by the AI is facilitated by the /diff command, which shows recent updates for validation. To work across different codebases or directories without exiting the CLI, /cwd allows users to change the current working directory, scoping Copilot’s actions effectively.

Tool Permission Control

Users can manage the permissions granted to Copilot CLI, such as file editing capabilities. Running /reset-allowed-tools resets these permissions, offering enhanced security when working in sensitive repositories.

This evolution of GitHub Copilot CLI empowers developers with greater control and efficiency, making the AI coding assistant a more integrated and responsive tool in their daily workflow. The ability to manage models, context, and sessions directly from the command line streamlines complex tasks and enhances productivity.

Further enhancements to GitHub Copilot CLI and its integration with tools like language servers, as seen in the recent update on Copilot CLI Gains Smarts with LSP, continue to position it as a leading platform for developers seeking to leverage advanced AI capabilities. This makes it a key player among the AI Code Assistants.

Mentioned in this story

Sources

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

TopicsGitHub Copilot CLISlash CommandsAIDeveloper ToolsCommand Line InterfaceGitHub

StartupHub.ai Staff

Written by

StartupHub.ai Staff

Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute, free.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.