Headless CLI
Run the same workspace from the terminal with vortex run and vortex review, including detached jobs, CI gates, and review rules from AGENTS.md.
The desktop app is one front end for the same workspace. The vortex command line runs the same loop (understand, plan, implement, verify) from a terminal, so the work can happen in a script, a CI job, or an SSH session.
A first run
vortex run --prompt "…" --workspace . --model openai/gpt-4o-mini--workspace sets the directory the agent works in. --model names the model to use. Without it, OpenRouter runs use openai/gpt-4o-mini and OpenAI runs use gpt-4o-mini; every other provider needs a model. VORTEX_RUN_MODEL changes that default.
On Windows, the installer adds vortex to your user PATH. Open a new terminal after installing so it picks up the change.
Run flags
| Flag | Effect |
|---|---|
--prompt "…" | The job to run |
--prompt-file <path> | Read the job from a file instead |
--workspace <path> | Directory the agent edits and runs commands in |
--model <id> | Model for this run |
--provider <id> | Built-in provider, or any OpenAI-compatible provider you have saved |
--base-url <url> | OpenAI-compatible root, when that provider is not already saved |
--api-key <key> | Provider key for this run |
--job-dir <path> | Where job state and traces are written |
--verbose | More detail in the terminal output |
--detach | Start the job and return immediately |
--list | List known jobs and their status |
--automation-id <id> | Load that automation's prompt, workspace, and model |
API keys
Provide a key in one of these ways:
--api-keyon the command line.VORTEX_RUN_API_KEYforvortex run.VORTEX_REVIEW_API_KEYforvortex review.- The provider's own environment variable, such as
GEMINI_API_KEYorDASHSCOPE_API_KEY. ~/.vortex/provider-keys.json, the same file Settings writes, when none of the above is set.
OPENROUTER_API_KEY is also read when you route through OpenRouter. Do not commit keys to the repo. An environment variable or --api-key wins over the file.
Detached jobs
--detach starts the run and returns control to your shell. Status and traces are written under:
~/.vortex/detached/<id>/You can close the terminal and collect the result later. List the jobs you have started with:
vortex run --listA detached job only survives a closed laptop if it was started over SSH and kept alive on the remote with nohup. A job on a sleeping local machine stops when the machine sleeps.
Run health
vortex stats --since 7dvortex stats is a read-only summary of local runs. It prints counts and durations, never prompts or code:
- How runs ended: finished, stopped, or never finished and why. Runs with no model are labeled as backfill and stay in the counts.
- Steps and timing: steps per run, model time, time to first token, tool time, and cache hit rate. Timing says how many runs it covers.
- Quality: tool failures, edit misses, and completion-gate rejections by reason. The top tool-failure messages are listed with paths and numbers masked.
- Backend failures: failed model requests, grouped by reason.
- Recovery: each kind of recovery attempt, and how often it got the run moving again.
- Stop check: how often a text reply was treated as finished or still going, and the mean continue score.
- Sub-agents: how many ran, prompt size, tools per step, and time to first token.
- Tool arguments: how many were repaired, rejected, or left as sent.
--since accepts 7d or 12h and defaults to 30d. --format json prints the same report as JSON.
Reviewing a branch
vortex review diffs HEAD against a base branch and reviews the change with read-only agents on a cloud model. They read the code around each group of changed files, findings outside the diff are dropped, and a second agent tries to disprove each one that is left. It returns the findings with the tokens and cost they took:
vortex review --json --base main --fail-on error| Flag | Effect |
|---|---|
--base <branch> | Branch to diff against (default origin/HEAD, else main) |
--model <id> | Cloud model |
--provider <id> | Built-in provider, or any OpenAI-compatible provider you have saved |
--base-url <url> | OpenAI-compatible root, when that provider is not already saved |
--max-tokens <n> | Cap on the response of a one-shot review |
--format text or --format json | Output format; --json is short for the second |
--fail-on never, warning, or error | Lowest severity that fails the command (default error) |
--verbose | The review agents' step log, on stderr |
--pr <n>, --repo <owner/repo> | The pull request being reviewed |
--post | Publish the review to that pull request |
--include-unconfirmed | Also post findings the second agent could not confirm |
Repo rules as review rubric
vortex review reads the Code Review Rules section of your AGENTS.md and treats it as extra rubric on top of the default. A repository can therefore enforce its own rules without changing the CLI: ban unwrap() on library paths, require Result-returning helpers, or flag a new Tauri command that is not registered.
CI examples
A pull-request gate that fails the build on any error-severity finding:
vortex review --json --base main --fail-on errorA nightly job that runs detached and leaves its traces behind:
vortex run --detach --prompt "Update the lockfile and run the test suite" --workspace .Exit codes matter for CI. --fail-on sets the threshold, but you can also read the JSON output and apply your own gate: fail only on findings that touch files you own, or post the JSON as a review comment. Combine both rather than relying on a single threshold.
Beta surface
The CLI is a beta surface and changes between builds. Check the flags with the built-in help before you wire it into a pipeline, and pin a version in CI if the job must be stable.
Related
- GitHub pull requests: the same review in a PR tab, plus Fix with agent.
- SSH remote workspaces: run the same jobs against a remote directory.
- MCP integrations: the tools a headless run can call.
- Review mode: the same pending-patch model in the GUI.