CLI Reference

The Maritime CLI lets you deploy and manage agents from your terminal.

Installs the CLI from npm, lists the available templates, creates an openclaw agent named cli-demo, checks its status, lists all agents, and sends it a first chat message. Recorded against production.

Installation

npm install -g maritime-cli

Requires Node.js 18 or later.

Authentication

maritime login

Authenticate with your Maritime account. Opens your browser for login by default, or pass credentials directly for non-interactive use. Sign in with Google or GitHub? You have no password, so use the browser flow, or paste a token from maritime.sh/cli/auth (ideal for headless servers, SSH sessions, and CI).

maritime login

# Non-interactive login (email/password accounts):
maritime login -e user@example.com -p yourpassword

# SSO / headless / CI: paste a token from https://maritime.sh/cli/auth
maritime login --token <token>
# ...or export it (equivalent, no stored config):
export MARITIME_TOKEN=<token>
FlagDescription
-e, --emailEmail address (skips browser login)
-p, --passwordPassword (skips browser login)
-t, --tokenPaste a token from maritime.sh/cli/auth. Works for any account, including Google/GitHub SSO. Same value as the MARITIME_TOKEN env var.

maritime signup

Create a new Maritime account. Prompts interactively for any fields not provided.

maritime signup -e user@example.com -p yourpassword -n "Jane Doe"

# Or just run and follow the prompts:
maritime signup
FlagDescription
-e, --emailEmail address
-p, --passwordPassword
-n, --nameDisplay name (optional)

maritime logout

Log out and clear stored credentials.

maritime logout

maritime whoami

Show the current authentication: the token source (MARITIME_TOKEN vs stored login), user, and expiry. Add --json for a machine-readable { authenticated, method, source, expiresAt } (exit code 2 when unauthenticated).

maritime whoami

maritime keys

Mint a long-lived API key (mk_…) for non-interactive use. Set it as MARITIME_TOKEN so an AI agent, script, or CI never runs an interactive login. Keys don't expire; revoke anytime.

# Mint a key (shown once, store it securely):
maritime keys create --name my-agent --json

# Limit what the key can do (default: provision,deploy,secrets; "manage" = all):
maritime keys create --name ci-deploy --scopes deploy

# Use it everywhere:
export MARITIME_TOKEN=mk_xxxxxxxxxxxx

# List / revoke:
maritime keys list
maritime keys revoke <id>
Mints a key scoped to deploys, lists your keys, exports the new key as MARITIME_TOKEN, and confirms the session with maritime whoami. No browser login involved. The key shown on screen was revoked right after recording.

Fleets & simulations

--count N turns one create into a fleet: N identical agents you can message individually or fan out to with jq | xargs. Ideal for agent-vs-agent simulations, load tests, or one-agent-per-customer batches. Full guide: Fleet operations.

Creates swarm-1 through swarm-3 with a single --count 3 call, lists the new fleet, messages swarm-2 (its reply greets the other members), then deletes all three agents in a shell loop.

Projects: a directory is an agent

Like vercel or railway, you can link a directory to an agent. After that, the agent argument is optional on every command; the CLI resolves the linked agent by walking up from the current folder. Two files: maritime.json (committed config: name, template, persona, env keys) and .maritime/ (the machine-local link, git-ignored).

maritime init support-bot     # scaffold maritime.json + AGENTS.md, create & link
maritime chat "what's open?"  # talks to support-bot, no name needed
maritime logs                 # support-bot's logs
maritime deploy               # reconcile the agent to maritime.json, then redeploy
maritime init scaffolds maritime.json and AGENTS.md, creates the agent, and links the directory. maritime chat then works without naming the agent, and maritime deploy pushes the edited persona to the running agent.

maritime init

Scaffold maritime.json + AGENTS.md, create the agent, and link this directory to it. Defaults the template to openclaw and the name to the folder.

maritime init                 # name from the folder
maritime init support-bot     # explicit name
maritime init bot --no-create # just write the config files

maritime link

Link this directory to an existing agent (interactive picker if no name is given). Re-run to change it.

maritime link support-bot
maritime link                 # pick from your agents

Agent Management

maritime create

Create a new agent. Just give it a name: the platform picks an applicable size for the framework, and the agent auto-sleeps when idle and wakes on the next message. No sizing required.

maritime create my-agent

# From a template (see maritime templates):
maritime create researcher --template openclaw

# With initial environment variables:
maritime create my-agent -e OPENAI_API_KEY=sk-... -e MY_VAR=hello

# From a GitHub repo (must contain a Dockerfile), served on a public URL:
maritime create my-app --repo https://github.com/you/app --public --port 3000
A 30-line Python server is deployed from a public GitHub repo with maritime create --repo --public. The app reads the injected PORT variable, and the clip ends with curl fetching JSON from the agent's public HTTPS URL. Source: github.com/mariagorskikh/maritime-hello-web.
Argument / flagDescription
<name>Agent name (positional)
-t, --templateTemplate to base the agent on (see maritime templates)
-e, --envEnvironment variables as KEY=value (repeatable)
-r, --repoDeploy from a GitHub repo (must contain a Dockerfile)
-b, --branchGit branch to deploy (with --repo)
--publicServe a public, no-login web URL for this agent (web apps)
--portPort your app listens on (exposed publicly; default 8080)
--countSpin up N identical agents in one call (fleet); see below

Fleets (--count)

Pass --count <n> (2-50) to spin up n identical agents in a single call; the name becomes the prefix (swarm-1swarm-5). Creating n agents requires n×$1 of available wallet balance up front; after that, compute meters only while each agent is awake. Exit code 0 means all created, 1 partial or none. The full walkthrough (spin up, watch live, fan out messages, tear down) is in Fleet operations.

maritime create swarm --template openclaw --count 5 --idle 3600 --json

Advanced: per-agent resource overrides. All optional; omit them and the agent gets the platform defaults. Useful for hand-tuning a single agent (e.g. a reseller dialing resources per client). Hidden from --help, but fully supported.

maritime create acme-bot --ram 2048 --cpu 1.5 --idle 600 --disk 20
maritime create always-up --always-on --max-compute 120
FlagDescription
--ramRAM in MB (per-agent override of the default)
--cpuvCPU cores, e.g. 0.5 or 2 (per-agent override)
--idleAuto-sleep N seconds after the last request
--always-onNever auto-sleep (mutually exclusive with --idle)
--diskWorkspace SSD in GB (clamped to your plan cap)
--max-computeHard cap: auto-sleep after N compute-minutes / billing period
--frameworkFramework when not using a template (default: custom)

maritime list

List all your agents with their status, framework, and creation date. Alias: maritime ls

maritime list

# Output:
# NAME            STATUS     FRAMEWORK    CREATED
# support-bot     active     openclaw     2026-04-12
# data-pipeline   sleeping   zeroclaw     2026-03-28
# code-reviewer   sleeping   openclaw     2026-05-01

maritime deploy

Deploy an agent. Accepts an agent name or ID prefix.

maritime deploy my-agent

# Deploy from a GitHub repo:
maritime deploy my-agent --source github --repo https://github.com/user/repo

# Deploy a specific Docker image:
maritime deploy my-agent --source docker --image myimage:latest
FlagDescription
--sourceDeploy source: template, github, or docker (default: template)
--repoGitHub repository URL
--imageDocker image name
--branchGit branch (for GitHub deploys)
-w, --waitBlock until the deployment completes (useful in scripts and CI)

maritime start / stop / restart

Manual lifecycle control, rarely needed. Serverless agents auto-sleep when idle and auto-wake on the next message or trigger; reach for these for ops or debugging. (Hidden from maritime --help, still fully supported.)

maritime start my-agent
maritime stop my-agent
maritime restart my-agent

maritime delete

Delete an agent. Prompts for confirmation unless -y is passed.

maritime delete my-agent

# Skip confirmation:
maritime delete my-agent -y

Talking to agents

maritime chat

Send a message to a running agent and print its reply. Reads the message from arguments or stdin (handy for long prompts). Sleeping serverless agents auto-wake. Alias: maritime send.

maritime chat my-agent "summarize today's incidents"

# Long prompt via stdin:
cat prompt.txt | maritime chat my-agent

# Multi-turn with a conversation id:
maritime chat my-agent "and the one before?" --conversation-id abc123

# Machine-readable (returns { response }):
maritime chat my-agent "hi" --json

Observability

The agent gets a task over maritime chat, maritime logs prints its timestamped lifecycle entries, and maritime info shows the full record: status, framework, image, env keys, and server placement.

maritime logs

View logs from an agent.

maritime logs my-agent

# Show last 100 lines:
maritime logs my-agent -n 100

# Filter by level:
maritime logs my-agent --level error

# Stream logs live:
maritime logs my-agent -f
FlagDescription
-n, --linesNumber of log lines to show (default: 50)
--levelFilter by level: info, warn, error, or debug
-f, --followFollow log output (stream new lines as they arrive)

maritime env

Manage environment variables for an agent.

# List variables:
maritime env list my-agent

# Set one or more (marked secret + encrypted by default):
maritime env set my-agent OPENAI_API_KEY=sk-... ANOTHER=value

# Bulk import from a .env file (or stdin), then hot-reload:
maritime env import my-agent ./prod.env --reload

# Set a non-secret variable:
maritime env set my-agent LOG_LEVEL=debug --no-secret

# Remove a variable:
maritime env remove my-agent LOG_LEVEL

# Apply pending changes to a running agent without a full restart:
maritime env reload my-agent

# Pull the agent's env into a local .env file (secret values are masked):
maritime env pull my-agent .env

Env changes apply on the next container boot unless you pass --reload (or run maritime env reload).

Sets STRIPE_API_KEY as an encrypted secret and LOG_LEVEL as plain text, lists both (the secret stays masked), pulls them into a local .env file, then removes the secret.

maritime status

Show detailed status for a single agent: health, last activity, container ID, host, and deployment state.

maritime status my-agent

maritime info

Print full metadata for an agent (env keys, framework, image, exposed ports, server placement).

maritime info my-agent

maritime history

Show deployment history for an agent: every build/deploy attempt with its outcome.

maritime history my-agent

# Show last 30 deployments:
maritime history my-agent -n 30

maritime triggers

List the cron/webhook/email/telegram/discord triggers wired to an agent.

maritime triggers my-agent

Lifecycle

maritime sleep

Put an active agent to sleep. Sleeping agents pause compute billing and auto-wake on triggers.

maritime sleep my-agent
maritime sleep pauses the agent and its compute billing, maritime list shows it sleeping, and the next chat message wakes it from a VM snapshot. The lifecycle logs time the wake at 839 milliseconds.

maritime open

Open the agent's dashboard page in your default browser.

maritime open my-agent

Templates

A template packages an agent (DB metadata + env-var keys + sanitized triggers + optional volume snapshot) so it can be cloned. The CLI command keeps the original name: maritime blueprint, alias maritime bp.

maritime blueprint list

maritime blueprint list

maritime blueprint create

Create a template from a sleeping or stopped agent.

maritime blueprint create my-agent --name "Support Bot v2" --visibility unlisted

# --visibility: private | unlisted | public (default: private)

maritime blueprint deploy

Clone a template into a new agent.

maritime blueprint deploy support-bot-v2 --name my-support-bot

Discovery

maritime templates

List available agent templates. This command does not require authentication.

maritime templates

maritime guide

Print the machine-readable usage guide for driving the CLI from code or an AI agent. --json emits a one-shot manifest of every command, flag, and the contract, introspected live so it can't drift.

maritime guide          # human-readable contract
maritime guide --json   # full command/flag manifest

Scripting & AI agents

The CLI is built to be driven non-interactively. Authenticate with the MARITIME_TOKEN env var (an mk_… key from maritime keys create), pass --json on every command, and branch on the exit code.

With --json: success prints one JSON value to stdout (stderr empty); failure prints one JSON object { ok: false, error: { code, message } } to stderr (stdout empty).

export MARITIME_TOKEN=mk_xxxxxxxxxxxx

# results on stdout, errors on stderr, branch on exit code:
maritime list --json | jq '.[] | select(.status=="error") | .name'

reply=$(maritime chat my-agent "status?" --json | jq -r '.response')
Exit codeMeaning
0success
1generic error (request / server / network)
2auth (no token / expired / wrong)
3not found (no such agent)
4usage (missing / invalid arguments)

Agent name resolution

Any command that takes an <agent> argument accepts the full agent name or an ID prefix, matched by exact name first and then by ID prefix. If you omit it inside a linked directory, the CLI uses the linked agent.