Skip to main content
Lesson 11 of 16 · Mistral Vibe: AI Coding CLI

Run shell commands

Lesson 11 of 16 Updated July 29, 2026 Developer
On this page
  1. A full shell inside the session
  2. The ! prefix for direct execution
  3. Approval, and how to relax it
  4. Chaining, referencing, drafting
  5. What these commands enable in daily work
  6. Key takeaways

A full shell inside the session

Vibe ships with a stateful Bash terminal. The key word is stateful: the environment persists from one command to the next. That means environment variables you export, the current working directory you navigate to, and aliases you define all remain active for subsequent commands. You don’t start from scratch with every call, unlike tools that spin up a disposable subshell.

The agent uses this terminal whenever it needs to—running tests, checking status, installing a dependency—but you’re also free to invoke commands yourself.

The ! prefix for direct execution

When you know exactly what you want to run, the fastest route is the ! prefix:

!ls -la src/
!git log --oneline -10
!npm run test -- --watch

This ! tells Vibe that everything following it is a shell command to execute as-is, without agent interpretation. The output appears immediately, and you stay in interactive mode.

The alternative is to let the agent translate your intent. Ask it to run unit tests, install the axios dependency, or verify that the development server starts correctly. It determines the right command for your project—npm, pip, cargo—and proposes it for your approval. This is the preferred approach when exploring a project whose tooling conventions you don’t yet know.

Approval, and how to relax it

By default, every shell command requires your go-ahead. Vibe displays exactly what it plans to execute, then waits:

The agent wants to execute:
  npm run test

Approve? (y/n)

This mechanism is the tool’s primary safety net. An accidental rm -rf proposal has no effect until you approve it—that’s the difference between an incident and a line of text you reject with an n.

You can configure this behavior in config.toml with granular permissions per tool:

[tools.bash]
permission = "ask"  # Always ask (default)

# Or for a trusted agent:
# permission = "always"  # Execute without asking

You can also relax this on the fly: Shift+Tab toggles auto-approve mode, where Vibe executes commands without confirmation. This is convenient during intensive development sessions where you’re following the agent step by step, but handle it with care since you’re bypassing the safety net described above. The Trust Folder system helps limit risk: only directories explicitly marked as safe in ~/.vibe/trusted_folders.toml allow auto-approve. A repository cloned for troubleshooting and never declared won’t benefit from this.

Chaining, referencing, drafting

The @ prefix also works for commands: referencing a file injects its content into the context, allowing the agent to understand before acting.

Run the script @scripts/deploy.sh and explain what it does

The agent reads the script first, analyzes it, then executes it if you approve—a particularly reassuring order for a deployment script you didn’t write.

For a sequence of operations, compose a multi-line message using Ctrl+J or Shift+Enter:

Run these commands in order:
1. git stash
2. git pull origin main
3. git stash pop
4. npm install
5. npm run build

Vibe executes the steps sequentially, stops if one fails, and shows you the result of each. This prevents you from discovering a stash pop failure only after a useless build. And if the message you need to draft becomes long or structured, Ctrl+G opens your external editor defined by $EDITOR: you write comfortably, save, close, and the content goes to Vibe.

What these commands enable in daily work

Dependency management lends itself well to automatic chaining: “Update all npm dependencies and check for vulnerabilities” triggers npm update, then npm audit, giving you a summary rather than a wall of output. The impact is clearest with tests, though. A request like “Run the tests, and if any fail, analyze the errors and propose fixes” packs execution, diagnosis, and a fix proposal into a single exchange.

The same principle applies to the rest of the chain: ask it to build the project in production mode and verify there are no TypeScript errors, or list running Docker containers and show logs for the api container. In all these cases, you describe the goal, the agent chooses the commands, and you retain control at the approval stage.

Key takeaways

  • The ! prefix executes a shell command directly from interactive mode
  • The agent can also determine and execute appropriate commands using natural language
  • Every command requires approval by default (configurable in config.toml)
  • The terminal is stateful: variables and the current directory are preserved
  • Auto-approve mode (Shift+Tab) removes confirmations—use with caution
  • The Trust Folder system secures auto-approve on a per-directory basis