A beginner's guide to Copilot CLI slash commands

GitHub · Beginner ·🧠 Large Language Models ·3mo ago

Key Takeaways

This video teaches about using slash commands with GitHub Copilot CLI

Full Transcript

Hey everyone, welcome back to the GitHub Copilot CLI beginner series. In this video, we're going to do a whole overview of the CLI {slash} commands. So, let's get started. {slash} commands are the control surface within Copilot CLI. They help you steer, inspect changes, manage context, switch sessions, and keep permissions tidy. Let's take a rapid-fire look at some of the popular ones. To look at all of the {slash} commands, just type {slash} and you can scroll through the options. If you want to change which model you're using, type {slash} model. From here, you can see a list of the available models and select which one you want to use, depending on the task that you have. Some models are great for quick, lightweight jobs like refactoring, and others are better for deeper reasoning like feature planning. This list may change as new models become available, and it also depends on which plan you have and what your organization has enabled. The numbers on the right show cost multipliers, so you can see which models come with your plan and which will have an additional cost. Now that you've chosen a model, you may want to look at your token usage. To do that, type {slash} context. This view will show you how many tokens you have left and how much your system free space and buffer has. If you want to get more room within your context, type {slash} compact to summarize the conversation so you can keep going without starting a new session. What's great about Copilot CLI is that it'll do this automatically for you once you start to reach your limit. You can always do it by hand if you're moving on to a new part of your project, or you can use {slash} clear to fully start over. If you want to resume a previous session, you can type {slash} resume. This will bring up a list of previous sessions you've had, including both local and remote sessions. Entering a previous session will show you your session history and you can continue working within that same context. Once you've made some changes to your project with Copilot, you can run {slash} diff to see what the changes are. If you want to start working on another project without exiting Copilot, you can type {slash} cwd to change the working directory to another repo. You can also use this within a repo if you want to keep Copilot's work scoped to a particular piece of your project. Lastly, if you've allowed certain tools like always allow file edits in this session, but you want to revoke that, for example, let's say if you've just moved to another repo that you want to be more careful in, you can run {slash} reset allowed tools to reset tool approvals. These {slash} commands help give you even greater control over Copilot CLI, so be sure to check them out along with the rest in the list.

Original Description

Welcome to episode 3 of the GitHub Copilot CLI for beginners series! In this video, we explore how to use slash commands to control your terminal AI agent. Learn how to switch models with /model, check token usage with /context, and resume past sessions with /resume. Master these commands to keep your terminal workflow smooth and efficient. #CopilotCLI #GitHubCopilot #GitHub GitHub Copilot CLI for Beginners: https://github.com/github/copilot-cli-for-beginners?utm_source=youtube-cli-beginners-series-episode3-repo-cta&utm_medium=social&utm_campaign=copilot-cli-ga-phase-two-2026 Stay up-to-date on all things GitHub by connecting with us: YouTube: https://gh.io/subgithub Blog: https://github.blog X: https://twitter.com/github LinkedIn: https://linkedin.com/company/github Insider newsletter: https://resources.github.com/newsletter/ Instagram: https://www.instagram.com/github TikTok: https://www.tiktok.com/@github About GitHub It’s where over 180 million developers create, share, and ship the best code possible. It’s a place for anyone, from anywhere, to build anything—it’s where the world builds software. https://github.com
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics
Learn to build production-grade LLM evaluation pipelines to catch hallucinations before deployment and improve model reliability
Dev.to AI
📰
Understanding "Handoffs" in LangChain(One Agent, Many Personalities)
Learn to implement 'handoffs' in LangChain to make a single agent behave differently in various conversation stages
Dev.to AI
📰
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics
Learn to build production-grade LLM evaluation pipelines to catch hallucinations before deployment, replacing manual 'vibe checks' with automated metrics
Dev.to AI
📰
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics
Learn to build production-grade LLM evaluation pipelines, replacing subjective 'vibes' with quantitative metrics
Dev.to · Imus
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →