Skip to main content

What are the available commands and shortcuts in Mistral Code, and how do they work?

Updated this week

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:

    1. 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).

    2. In the Mistral Code chat interface, type /commit.

    3. Mistral Code will analyze your staged changes and propose a commit message.

    4. 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:

    1. 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).

    2. Mistral Code will provide the shell command that accomplishes your described task (e.g. ls -a on Linux/Mac or dir /a on Windows).

    3. 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:

    1. In the Mistral Code chat/input, type /share.

    2. Mistral Code will typically generate a Markdown (.md) representation of your current chat session.

    3. 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.

Did this answer your question?