CLI Reference
The Maritime CLI lets you deploy and manage agents from your terminal.
Installation
npm install -g maritime-cliRequires 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>| Flag | Description |
|---|---|
| -e, --email | Email address (skips browser login) |
| -p, --password | Password (skips browser login) |
| -t, --token | Paste 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| Flag | Description |
|---|---|
| -e, --email | Email address |
| -p, --password | Password |
| -n, --name | Display name (optional) |
maritime logout
Log out and clear stored credentials.
maritime logoutmaritime 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 whoamimaritime 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>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.
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 redeploymaritime 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 filesmaritime 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 agentsAgent 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| Argument / flag | Description |
|---|---|
| <name> | Agent name (positional) |
| -t, --template | Template to base the agent on (see maritime templates) |
| -e, --env | Environment variables as KEY=value (repeatable) |
| -r, --repo | Deploy from a GitHub repo (must contain a Dockerfile) |
| -b, --branch | Git branch to deploy (with --repo) |
| --public | Serve a public, no-login web URL for this agent (web apps) |
| --port | Port your app listens on (exposed publicly; default 8080) |
| --count | Spin 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-1 … swarm-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 --jsonAdvanced: 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| Flag | Description |
|---|---|
| --ram | RAM in MB (per-agent override of the default) |
| --cpu | vCPU cores, e.g. 0.5 or 2 (per-agent override) |
| --idle | Auto-sleep N seconds after the last request |
| --always-on | Never auto-sleep (mutually exclusive with --idle) |
| --disk | Workspace SSD in GB (clamped to your plan cap) |
| --max-compute | Hard cap: auto-sleep after N compute-minutes / billing period |
| --framework | Framework 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-01maritime 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| Flag | Description |
|---|---|
| --source | Deploy source: template, github, or docker (default: template) |
| --repo | GitHub repository URL |
| --image | Docker image name |
| --branch | Git branch (for GitHub deploys) |
| -w, --wait | Block 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-agentmaritime delete
Delete an agent. Prompts for confirmation unless -y is passed.
maritime delete my-agent
# Skip confirmation:
maritime delete my-agent -yTalking 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" --jsonObservability
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| Flag | Description |
|---|---|
| -n, --lines | Number of log lines to show (default: 50) |
| --level | Filter by level: info, warn, error, or debug |
| -f, --follow | Follow 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 .envEnv changes apply on the next container boot unless you pass --reload (or run maritime env reload).
maritime status
Show detailed status for a single agent: health, last activity, container ID, host, and deployment state.
maritime status my-agentmaritime info
Print full metadata for an agent (env keys, framework, image, exposed ports, server placement).
maritime info my-agentmaritime 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 30maritime triggers
List the cron/webhook/email/telegram/discord triggers wired to an agent.
maritime triggers my-agentLifecycle
maritime sleep
Put an active agent to sleep. Sleeping agents pause compute billing and auto-wake on triggers.
maritime sleep my-agentmaritime open
Open the agent's dashboard page in your default browser.
maritime open my-agentTemplates
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 listmaritime 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-botDiscovery
maritime templates
List available agent templates. This command does not require authentication.
maritime templatesmaritime 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 manifestScripting & 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 code | Meaning |
|---|---|
| 0 | success |
| 1 | generic error (request / server / network) |
| 2 | auth (no token / expired / wrong) |
| 3 | not found (no such agent) |
| 4 | usage (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.