Welcome again to GitHub Copilot CLI for Novices! On this collection (obtainable in video and weblog format), we’ll provide you with all the pieces that you must get began utilizing GitHub Copilot CLI. Thus far on this collection, we’ve lined the way to get began and when to make use of interactive and non-interactive modes. On this version, we’ll study what slash instructions are, why they matter, and the way to use slash instructions to regulate GitHub Copilot effectively. You possibly can full duties like switching fashions, checking token utilization, and resuming previous classes proper out of your terminal.
Let’s dive in!
Understanding slash instructions in GitHub Copilot CLI
When working in Copilot CLI, one of the highly effective ideas to study early on is slash instructions. Slash instructions are built-in controls you can entry immediately from the command line. Appearing as your management floor inside Copilot CLI, slash instructions can help you:
Information Copilot’s habits
Examine adjustments
Handle context
Transfer effectively throughout classes and initiatives
Hold permissions tidy
Slash instructions might be considered your command heart for interacting with Copilot CLI. To take a look at the entire choices obtainable, simply kind / within the command line for a scrollable checklist of all at the moment supported slash instructions.
Let’s check out a few of the hottest ones.
Choosing the proper mannequin
Completely different fashions are optimized for various sorts of labor. If you wish to change fashions, kind /mannequin into the command line. This may show an inventory of accessible fashions, together with key particulars like:
Capabilities: Some are higher for fast, light-weight duties like refactoring, whereas others extra effectively deal with deeper reasoning corresponding to characteristic planning.
Availability: The checklist could range relying in your plan or group’s settings.
Price: Numbers proven on the correct of every mannequin point out price multiplier, serving to you select the correct stability between efficiency and utilization in relation to your plan.
Choosing the proper mannequin can considerably influence each velocity and outcomes.
Managing context and token utilization
Copilot CLI operates inside a context window, which determines how a lot data it will probably “bear in mind” throughout a session. If you wish to verify your present utilization, kind /context to study what number of tokens you’ve left, together with system utilization and obtainable buffer.
In case you discover that you just’re working low on area, you’ll be able to unencumber area by typing /compact within the command line. This summarizes your present dialog so you’ll be able to proceed with out having to begin a brand new session. Copilot CLI will do that mechanically once you strategy the restrict, however you can even do that manually if you wish to transition to a brand new activity or clear up context mid-session.
In case you’d reasonably begin contemporary and utterly reset your setting, you should utilize /clear to clear the session completely.
Working throughout classes
If you wish to resume a earlier session, you’ll be able to kind /resume. This may carry up an inventory of earlier classes you’ve had, together with each native and distant classes. Coming into a earlier session will present you your session historical past, and you may decide up proper the place you left off.
Inspecting adjustments
As you’re employed with Copilot to make adjustments to your mission, it’s essential to maintain observe of what’s modified. If you wish to see what the adjustments are, run /diff to see current updates. This offers you a transparent view of what modifications have been made throughout your session, so you’ll be able to validate adjustments earlier than transferring ahead.
Navigating initiatives and directories
If you wish to work throughout repositories or directories, you don’t need to exit Copilot. You possibly can kind /cwd to alter your working listing to a different repository. This lets you scope Copilot’s work to a particular a part of your mission and helps you keep environment friendly whereas multitasking throughout codebases.
Previously, you may need granted Copilot CLI permission to carry out actions like enhancing information. Say you’re switching to a repository you wish to be extra cautious in and wish to reset these permissions: you are able to do so by working /reset-allowed-tools.
Take this with you
Utilizing these slash instructions provides you even higher management over Copilot CLI—and the extra acquainted you develop into with them, the extra deliberate your workflow turns into.
Whether or not you’re switching fashions, managing context, or navigating throughout initiatives, utilizing slash instructions in CLI provides you the instruments that you must keep in management. And should you haven’t already: open up your terminal, kind /, and discover! There are lots of extra slash instructions to find.
Completely satisfied coding!
Seeking to strive GitHub Copilot CLI? Learn the docs and get began immediately.
Extra sources to discover:

