Mistral Code is designed to enhance your coding workflow by providing intelligent assistance directly within your development environment. It offers a variety of commands and shortcuts to streamline interactions and improve productivity.
Commands
Mistral Code offers several convenient slash commands that you can type directly into its chat interface to perform specific actions quickly.
Here are the currently available commands for every IDE:
/commit (VS Code & JetBrains IDEs)
Purpose: Automatically generates a concise and contextually relevant commit message based on the changes you have staged in your Git repository.
How it works:
First, you need to stage the changes you want to include in the commit using your Git client (e.g., by running
git add .
or staging files through your IDE's Git interface).In the Mistral Code chat interface, type
/commit
.Mistral Code will analyze your staged changes and propose a commit message.
You can then review, edit if necessary, and use this message for your Git commit.
Benefit: Helps maintain a clean, consistent, and informative commit history with minimal effort.
/cmd - Generate shell command (VS Code only)
Purpose: Allows you to describe a task in natural language, and Mistral Code will generate the corresponding shell command (e.g., for Bash, PowerShell, etc.).
How it works:
In the Mistral Code chat interface, type
/cmd
followed by a description of the command you need (e.g.,/cmd list all files in the current directory including hidden ones
).Mistral Code will provide the shell command that accomplishes your described task (e.g.
ls -a
on Linux/Mac ordir /a
on Windows).Command is automatically copied into your terminal, waiting for your explicit confirmation (Enter) before running.
Benefit: Useful for quickly finding the right command for less common tasks or for remembering complex command syntax.
π¨ The /cmd
command is currently not available in JetBrains IDEs.
/share - Export Chat Session (VS Code & JetBrains IDEs)
Purpose: Enables you to export your current chat conversation with Mistral Code into a portable format.
How it works:
In the Mistral Code chat/input, type
/share
.Mistral Code will typically generate a Markdown (
.md
) representation of your current chat session.You can then copy this Markdown content to save it, share it with colleagues, use it for documentation, or even as data for fine-tuning your own models.
Benefit: Makes it easy to document solutions, share interactions for troubleshooting, or keep records of important AI-assisted coding sessions.
Shortcuts
Mistral Code also provides keyboard shortcuts to quickly access its features and navigate its interface.
Here are some of the main shortcuts available for each IDE:
VS Code
Action | Mac OS | Windows / Linux |
Start a new chat | β + L | β + L |
Focus current chat | β + β§ + L | β + β§ + L |
Edit highlighted code | β + I | β + I |
Cancel response | β + β« | β + β« |
Toggle inline edit focus | β + β§ + I | β + β§ + I |
Debug Terminal | β + β§ + R | β + β§ + R |
Reject Diff | β + β§ + β« | β + β§ + β« |
Accept Diff | β + β§ + β | β + β§ + β |
Reject Top Change in Diff | β₯ + β + N | β₯ + β + N |
Accept Top Change in Diff | β₯ + β + Y | β₯ + β + Y |
Toggle Autocomplete Enabled | β + K, then β + A | β + K, then β + A |
Toggle Full Screen | β + K, then β + M | β + K, then β + M |
JetBrains IDEs
Action | Mac OS | Windows / Linux |
Start a new chat | β + J | β + J |
Focus current chat | β + β§ + J | β + β§ + J |
Edit highlighted code | β + I | β + I |
Cancel response | β + β« | β + β« |
Reject Diff | β + β§ + β« | β + β§ + β« |
Accept Diff | β + β§ + β | β + β§ + β |
π Note: The shortcuts for JetBrains IDEs are currently limited and may expand in future updates.