Drive Maritime from an AI agent

The Maritime CLI is built to be operated by other AI agents, not just humans: machine-readable output on every command, stable exit codes, and a live self-describing contract. Paste one prompt into Claude, Cursor, or any assistant and it can install the CLI, authenticate, and deploy agents for you.

The prompt teaches your assistant the auth flow, the JSON contract, the common tasks, and the gotchas. It is kept in sync with the CLI.

The contract

  • Authenticate with an env var, never interactively. Mint a long-lived key (mk_…) with maritime keys create and export it as MARITIME_TOKEN. Keys never expire; browser-login tokens do.
  • Pass --json on every command. Success prints one JSON value to stdout (stderr empty); failure prints { ok: false, error: { code, message } } to stderr (stdout empty).
  • Branch on exit codes. 0 success, 1 generic error, 2 auth, 3 not found, 4 usage. Full table in the CLI reference.
  • Never guess flags. maritime guide --json emits a one-shot manifest of every command and flag, introspected live from the CLI itself, so it cannot drift.
  • Name resolution is forgiving. Anywhere a command takes an agent, the exact name or an ID prefix works; inside a linked directory the agent argument can be omitted entirely.

A session in six lines

export MARITIME_TOKEN=mk_xxxxxxxxxxxx

maritime whoami --json                                  # exit 2 = bad token
maritime templates --json                               # discover templates
maritime create runner --template openclaw --json
maritime chat runner "set up a daily digest of my repo" --json | jq -r '.response'
maritime logs runner --json

Agent-followable docs

The migration runbooks are written to be executed by a coding agent: point Claude Code or your Maritime agent at a provider's runbook page and it can inventory the old provider with read-only credentials, recreate each workload as a Maritime agent, and hand you a reversible cutover checklist.

Driving vs. building

This page is about an AI agent driving Maritime through the CLI. To build a product where every customer gets their own Maritime-hosted agent, use the SDK from your backend instead.