MantisDocs

CLI

Every shipmantis command, its flags and its exit codes.

npx shipmantis <command>

The CLI reads .env.local, then .env, from the folder you run it in. Every command except init and ci init needs MANTIS_URL and MANTIS_SECRET_KEY (which may be a secret, agent, or branch_only key).

init

npx shipmantis@latest init [--new <name> | --project <slug>] [--team <slug>]

Signs you in through the browser, picks or creates a project, writes its keys to .env.local, and sets the folder up for Claude Code, Codex, Cursor, Windsurf, Cline, and Antigravity. See the quickstart for every file it writes.

FlagWhat it does
--new <name>Create a project with this name instead of asking.
--project <slug>Use an existing project instead of asking.
--team <slug>The team to look in, when you belong to more than one.

On an existing project, init makes a new key pair for this machine; keys on other machines keep working. It talks to MANTIS_API_URL, which defaults to https://api.shipmantis.com.

push

npx shipmantis push [--schema <file>] [--dry-run] [--branch <name>]

Plans the schema against the branch, prints each step, then applies it. On main, a change that can lose data or let more people in waits for a person's approval.

FlagWhat it does
--schema <file>The schema file. Default: mantis/schema.ts.
--dry-runPrint the plan without applying it.
--branch <name>The branch. Default: MANTIS_BRANCH, else main.

branch

npx shipmantis branch list
npx shipmantis branch create <name> [--from <parent>]
npx shipmantis branch promote <name>
npx shipmantis branch reset <name> [--snapshot <id>]
npx shipmantis branch delete <name>

See Branches and Snapshots & reset. create copies main unless you pass --from. promote applies a branch's schema to its parent. reset re-clones a non-main branch from its parent, or restores --snapshot <id>.

snapshot

npx shipmantis snapshot list [--branch <name>]
npx shipmantis snapshot create <label> [--branch <name>]
npx shipmantis snapshot restore <id> [--branch <name>]

Create, list, and restore named point-in-time branch checkpoints. Defaults to MANTIS_BRANCH, else main. See Snapshots & reset.

activity

npx shipmantis activity [--limit <n>]

Prints recent agent and dashboard actions across the project (--limit between 1 and 100, default 50), including exact rewind --to timestamps. See Agent activity.

ci init

npx shipmantis ci init

Writes .github/workflows/mantis-preview.yml to provision per-PR preview branches (pr-<n>), post schema safety comments, and delete branches on PR close. See GitHub PR previews.

pr-check & pr-cleanup

npx shipmantis pr-check [--pr <num>] [--schema <file>] [--from <parent>] [--branch <name>] [--comment] [--json] [--fail-on-destructive]
npx shipmantis pr-cleanup [--pr <num>] [--branch <name>]

pr-check creates or resets pr-<num>, plans mantis/schema.ts against --from (default main), applies the schema to the preview branch, and prints or posts a Markdown safety report (--comment uses GITHUB_TOKEN and GITHUB_REPOSITORY). Pass --fail-on-destructive to exit with code 2 when any step would be held on main. pr-cleanup deletes pr-<num> when the PR closes. See GitHub PR previews.

rewind

npx shipmantis rewind --to <time> [--table <name> [--id <uuid>]] [--apply] [--branch <name>]

Shows what rewinding the branch, a table or a row to a time undoes; with --apply, does it. --to is a time with an offset, or 30m, 2h, 1d ago. On main the rewind waits for a person. See Rewind.

undo

npx shipmantis undo [--branch <name>]

Undoes the latest migration, bringing dropped data back. On main, an undo that can lose data waits for a person.

connect

npx shipmantis connect [--host <host:port>] [--branch <name>]

Prints the branch database as plain Postgres, for psql, a migration tool or any driver. --host (or MANTIS_DATABASE_HOST) names the server as your app sees it. The output holds the database password, so keep it out of git.

video

npx shipmantis video intro.mp4 --folder videos
npx shipmantis video ./out/intro --folder videos --id intro

Transcodes a video file with your ffmpeg into an HLS package and uploads it, or uploads a package directory you made already. It always uploads to main.

FlagWhat it does
--folder <name>The folder to store it in. Required.
--id <name>The video's name inside the folder. Default: a fresh uuid.
--out <dir>Keep the package here instead of a temporary directory.
--ffmpeg <path>The ffmpeg to run; MANTIS_FFMPEG does the same.

It prints the video's id, its playlist, its poster and, for a public folder, its link. See Upload videos.

mcp

npx shipmantis mcp

Serves the 19 MCP tools over stdio. Your agent starts it; you don't run it yourself.

Exit codes

CodeMeans
0Done.
1Refused or failed. The reason is printed.
2Waiting for a person's approval (or destructive changes found with pr-check --fail-on-destructive). The change's id is printed.

Code 2 lets a script or an agent tell a held change from a failure.

On this page