- Vibe
- Vibe Code
- Install and setup
Work with the CLI
Work with the CLI
Once the CLI is installed and your API key is set, you're ready for day-to-day work. The CLI runs in two modes: interactive for chat and exploration, and programmatic for scripting and CI.
Start the CLI in your project
Navigate to your project root and run:
vibe
You can also start with an initial prompt:
vibe "Refactor the main function in cli/main.py to be more modular."
The CLI launches a terminal chat interface. From there, you can iterate on coding tasks, reference files, run shell commands, and switch agents without leaving the terminal.
Interactive mode
Interactive mode is the default. Use it for exploration, multi-step tasks, and any work that benefits from review and follow-up.
Reference files with @
Prefix a path with @ to attach a file to your prompt. The CLI provides autocompletion as you type:
> Read the file @src/agent.py and suggest improvements.
To attach an image, @-mention it or paste its file path. On macOS, you can also paste an image from the clipboard with Ctrl+V or /paste-image. Images work when the active model supports them or when a vision_model is configured. Otherwise, the model receives [Image] and a link to the image file instead.
When the active model supports images, the agent can also open an image file from your project with read_file and see it, for example a screenshot or a diagram you ask it to look at.
Run built-in commands with /
Type / to open the slash-command picker with autocompletion. Use it for built-in commands like /help, /model, /config, or any command exposed by an installed skill. See Commands and shortcuts for the full list.
> /model
Run shell commands with !
Prefix a command with ! to run it directly in your shell, bypassing the agent:
> !ls -l
The agent sees the command and its output as context for your next message.
Commands that Vibe runs on your machine, whether the agent's shell commands or your ! commands, get VIBE_SESSION=1 in their environment. Scripts can check it to detect that they run under Vibe.
Send messages while the agent works
Press Enter while the agent works to queue a message. Vibe sends all queued messages together when the turn ends. To hand them to the agent before the turn ends, press Enter again with an empty input. When the agent only waits for subagents or background commands, your message reaches it at once.
Press Up to select a queued message, then Enter to edit it or Backspace to remove it. Escape interrupts the agent and pauses the queue; press Enter to send the paused messages. Shell (!) commands and most slash commands need an idle agent: while it works, Vibe refuses them with a notice above the input. Read-only commands such as /status, display settings such as /theme, and /branch run right away.
The » Queued header above queued messages shows the queue's keys: Enter to steer the agent with them, and Ctrl+C to cancel the last queued message.
Useful in-session shortcuts
Shortcut | Action |
|---|---|
| Shift+Tab | Cycle through agents (ask, accept-edits, smart-approve, auto-approve). |
| Ctrl+O | Toggle the tool output view. |
| Ctrl+G | Edit the current input in an external editor. |
| Ctrl+R | Search your prompt history. |
| Escape | Interrupt the current operation. |
See Commands and shortcuts for the full list of slash commands and shortcuts.
The top border of the input box shows the active model and its thinking level. Click the model to open /model.
The footer shows the working directory and how much of the context window is used. When the directory is shortened, click the copy icon after it to copy the whole path. Click the token counter to open /context.
With a Mistral plan and a Mistral model, the footer also shows how much of your organization's monthly Vibe Code usage is spent, if you're allowed to see it. Without pay-as-you-go, the gauge turns yellow, then red, as usage nears the limit. With pay-as-you-go, it reads PAYG.
Status rail
The status rail sits at the right of the loading line, above the input box. It shows one chip per item, each a count then a name, separated by ·:
Chip | Shows |
|---|---|
| ◐ 1 agent | Subagents. |
| ▪ 2 tasks | Background tasks. |
| ● PR #123 | The session's pull or merge request, or ● 2 PRs when there are several. The dot is green when mergeable, red when action is needed or the PR is closed, purple when merged, and grey when it's a draft or waiting. A bold label means a new PR or a status change you haven't seen yet. |
| ▶ goal 4m | The goal: the time spent while it runs, ‖ goal paused when paused, and ✓ goal once complete. |
| ≡ 2/5 | The todo list: done items over total. |
A dimmed Ctrl+N to navigate hint leads the rail. On narrow terminals, chips shrink to short forms, such as ◐ 1, before any is dropped.
Press Ctrl+N to focus the rail. Each chip then shows a letter: s subagents, b background tasks, p pull requests, g goal, t todo list. Press a letter to open that item's window in place of the input box. The letters disappear after one key.
To move step by step instead, use Left/Right or Tab/Shift+Tab, then press Enter. Escape goes back. Ctrl+N also works while a picker such as /model or /context is open: it closes the picker first. You can also click a chip to open its window, and click it again to close it.
Each window has its own keys:
- Subagents: Enter views the highlighted subagent.
- Background tasks: s stops the highlighted task.
- Pull requests: the same list and keys as /pr.
- Goal: p pauses or resumes, e edits, and c clears the goal.
- Todo list: Up/Down scroll.
To hide the PR chip, set enable_pr_monitoring = false.
Work toward a goal
Give the session a goal with /goal, and Vibe keeps working on it, turn after turn, until it's done:
> /goal make every test in tests/api pass
While the goal is active and the agent is idle, Vibe starts the next turn on its own, after any queued messages. The goal stops when the agent marks it complete or blocked, or when it reaches its token budget. Press Escape to pause it.
Run /goal without an argument to see the goal's status, tokens used, and time spent. /goal edit changes the objective and the token budget, and /goal pause, /goal resume, and /goal clear manage it. max_goal_token_budget in config.toml caps a goal's token budget, and is the budget of a goal set without one.
A resumed session brings its goal back paused, and Vibe offers to resume it. Goals aren't available in programmatic mode.
Programmatic mode
Programmatic mode is built for scripting, CI jobs, and any non-interactive use. Use the --prompt (-p) flag to run a single task and exit:
vibe --prompt "Analyze the codebase" --max-turns 5 --output json
You can also read the prompt from a file with --prompt-file PATH, or pipe it on stdin with -p and no text.
Programmatic mode doesn't start the chat interface and disables interactive tools such as the question prompt. It runs with your default_agent (accept-edits unless you change it). Nobody can answer an approval prompt, so Vibe denies any tool call that needs one. To approve every tool call, pass --auto-approve (or its alias --yolo):
vibe --prompt "Fix the failing tests" --auto-approve
If your administrator sets enable_auto_approve = false, Vibe ignores --auto-approve. Allow the tools the run needs with permission = "always" or an allowlist instead.
Useful options:
- --model ALIAS runs a new session on that model without changing your active_model.
- --thinking LEVEL runs a new session at that thinking level, such as low or high, without saving it.
- --system-prompt-file PATH replaces Vibe's own instructions in the system prompt with the file's text. Project context and AGENTS.md files still follow it.
- --max-turns N caps the number of assistant turns. Recommended to bound run length.
- --max-tokens N caps the total prompt and completion tokens for the run, subagents included.
- --max-price DOLLARS caps the cost of the run, subagents included. A model without a price counts as free, so its calls never count toward the limit.
- --time-limit SECONDS stops the run after a deadline. You can resume the session later. SIGTERM stops a run the same way.
- --enabled-tools TOOL restricts which tools the agent can use, and disables all others. Supports exact names, glob patterns (bash*), and regex with the re: prefix (re:^serena_.*$). Repeat the flag for several tools.
- --disabled-tools TOOL disables tools after --enabled-tools filtering. Repeat the flag for several tools.
- --output text|json|streaming sets the output format. text (default) prints the final answer, json prints the session messages as a JSON array when the run ends, and streaming prints one JSON object per message as the run progresses.
- --output-dir DIR writes an export.json file (Vibe version, effective config, token usage, cost, stop reason, and outcome) and a copy of the session to DIR, however the run ends. The export also lists each subagent with its status, model, token usage, cost, and steps, and copies its session.
Before it exits, a programmatic run waits for the subagents its last turn left running. --time-limit and other stops interrupt them.
Vibe reports each denied tool call on stderr, and in the warnings of export.json when you pass --output-dir. If the agent finishes without an answer, Vibe says so on stderr.
--max-price relies on the model prices in your config file, which can be missing or outdated. Treat the reported cost as indicative only, not as a hard budget limit.
The exit code tells you how the run ended:
Exit code | Meaning |
|---|---|
| 0 | The agent finished. |
| 1 | The run couldn't start, for example because of an invalid flag or config. |
| 2 | The model API or the runtime failed. |
| 3 | The agent stopped before finishing: a limit was reached, the run was stopped, or the model declined to answer. |
Choose how the CLI handles approval
The CLI ships with several built-in agents. By default, it uses accept-edits. Pick another one with --agent:
vibe --agent ask
vibe --agent smart-approve
vibe --agent auto-approve
Switch agents mid-session (interactive mode only) with Shift+Tab. Set the default agent for interactive and programmatic sessions in config.toml:
default_agent = "ask"
See Agents for the full list and behavior.
Review changes before they apply
For tasks with substantial file edits or shell commands, the CLI:
1.
Shows a preview of the change or command before running it.2.
Asks for confirmation, unless the active agent auto-approves.3.
Displays the result after each step.
Use the ask agent when you want to review every tool call, file edits included, before it runs. See Agents.
Trust folders
The CLI checks whether the current working directory is trusted before loading project-level configuration, skills, or agent files. The first time you run the CLI in interactive mode from a new directory that contains trustable files, it asks you to confirm the folder.
Trust enforcement applies in both interactive and programmatic modes, but the confirmation prompt only appears interactively. In programmatic mode, use vibe --trust to grant temporary trust for the current invocation only.
Vibe stores trusted folders in ~/.vibe/trusted_folders.toml. Run /trusted-folders to review or change them; changes apply the next time Vibe starts.
When you start Vibe in your home directory or another risky folder, it shows a warning at startup. To hide it, set show_dangerous_directory_warning = false.
Continue or resume sessions
The CLI can pick up where you left off:
- vibe --continue (or -c) resumes the last session of this terminal in the current directory, or the directory's most recent session when this terminal has none there.
- vibe --resume opens a picker of past sessions.
- vibe --resume SESSION_ID resumes a specific session. Pass the full ID or the 8-character short ID that Vibe shows. In programmatic mode, combine -p with --continue or --resume SESSION_ID to continue a saved session.
- /resume (or /continue) inside a session opens the same picker. Press d twice to delete the highlighted session.
- /branch forks the current conversation into a new session that you can resume later, and leaves the current session unchanged.
- /rewind (or Escape twice on an empty input) goes back to an earlier message so you can edit it and continue from there.
A resumed or continued session keeps the agent and model it last ran on, even if your default_agent changed or you pass another --agent. Switch agents inside the session to change it. If that agent is no longer available, Vibe uses --agent or your default_agent instead.
The picker, --continue, and --resume without an ID only list sessions started in the current directory. --resume SESSION_ID works from anywhere.
To choose which terminal --continue follows, set VIBE_TERMINAL_KEY to a name of your own. Set it to an empty value to resume the directory's most recent session from any terminal.
Session continuation requires session logging, which is enabled by default. If resume stops working after editing your configuration, make sure logging is still enabled in ~/.vibe/config.toml:
[session_logging]
enabled = true
Work in a git worktree
Use --worktree to run a session in its own git worktree, so the agent's changes stay apart from your current checkout:
vibe --worktree my-feature
Vibe creates the worktree under ~/.vibe/worktrees/ on a branch named my-feature, or reuses it if it already exists. Without a name, Vibe names the worktree after your prompt. Put the prompt first, because --worktree reads the next argument as the name:
vibe "Fix the login bug" --worktree
When an interactive session ends, Vibe removes a worktree it created if it holds no changes, and asks you otherwise. Programmatic runs leave the worktree in place.
On macOS, Vibe creates new worktrees of a trusted repository from a template checkout, so they take less disk space and are created faster. Vibe keeps one template checkout per repository under ~/.vibe/worktrees/.templates and sets extensions.worktreeConfig in the repository's .git/config. To create regular checkouts instead, set worktree_copy_on_write = false.
--worktree trusts the worktree for that run, so you don't need --trust. Combine it with -c or --resume to resume a session started in that worktree.