Mentu

CLI Commands

CLI Commands

mentu is the CLI entry point for the engine. Commands are organized into groups: execution, CIR, auth and vault, infrastructure, management, audit, utility, and AI training.

mentu <command> [subcommand] [flags]
mentu --version
mentu --help

Global flags available on most commands:

Flag Description
--verbose Verbose output
--quiet Suppress non-essential output
--config <path> Override config file location

Execution

Commands that run recipes, sequences, and agent steps.

mentu do

Run an intent directly. This is the default command (invoked when no subcommand is given).

mentu do <intent...>

Passes your intent to an agent that selects the right tools and executes.

mentu step

Run a single agent step with a prompt.

mentu step -P <prompt-file> [flags]

Flag Type Description
-P path Path to prompt file
-p string Inline prompt text
--max-iterations int Maximum agent iterations
--completion-keyword string Keyword that signals completion (e.g. STEP_COMPLETE)
-m, --model string Model ID (e.g. claude-opus-4-6)
--backend string Backend to use (anthropic, ollama)
--subagent-max-turns int Max turns for subagents
--pipeline-mode bool Run in pipeline mode
-n, --name string Step name for logging

mentu sequence

Execute a recipe by name. Aliases: run, formula.

mentu sequence <recipe-name> [flags]

Flag Type Description
-P path Override prompt file
--from string Resume from step label
--model string Override recipe model
--backend string Override backend
--auto bool Non-interactive mode, approve all gates
--var KEY=VALUE kv Inject a variable (repeatable)
--transfer string Transfer mode: none, worktree, mirror, rsync
--vm bool Run tool calls inside a VM sandbox
--worktree bool Shorthand for --transfer worktree
--no-cache bool Skip cached results
--max-budget USD Maximum spend limit for the run
--no-ane bool Disable ANE inference
--notify bool Send notification on completion
--workspace path Override workspace directory

See Transfer Modes & VM Isolation.

mentu pipeline

Run a chain of sequences defined by a pipeline JSON. Alias: chain.

mentu pipeline <pipeline-name> [flags]

Flag Type Description
--from string Resume from a specific sequence
--model string Override model for all sequences
--backend string Override backend
--transfer string Transfer mode
--vm bool VM isolation
--workspace path Override workspace directory

mentu compound

Multi-layer compound execution (layered sequences with shared substrate).

mentu compound <compound-name> [flags]

Flag Type Description
-m, --model string Override model
--backend string Override backend
--transfer string Transfer mode
--vm bool VM isolation
--no-cache bool Skip cached results
--max-budget USD Maximum spend limit
--max-depth int Maximum layer depth (default 10)
--max-runtime seconds Maximum runtime (default 14400)
--from string Resume from layer label
--workspace path Override workspace directory

mentu parallel

Run multiple recipes concurrently. Alias: fleet.

mentu parallel <names...> [flags]

Flag Type Description
--parallel int Max concurrent runners
-m, --model string Override model
--backend string Override backend
--no-cache bool Skip cached results
--workspace path Override workspace directory
--from int Resume from index

mentu adversarial

Red team / blue team adversarial pairing. Two agents argue, a judge picks.

mentu adversarial <recipe> [flags]

Flag Type Description
-m, --model string Override model
--max-budget USD Maximum spend limit

mentu convergent

Run N strategies in parallel and pick the best result.

mentu convergent <recipe> [flags]

Flag Type Description
-m, --model string Override model
--max-budget USD Maximum spend limit
--parallel int Number of concurrent strategies

CIR

Commands for the Contradiction-Invariance Record substrate.

mentu cir

CIR substrate operations.

mentu cir <subcommand> [args]

Subcommands:

Subcommand Description
query Filter signals by recipe, step, type, trust, confidence
capture Inject a signal into the substrate
search Semantic search over signals
stats Summary counts by type, recipe, trust
contradictions List unresolved contradictions
patterns List detected patterns
relate Create a relationship between two signals
reinforce Reinforce a signal's confidence
decay Apply time-based confidence decay
embed Regenerate embeddings
compact Compact the JSONL ledger
export Export signals to a file
validate Validate ledger integrity
evaluate Evaluate signal quality
cost Show CIR storage cost
sync Sync signals across stores
chain Walk the evidence chain for a signal
train Extract training data from signals
surprisal Compute surprisal scores
perceive Classify input via ANE perception
judge Run trust judgment on a signal
promote Promote a pattern to a rule
capabilities List available CIR capabilities

See CIR Substrate.

mentu health

Health metrics across the CIR store.

mentu health [flags]

Flag Type Description
--days int Days of history to include
--format string Output format

mentu verify-ledger

Ledger integrity verification. Walks the hash chain and reports mismatches.

mentu verify-ledger [flags]

Flag Type Description
--format string Output format

Auth & Vault

Authentication and secret storage.

mentu auth

API authentication (OAuth tokens).

mentu auth <subcommand>

Subcommands: login, status, logout

Subcommand Description
login Start OAuth flow, store token
status Show current auth identity
logout Clear stored token

mentu vault

Secrets management backed by the macOS Keychain.

mentu vault <subcommand> [flags]

Subcommands: set, get, list, delete, migrate

Flag Type Description
--scope string Vault scope (default or custom namespace)
--tier string Secret tier (user, workspace, recipe)
mentu vault set OPENAI_API_KEY
mentu vault list --scope workspace

Infrastructure

Commands for scheduled, monitored, and substrate-level operations.

mentu temporal

Scheduled execution of recipes at defined times or intervals.

mentu temporal <subcommand>

Subcommands: run, daemon, list, status, history, health, add, remove, enable, disable

See Scheduling guide.

mentu cron

Cron-style scheduling interface (delegates to temporal).

mentu cron <subcommand>

Subcommands: add, list, remove, run, status

mentu sentinel

Continuous monitoring. Runs a sequence when a condition triggers.

mentu sentinel <subcommand>

Subcommands: run, daemon, list, status, history, add, remove, enable, disable, resolve, check

mentu substrate

Meta-operations on infrastructure state (temporals, sentinels, workers, vault).

mentu substrate <subcommand>

Subcommands: run, apply, rollback, diff, list, status, history, show, reset

Management

Commands for recipes, scripts, webhooks, and registered tools.

mentu recipe

Recipe management (create, validate, export, commit).

mentu recipe <subcommand>

Subcommands: create, list, export, import, clone, validate, commit, insights

Subcommand Description
create Scaffold a new recipe from a template
list List recipes in ~/.mentu/recipes/
export Export a recipe and its prompts to a tarball
import Import a recipe tarball
clone Copy a recipe to a new name
validate Validate the JSON schema
commit Register as a reusable recipe (constitutional gate)
insights Print execution insights from past runs
discuss Interactive discussion about a recipe

mentu script

Script execution (TypeScript SDK scripts).

mentu script <subcommand> [flags]

Subcommands: run, list

Flag Type Description
--var kv Inject a script variable
--workspace path Override workspace directory
--timeout seconds Script timeout

mentu webhook

Webhook management (inbound triggers from external services).

mentu webhook <subcommand> [flags]

Subcommands: register, list, delete, test

Flag Type Description
--event string Event name to listen for
--url string Callback URL
--secret string HMAC shared secret

See Webhooks guide.

mentu worker

Edge worker lifecycle — deploy, secrets, logs.

mentu worker <subcommand>

Subcommands: setup, create, deploy, list, status, delete, secret, logs

secret sub-subcommands: set, delete, list

The CLI auto-detects the deployment path. If Cloudflare credentials exist in the vault (via mentu worker setup), all commands use your CF account directly (BYOK). Otherwise, commands route through Mentu's managed edge at api.mentu.ai, deploying to *.edge.mentu.ai. Same commands, invisible backend switch.

Subcommand BYOK (own CF account) Managed (no CF setup)
setup Stores CF credentials in vault Not needed
create Local scaffold Local scaffold (same)
deploy Direct CF upload POST to api.mentu.ai
list CF /workers/scripts api.mentu.ai/v1/edge/workers
status CF /workers/services api.mentu.ai/v1/edge/workers/{id}
delete CF delete api.mentu.ai delete
secret * CF secrets API api.mentu.ai secrets proxy
logs WebSocket tail Not yet available (managed)

Managed workers have a free tier limit of 3 active workers per user.

# No setup needed for managed edge — just deploy:
mentu worker deploy my-api
# → https://my-api-a1b2c3d4.edge.mentu.ai
 
# Or use your own CF account:
mentu worker setup
mentu worker deploy my-api
# → https://my-api.your-subdomain.workers.dev

mentu dispatch

Async command dispatch (plugin tools and built-in tools).

mentu dispatch <subcommand> [flags]

Subcommands: send, watch, status, list

Flag Type Description
--params json JSON params to pass to the tool
--device string Target device ID

mentu plugin

Plugin management.

mentu plugin <subcommand> [flags]

Subcommands: list

Flag Type Description
--json bool JSON output

See Plugins guide.

mentu ratchet

Code quality ratchets (monotonic regex baselines).

mentu ratchet <subcommand> [flags]

Subcommands: check, baseline

Flag Type Description
--source path Source directory to scan
--config path Path to ratchets.json

See Ratchets guide.

Audit

Web and binary audit commands.

mentu audit web

Audit a web target (inspects network, scripts, and headers).

mentu audit web <url> [flags]

Flag Type Description
--intercept bool Intercept network traffic
--format string Output format (json, markdown)

mentu audit binary

Audit a binary (symbols, strings, imports, linked libraries).

mentu audit binary <path> [flags]

Flag Type Description
--full bool Full audit including decompilation hints
--deep bool Deep semantic analysis
--format string Output format

mentu audit full

Combined web and binary audit.

mentu audit full <url> [flags]

Flag Type Description
--binary path Local binary to audit alongside the URL
--intercept bool Intercept network traffic

Utility

General-purpose utility commands.

mentu init

Initialize a new mentu workspace in the current directory.

mentu init [name] [flags]

Flag Type Description
--tier int Governance tier (1, 2, or 3)
--governance bool Enable governance features

mentu list

List all recipes in the workspace.

mentu list [flags]

Flag Type Description
--validate bool Validate each recipe on load

mentu daemons

Show the status of all mentu daemons (temporal, sentinel, runtime).

mentu daemons

mentu result

Show the last result for a recipe.

mentu result <recipe-name>

mentu log

Show the execution log for a recipe step.

mentu log <recipe-name> [flags]

Flag Type Description
-l, --lines int Number of lines to show (default 50)

mentu trace

Perfetto trace management (execution timeline files).

mentu trace <subcommand>

Subcommands: list, open, clean, test

mentu rewind

Restore files to the state before a step ran.

mentu rewind <target> [flags]

Flag Type Description
--session string Session ID to rewind from
--dry-run bool Show what would change without applying
--force bool Skip confirmation
--backfill-cir bool Backfill CIR signals after rewind

mentu watch

Watch recipe directories for file changes and trigger runs.

mentu watch

mentu setup

Local LLM setup (Ollama model installation).

mentu setup [flags]

Flag Type Description
--model string Ollama model to install
--skip-install bool Skip the install step

mentu preset

Agent preset management (prompt + model + tools templates).

mentu preset <subcommand>

Subcommands: list, get, set, create, delete

mentu device

Device presence tracking for multi-device workflows.

mentu device <subcommand>

Subcommands: id, status, list

mentu agent start

Start an agent session from a preset.

mentu agent start <presetId> [flags]

Flag Type Description
--prompt string Initial prompt
--workspace path Workspace directory
--model string Override model
--background bool Run in the background

mentu workspace

Workspace management.

mentu workspace <subcommand>

Subcommands: create, list

mentu profile

Workspace profile management (per-workspace settings).

mentu profile <subcommand>

Subcommands: show, list, add, refresh

mentu reasoning

Reasoning tier presets (effort levels for models).

mentu reasoning <subcommand>

Subcommands: list, show

AI Training

Commands for LoRA fine-tuning and hyperparameter search.

mentu lora

LoRA fine-tuning lifecycle.

mentu lora <subcommand>

Subcommands: list, register, status, train, eval, extract-sft

Subcommand Description
list List registered LoRA adapters
register Register a new adapter
status Show training status
train Kick off a training run
eval Evaluate a trained adapter
extract-sft Extract SFT training data from CIR

mentu autoresearch

Autonomous hyperparameter search.

mentu autoresearch <subcommand>

Subcommands: run, list, status, history, add

Exit codes

Code Meaning
0 Success
1 General error
2 Invalid arguments
3 Recipe validation failed
4 Step failed (agent error or non-zero exit)
5 Canary check failed
6 Auth required
7 Resource locked (workspace in use)

See also

© 2026 Mentu.