maritime-cli 1.6.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- # Maritime CLI — machine interface
1
+ # Maritime CLI · machine interface
2
2
 
3
3
  This document is the contract for driving the `maritime` CLI from a program or
4
4
  an AI agent (not a human at a keyboard). It is safe to paste into an agent's
@@ -23,7 +23,7 @@ which expires. Mint one once as a human:
23
23
  ```bash
24
24
  maritime login # human, one time
25
25
  maritime keys create --name my-agent --json
26
- # → { "key": "mk_...", ... } (shown ONCE — store it)
26
+ # → { "key": "mk_...", ... } (shown ONCE, store it)
27
27
  ```
28
28
 
29
29
  Then give the agent only the key:
@@ -34,7 +34,7 @@ export MARITIME_TOKEN=mk_xxxxxxxxxxxxxxxxxxxxxxxx
34
34
 
35
35
  `mk_` keys do not expire. Rotate with `maritime keys list` / `maritime keys revoke <id>`.
36
36
 
37
- ## Output contract — always pass `--json`
37
+ ## Output contract: always pass `--json`
38
38
 
39
39
  With `--json`, every command obeys a strict contract:
40
40
 
@@ -50,6 +50,16 @@ The failure object is:
50
50
  { "ok": false, "error": { "code": "not_authenticated", "message": "…", "status": 401 } }
51
51
  ```
52
52
 
53
+ `error.code` is the backend's own code whenever it sent one (for example
54
+ `seat_limit` on a billing refusal), otherwise a generic code derived from the
55
+ HTTP status. `error.message` is always the backend's message verbatim.
56
+
57
+ `email_not_verified` (status 403) means the account has not clicked the link
58
+ in its verification email. Deploy, start, restart, key creation and computer
59
+ creation are refused until it does. `error.message` names the address and
60
+ the fix. A human runs `maritime login --resend` to get the link again; the
61
+ token in hand works for everything after the click.
62
+
53
63
  Always read stdout for results and branch on the exit code. Never parse human text.
54
64
 
55
65
  ### Exit codes
@@ -62,15 +72,15 @@ Always read stdout for results and branch on the exit code. Never parse human te
62
72
  | `3` | not found (no such agent) |
63
73
  | `4` | usage error (missing/invalid arguments) |
64
74
 
65
- ## The project model — a directory is an agent
75
+ ## The project model: a directory is an agent
66
76
 
67
77
  Like `vercel` / `railway`, you can link a directory to an agent and then run
68
78
  commands without naming it. Two files:
69
79
 
70
- - **`maritime.json`** — committed config describing the agent: `name`,
80
+ - **`maritime.json`**: committed config describing the agent: `name`,
71
81
  `template` (or `framework`), persona `instructions`, env `["KEY", …]` (keys
72
- only), optional `tier`. The source of truth.
73
- - **`.maritime/project.json`** — machine-local link (git-ignored) pointing at
82
+ only). The source of truth.
83
+ - **`.maritime/project.json`**: machine-local link (git-ignored) pointing at
74
84
  the agent this directory operates on.
75
85
 
76
86
  ```bash
@@ -79,7 +89,7 @@ maritime link <agent> --json # link this dir to an existing agent
79
89
  maritime deploy --json # reconcile the agent to maritime.json, then ship
80
90
  ```
81
91
 
82
- Once linked, the `<agent>` argument is **optional on every command** — it falls
92
+ Once linked, the `<agent>` argument is **optional on every command**. It falls
83
93
  back to the linked agent (resolved by walking up from the cwd):
84
94
 
85
95
  ```bash
@@ -94,7 +104,7 @@ For automation you can ignore linking entirely and pass `<agent>` on every call
94
104
  explicitly: `-a/--agent` on `chat`, or the positional name on commands that take
95
105
  a single agent.
96
106
 
97
- ## The interaction primitive — `chat`
107
+ ## The interaction primitive: `chat`
98
108
 
99
109
  Send a message to a deployed agent and get its reply. Sleeping serverless
100
110
  agents are auto-woken by the backend.
@@ -113,7 +123,7 @@ cat prompt.txt | maritime chat <agent> --json
113
123
  maritime chat <agent> "and the one before that?" --conversation-id abc123 --json
114
124
  ```
115
125
 
116
- `<agent>` is a name (exact match), an ID prefix, or — omitted — the linked agent.
126
+ `<agent>` is a name (exact match), an ID prefix, or (omitted) the linked agent.
117
127
 
118
128
  Success shape:
119
129
 
@@ -123,7 +133,7 @@ Success shape:
123
133
 
124
134
  Without `--json`, `chat` prints only the reply text on stdout (clean for piping).
125
135
 
126
- ### Messaging AS an end-user — `message`
136
+ ### Messaging AS an end-user: `message`
127
137
 
128
138
  `chat` targets one agent; `message` routes by YOUR end-user id through the
129
139
  agent's project front door: the same `--user` always reaches the same
@@ -136,7 +146,7 @@ maritime message <agent> --user cust_42 --wait 0 "hi" --json # ack now; reply
136
146
  ```
137
147
 
138
148
  `status:"replied"` carries `.reply` inline; `"provisioning"`/`"queued"` means
139
- the user's agent is still booting — poll the message id or subscribe to the
149
+ the user's agent is still booting. Poll the message id or subscribe to the
140
150
  `message.reply` webhook (`POST /api/v1/webhooks`).
141
151
 
142
152
  ## Sizing (optional)
@@ -146,32 +156,31 @@ framework, and the agent auto-sleeps when idle and wakes on the next `chat`.
146
156
 
147
157
  For hand-tuning one agent (e.g. a reseller dialing resources per client), `create`
148
158
  accepts optional per-agent overrides. They're hidden from `--help` but fully
149
- supported; omitted flags inherit the tier default.
159
+ supported; omitted flags get the platform defaults.
150
160
 
151
161
  ```bash
152
162
  maritime create my-agent \
153
163
  --ram 2048 \ # RAM in MB
154
164
  --cpu 1.5 \ # vCPU cores (fractional OK)
155
165
  --idle 600 \ # auto-sleep 600s after the last request
156
- --disk 20 \ # workspace SSD in GB (clamped to the plan cap)
157
- --max-compute 120 # hard cap: sleep after 120 compute-min / billing period
166
+ --disk 20 # workspace SSD in GB
158
167
  # …or keep it resident:
159
168
  maritime create my-agent --always-on # never auto-sleep (mutually exclusive with --idle)
160
169
  ```
161
170
 
162
- `--idle`/`--always-on` control how long the agent stays up after a request —
163
- this overrides the platform's default serverless idle cap, so an orchestrator
171
+ `--idle`/`--always-on` control how long the agent stays up after a request.
172
+ This overrides the platform's default serverless idle cap, so an orchestrator
164
173
  that dispatches a long job and waits for a webhook won't be slept out from under
165
- the wait. `--disk` and `--max-compute` are per-agent overrides on top of the
166
- owner's account plan (disk is clamped to the plan's storage cap; the compute cap
167
- auto-sleeps the agent for the rest of the billing period when hit).
174
+ the wait. Every agent includes 2 GB RAM and 5 GB SSD; `--ram` above 2048,
175
+ `--disk` above 5, and `--always-on` are paid add-ons, so on the free plan they
176
+ come back as a `402` telling you to upgrade (see Billing refusals below).
168
177
  `status <agent> --json` echoes `memMb`, `vcpus`, `idleTtlSeconds`
169
- (`0` = always-on, `null` = inherits tier), `diskMb`, and `computeMinutesLimit`.
178
+ (`0` = always-on, `null` = platform default) and `diskMb`.
170
179
 
171
- ## Fleets — `create --count`
180
+ ## Batches: `create --count`
172
181
 
173
- `maritime create <name> --count <n>` (n = 2–50) spins up **n identical agents**
174
- in a single call. `<name>` becomes the prefix — agents are named
182
+ `maritime create <name> --count <n>` (n = 2-50) spins up **n identical agents**
183
+ in a single call. `<name>` becomes the prefix, so agents are named
175
184
  `<name>-1` … `<name>-n`. `--count 1` (the default) is the classic single-agent
176
185
  path, unchanged.
177
186
 
@@ -179,13 +188,13 @@ path, unchanged.
179
188
  maritime create swarm --template openclaw --count 5 --idle 3600 --json
180
189
  ```
181
190
 
182
- Flags supported alongside `--count > 1`: `--template`, `--tier`,
191
+ Flags supported alongside `--count > 1`: `--template`,
183
192
  `--idle`/`--always-on`, `--repo`, and `-e/--env` (applied to every agent).
184
- In the fleet path `--idle 0` means always-on (same as `--always-on`).
193
+ In the batch path `--idle 0` means always-on (same as `--always-on`).
185
194
  Any other `create` flag (`--branch`, `--public`, `--port`, `--framework`,
186
- `--ram`, `--cpu`, `--disk`, `--max-compute`) combined with `--count > 1` is a
187
- usage error (exit `4`) — nothing is silently dropped. `--count` above 50 is
188
- also exit `4`; the 50-agent cap is enforced server-side too.
195
+ `--ram`, `--cpu`, `--disk`) combined with `--count > 1` is a usage error
196
+ (exit `4`); nothing is silently dropped. `--count` above 50 is also exit `4`;
197
+ the 50-agent cap is enforced server-side too.
189
198
 
190
199
  Success shape (`--json`, the backend response verbatim):
191
200
 
@@ -193,25 +202,45 @@ Success shape (`--json`, the backend response verbatim):
193
202
  {
194
203
  "created": [{ "id": "…", "name": "swarm-1", "status": "deploying" }],
195
204
  "failed": [{ "name": "swarm-3", "error": "…" }],
196
- "requested": 5,
197
- "monthlyCostCents": 500
205
+ "requested": 5
198
206
  }
199
207
  ```
200
208
 
201
209
  Exit codes: `0` = **all** requested agents created (`failed` empty);
202
- `1` = partial or none — inspect `created`/`failed` on stdout. Billing/limit
210
+ `1` = partial or none, so inspect `created`/`failed` on stdout. Limit
203
211
  rejections surface as the standard error object on stderr with exit `1`:
204
- `402` → `error.code = "insufficient_balance"` (each agent bills $1/mo from the
205
- wallet; n agents need n×$1 available), `403` → `error.code =
206
- "fleet_cap_exceeded"`.
212
+ `402` → `error.code = "seat_limit"` (your plan's agent cap; see Billing
213
+ refusals below), `403` → `error.code = "fleet_cap_exceeded"` (the 50-agent
214
+ per-call cap).
207
215
 
208
216
  ```bash
209
- # Recipe: spin up a 5-agent fleet, then fan a message out to every member
217
+ # Recipe: spin up 5 agents, then fan a message out to every one of them
210
218
  maritime create swarm --template openclaw --count 5 --idle 3600 --json \
211
219
  | jq -r '.created[].name' \
212
220
  | xargs -I{} maritime chat {} "introduce yourself" --json
213
221
  ```
214
222
 
223
+ ## Billing refusals (`402`)
224
+
225
+ Your plan sets how many agents you may have (the free plan includes 3) and
226
+ whether you can use the paid add-ons (extra RAM, extra SSD, always-on). When a
227
+ create is refused for a billing reason, the CLI exits `1` and writes the
228
+ standard error object with `error.status = 402` and the server's own
229
+ `error.code`, usually `"seat_limit"`.
230
+
231
+ **`error.message` is the server's sentence, verbatim.** It already names the
232
+ fix and carries the link, for example:
233
+
234
+ ```json
235
+ { "ok": false, "error": { "code": "seat_limit", "status": 402,
236
+ "message": "You are on the free plan, which includes 3 agents (you have 3). Delete an agent you no longer need, or upgrade to a paid plan to create more: https://maritime.sh/billing" } }
237
+ ```
238
+
239
+ Show that message to your user unchanged rather than writing your own reason:
240
+ the same code covers several distinct gates (plan agent cap, add-ons needing a
241
+ paid plan, a lapsed plan, an identity agent needing your own `INKBOX_API_KEY`)
242
+ and only the message tells them which one they hit.
243
+
215
244
  ## Environment variables
216
245
 
217
246
  Values are secret (encrypted) by default. Env changes apply on the next
@@ -245,8 +274,8 @@ Config: `env {set,import,list,remove,reload,pull}`
245
274
  Observe: `status`, `logs`
246
275
 
247
276
  Advanced / ops (hidden from `--help`, still fully supported): `start`, `stop`,
248
- `restart`, `sleep`, `scale <tier>`, `exec <agent> <cmd...>`, `info`, `history`,
249
- `triggers`, `blueprint`, `templates`. You rarely need these — lifecycle is
277
+ `restart`, `sleep`, `exec <agent> <cmd...>`, `info`, `history`,
278
+ `triggers`, `templates`. You rarely need these: lifecycle is
250
279
  automatic (idle-sleep + auto-wake on `chat`).
251
280
 
252
281
  Run `maritime <cmd> --help` for flags. Every command accepts the global
package/dist/api.d.ts CHANGED
@@ -2,7 +2,11 @@ type JsonRecord = Record<string, unknown>;
2
2
  export declare class CliHttpError extends Error {
3
3
  status: number;
4
4
  detail: string;
5
- constructor(status: number, detail: string);
5
+ /** Machine-readable error code from the server when present, e.g.
6
+ * 'seat_limit' when the account hit its plan's agent cap, needs a paid
7
+ * plan for an add-on, or has a lapsed plan. */
8
+ code?: string;
9
+ constructor(status: number, detail: string, code?: string);
6
10
  }
7
11
  export interface CliUser {
8
12
  id: string;
package/dist/api.js CHANGED
@@ -4,10 +4,15 @@ import { fail, EXIT } from './output.js';
4
4
  export class CliHttpError extends Error {
5
5
  status;
6
6
  detail;
7
- constructor(status, detail) {
7
+ /** Machine-readable error code from the server when present, e.g.
8
+ * 'seat_limit' when the account hit its plan's agent cap, needs a paid
9
+ * plan for an add-on, or has a lapsed plan. */
10
+ code;
11
+ constructor(status, detail, code) {
8
12
  super(detail);
9
13
  this.status = status;
10
14
  this.detail = detail;
15
+ this.code = code;
11
16
  }
12
17
  }
13
18
  function isErrorWithMessage(error) {
@@ -77,7 +82,7 @@ async function maybeRefreshToken(token) {
77
82
  }
78
83
  }
79
84
  catch {
80
- // Refresh failed silently — continue with current token
85
+ // Refresh failed silently, continue with current token
81
86
  }
82
87
  return token;
83
88
  }
@@ -138,7 +143,8 @@ async function handleResponse(response) {
138
143
  const detail = typeof payload.detail === 'string'
139
144
  ? payload.detail
140
145
  : `Request failed with status ${response.status}`;
141
- throw new CliHttpError(response.status, detail);
146
+ const code = typeof payload.code === 'string' ? payload.code : undefined;
147
+ throw new CliHttpError(response.status, detail, code);
142
148
  }
143
149
  return payload;
144
150
  }
@@ -3,11 +3,7 @@ import chalk from 'chalk';
3
3
  import { authGet, authPost, CliHttpError } from '../api.js';
4
4
  import { promptForValue } from '../prompt.js';
5
5
  import { isJsonMode, outputResult, fail, handleError, makeSpinner, EXIT } from '../output.js';
6
- const FLEET_CAP = 50;
7
- /** Format integer cents as a dollar string ($5 or $7.50). */
8
- function formatDollars(cents) {
9
- return cents % 100 === 0 ? `$${cents / 100}` : `$${(cents / 100).toFixed(2)}`;
10
- }
6
+ const BATCH_CAP = 50;
11
7
  function parseEnvPairs(pairs) {
12
8
  return pairs.map((pair) => {
13
9
  const eqIdx = pair.indexOf('=');
@@ -29,36 +25,34 @@ export const createCommand = new Command('create')
29
25
  .argument('[name]', 'Agent name')
30
26
  .option('-t, --template <template>', 'Template to base the agent on (see `maritime templates`)')
31
27
  .option('-e, --env <pairs...>', 'Environment variables (KEY=value)')
32
- .option('--count <n>', 'Spin up N identical agents in one call (fleet) — names become <name>-1..<name>-N')
28
+ .option('--count <n>', 'Spin up N identical agents in one call. Names become <name>-1..<name>-N')
33
29
  .option('-r, --repo <url>', 'Deploy from a GitHub repo (must contain a Dockerfile)')
34
30
  .option('-b, --branch <branch>', 'Git branch to deploy (with --repo)')
35
31
  .option('--public', 'Serve a public, no-login web URL for this agent (web apps)')
36
32
  .option('--port <n>', 'Port your app listens on (exposed publicly; default 8080)')
37
- // Advanced overrides — kept fully working but off the main --help so the
33
+ // Advanced overrides, kept fully working but off the main --help so the
38
34
  // happy path stays flag-free. By default the platform picks the applicable
39
35
  // size for the framework and auto-sleeps when idle; you only reach for these
40
36
  // to hand-tune a specific agent (e.g. a reseller dialing RAM per client).
41
37
  .addOption(new Option('-n, --name <name>', 'Agent name (alias for the positional argument)').hideHelp())
42
38
  .addOption(new Option('--framework <framework>', 'Framework (default: custom)').hideHelp())
43
- .addOption(new Option('--tier <tier>', 'Tier (smart, extended, always_on)').hideHelp())
44
- .addOption(new Option('--ram <mb>', 'RAM in MB (per-agent override of the tier default)').hideHelp())
39
+ .addOption(new Option('--ram <mb>', 'RAM in MB (2048 included; above that is a paid add-on)').hideHelp())
45
40
  .addOption(new Option('--cpu <cores>', 'vCPU cores, e.g. 0.5 or 2 (per-agent override)').hideHelp())
46
41
  .addOption(new Option('--idle <seconds>', 'Auto-sleep this many seconds after the last request').hideHelp())
47
- .addOption(new Option('--always-on', 'Never auto-sleep (mutually exclusive with --idle)').hideHelp())
48
- .addOption(new Option('--disk <gb>', 'Workspace SSD size in GB (per-agent override)').hideHelp())
49
- .addOption(new Option('--max-compute <minutes>', 'Hard cap: auto-sleep after N compute-minutes per billing period').hideHelp())
42
+ .addOption(new Option('--always-on', 'Never auto-sleep (a paid add-on; mutually exclusive with --idle)').hideHelp())
43
+ .addOption(new Option('--disk <gb>', 'Workspace SSD size in GB (5 included; above that is a paid add-on)').hideHelp())
50
44
  .addHelpText('after', `
51
45
  Examples:
52
46
  maritime create researcher
53
47
  maritime create acme-bot --template openclaw --json
54
48
  maritime create my-app --repo https://github.com/you/app --public # public web agent
55
49
  maritime create client-x -e OPENAI_API_KEY=sk-...
56
- maritime create swarm --template openclaw --count 5 # fleet: swarm-1..swarm-5`)
50
+ maritime create swarm --template openclaw --count 5 # swarm-1..swarm-5`)
57
51
  .action(async (nameArg, opts) => {
58
52
  try {
59
53
  let name = nameArg || opts.name;
60
54
  let templateId = opts.template;
61
- // --count: fleet spin-up. 1 (default) = the classic single-agent path.
55
+ // --count: batch spin-up. 1 (default) = the classic single-agent path.
62
56
  let count = 1;
63
57
  if (opts.count !== undefined) {
64
58
  const n = Number(opts.count);
@@ -68,8 +62,8 @@ Examples:
68
62
  exitCode: EXIT.USAGE,
69
63
  });
70
64
  }
71
- if (n > FLEET_CAP) {
72
- fail('Fleet spin-ups are capped at 50 agents. Contact us if you need more — we keep the cap to protect shared server capacity.', { code: 'usage', exitCode: EXIT.USAGE });
65
+ if (n > BATCH_CAP) {
66
+ fail('Batch creates are capped at 50 agents. Contact us if you need more. We keep the cap to protect shared server capacity.', { code: 'usage', exitCode: EXIT.USAGE });
73
67
  }
74
68
  count = n;
75
69
  }
@@ -94,7 +88,7 @@ Examples:
94
88
  if (templates.length > 0) {
95
89
  console.log(chalk.dim('\nAvailable templates:'));
96
90
  templates.forEach((t, i) => {
97
- console.log(` ${chalk.bold(String(i + 1))}. ${t.name} (${t.framework})${t.description ? ' — ' + t.description : ''}`);
91
+ console.log(` ${chalk.bold(String(i + 1))}. ${t.name} (${t.framework})${t.description ? ' · ' + t.description : ''}`);
98
92
  });
99
93
  console.log();
100
94
  const choice = await promptForValue('Template number (or press Enter to skip)');
@@ -108,10 +102,10 @@ Examples:
108
102
  // Templates fetch failed; continue without template
109
103
  }
110
104
  }
111
- // ── Fleet path (--count > 1): one POST /api/fleet/batch call ──
105
+ // ── Batch path (--count > 1): one POST /api/fleet/batch call ──
112
106
  if (count > 1) {
113
107
  // The batch endpoint only understands a subset of create's flags.
114
- // Anything it can't honor is a hard usage error — never silently dropped.
108
+ // Anything it can't honor is a hard usage error, never silently dropped.
115
109
  const unsupported = [];
116
110
  if (opts.branch !== undefined)
117
111
  unsupported.push('--branch');
@@ -127,11 +121,9 @@ Examples:
127
121
  unsupported.push('--cpu');
128
122
  if (opts.disk !== undefined)
129
123
  unsupported.push('--disk');
130
- if (opts.maxCompute !== undefined)
131
- unsupported.push('--max-compute');
132
124
  if (unsupported.length > 0) {
133
125
  fail(`${unsupported.join(', ')} cannot be combined with --count > 1. ` +
134
- 'Fleet spin-ups support --template, --tier, --idle/--always-on, --repo, and -e/--env.', { code: 'usage', exitCode: EXIT.USAGE });
126
+ 'Batch creates support --template, --idle/--always-on, --repo, and -e/--env.', { code: 'usage', exitCode: EXIT.USAGE });
135
127
  }
136
128
  if (opts.alwaysOn && opts.idle !== undefined) {
137
129
  fail('--always-on and --idle are mutually exclusive.', { code: 'usage', exitCode: EXIT.USAGE });
@@ -139,8 +131,6 @@ Examples:
139
131
  const batchBody = { namePrefix: name, count };
140
132
  if (templateId)
141
133
  batchBody.templateId = templateId;
142
- if (opts.tier)
143
- batchBody.tier = opts.tier;
144
134
  if (opts.repo)
145
135
  batchBody.githubRepo = opts.repo;
146
136
  if (opts.env)
@@ -158,19 +148,21 @@ Examples:
158
148
  }
159
149
  batchBody.idleTtlSeconds = secs; // 0 = always-on
160
150
  }
161
- const spinner = await makeSpinner(`Creating fleet ${chalk.bold(name)} × ${count}...`);
151
+ const spinner = await makeSpinner(`Creating ${chalk.bold(name)} × ${count}...`);
162
152
  let result;
163
153
  try {
164
154
  result = await authPost('/api/fleet/batch', batchBody);
165
155
  }
166
156
  catch (error) {
167
- spinner.fail('Failed to create fleet');
157
+ spinner.fail('Failed to create agents');
168
158
  if (error instanceof CliHttpError && (error.status === 402 || error.status === 403)) {
169
- // 402 = wallet can't cover count × $1/mo; 403 = server-enforced cap.
170
- // Both are request failures, not auth failures → exit 1.
159
+ // 402 = the plan's agent cap (code seat_limit); the server's detail
160
+ // is already a complete sentence naming the fix and the billing
161
+ // link, so print it verbatim. 403 = the server-enforced batch cap.
162
+ // Both are request failures, not auth failures, so exit 1.
171
163
  fail(error.detail, {
172
164
  status: error.status,
173
- code: error.status === 402 ? 'insufficient_balance' : 'fleet_cap_exceeded',
165
+ code: error.code ?? (error.status === 402 ? 'seat_limit' : 'fleet_cap_exceeded'),
174
166
  exitCode: EXIT.ERROR,
175
167
  });
176
168
  }
@@ -202,10 +194,7 @@ Examples:
202
194
  console.log(' ' + chalk.bold(f.name.padEnd(24)) + chalk.red(f.error));
203
195
  }
204
196
  }
205
- console.log('\n ' +
206
- `${result.created.length}/${result.requested} created` +
207
- chalk.dim(' · ') +
208
- `${formatDollars(result.monthlyCostCents)}/mo`);
197
+ console.log('\n ' + `${result.created.length}/${result.requested} created`);
209
198
  console.log();
210
199
  });
211
200
  // Exit contract: 0 = all created, 1 = partial or none.
@@ -218,12 +207,16 @@ Examples:
218
207
  body.templateId = templateId;
219
208
  if (opts.framework)
220
209
  body.framework = opts.framework;
221
- if (opts.tier)
222
- body.tier = opts.tier;
223
210
  if (opts.env)
224
211
  body.initialEnvVars = parseEnvPairs(opts.env);
225
- if (opts.repo)
212
+ if (opts.repo) {
226
213
  body.githubRepo = opts.repo;
214
+ // Source builds need a chance to identify their runtime before boot.
215
+ // This preserves an explicit framework or template, while allowing an
216
+ // OpenClaw repository to receive its required gateway credential.
217
+ if (!templateId && !opts.framework)
218
+ body.framework = 'auto';
219
+ }
227
220
  if (opts.branch)
228
221
  body.branch = opts.branch;
229
222
  if (opts.public) {
@@ -236,7 +229,7 @@ Examples:
236
229
  body.exposedPort = Number(opts.port);
237
230
  else if (opts.public)
238
231
  body.exposedPort = 8080;
239
- // Per-agent resource overrides (serverless). Omitted fields inherit the tier.
232
+ // Per-agent resource overrides (serverless). Omitted fields inherit the defaults.
240
233
  if (opts.alwaysOn && opts.idle !== undefined) {
241
234
  fail('--always-on and --idle are mutually exclusive.', { code: 'usage', exitCode: 4 });
242
235
  }
@@ -271,13 +264,6 @@ Examples:
271
264
  }
272
265
  body.diskGb = gb;
273
266
  }
274
- if (opts.maxCompute !== undefined) {
275
- const mins = Number(opts.maxCompute);
276
- if (!Number.isFinite(mins) || mins <= 0) {
277
- fail('--max-compute must be a positive number of minutes.', { code: 'usage', exitCode: 4 });
278
- }
279
- body.computeMinutesLimit = mins;
280
- }
281
267
  const spinner = await makeSpinner(`Creating agent ${chalk.bold(name)}...`);
282
268
  let agent;
283
269
  try {
@@ -285,11 +271,23 @@ Examples:
285
271
  }
286
272
  catch (error) {
287
273
  spinner.fail('Failed to create agent');
274
+ if (error instanceof CliHttpError && error.status === 402) {
275
+ // Billing gate, not a crash. The server's detail is already a
276
+ // complete user-ready sentence naming the fix (e.g. the free plan
277
+ // includes 3 agents: delete one or upgrade) and carrying
278
+ // https://maritime.sh/billing, so print it verbatim rather than
279
+ // guessing at a reason here.
280
+ fail(error.detail, {
281
+ status: 402,
282
+ code: error.code ?? 'payment_required',
283
+ exitCode: EXIT.ERROR,
284
+ });
285
+ }
288
286
  throw error;
289
287
  }
290
288
  spinner.succeed(chalk.green('Created ') + chalk.bold(agent.name) + chalk.dim(` (${agent.id})`));
291
289
  outputResult({ ok: true, action: 'create', ...agent }, () => {
292
- console.log(chalk.dim(` Framework: ${agent.framework} | Tier: ${agent.tier} | Status: ${agent.status}`));
290
+ console.log(chalk.dim(` Framework: ${agent.framework} | Status: ${agent.status}`));
293
291
  const res = [];
294
292
  if (agent.memMb)
295
293
  res.push(`RAM ${agent.memMb}MB`);
@@ -300,8 +298,6 @@ Examples:
300
298
  }
301
299
  if (agent.diskMb)
302
300
  res.push(`disk ${(agent.diskMb / 1024).toFixed(1)}GB`);
303
- if (agent.computeMinutesLimit)
304
- res.push(`cap ${agent.computeMinutesLimit}min`);
305
301
  if (res.length)
306
302
  console.log(chalk.dim(` Resources: ${res.join(' | ')}`));
307
303
  if (agent.publicUrl)
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
- import { authPost, authPut } from '../api.js';
3
+ import { authPost } from '../api.js';
4
4
  import { resolveAgent } from '../resolve.js';
5
5
  import { getConfig, getLinkedAgentId, writeLink } from '../context.js';
6
6
  import { isJsonMode, outputJson, fail, handleError, makeSpinner, EXIT } from '../output.js';
@@ -17,8 +17,8 @@ export const deployCommand = new Command('deploy')
17
17
  .option('--branch <branch>', 'Git branch')
18
18
  .option('-w, --wait', 'Wait for deployment to complete')
19
19
  .addHelpText('after', `
20
- In a linked project, just run \`maritime deploy\` — it reads maritime.json,
21
- creates the agent if needed, applies the persona/tier, and redeploys.
20
+ In a linked project, just run \`maritime deploy\`: it reads maritime.json,
21
+ creates the agent if needed, applies the persona, and redeploys.
22
22
  Explicit sources still work: \`maritime deploy --source github --repo <url>\`.`)
23
23
  .action(async (agentArg, opts) => {
24
24
  try {
@@ -46,7 +46,7 @@ Explicit sources still work: \`maritime deploy --source github --repo <url>\`.`)
46
46
  else {
47
47
  fail('Nothing to deploy. Pass an agent, link one (`maritime link`), or add maritime.json (`maritime init`).', { code: 'no_agent', exitCode: EXIT.USAGE });
48
48
  }
49
- // ── Reconcile the agent to maritime.json (persona + tier) ─────────
49
+ // ── Reconcile the agent to maritime.json (persona) ────────────────
50
50
  if (config && !explicitSource) {
51
51
  await reconcile(agent.id, config);
52
52
  }
@@ -158,13 +158,11 @@ async function createFromConfig(config) {
158
158
  body.templateId = config.template;
159
159
  if (config.framework)
160
160
  body.framework = config.framework;
161
- if (config.tier)
162
- body.tier = config.tier;
163
161
  if (config.instructions)
164
162
  body.instructions = config.instructions;
165
163
  return authPost('/api/agents', body);
166
164
  }
167
- /** Apply persona + tier from config to an existing agent (env takes effect on redeploy). */
165
+ /** Apply persona from config to an existing agent (env takes effect on redeploy). */
168
166
  async function reconcile(agentId, config) {
169
167
  if (config.instructions) {
170
168
  await authPost(`/api/agents/${agentId}/env`, {
@@ -173,9 +171,6 @@ async function reconcile(agentId, config) {
173
171
  is_secret: false,
174
172
  });
175
173
  }
176
- if (config.tier) {
177
- await authPut(`/api/agents/${agentId}`, { tier: config.tier });
178
- }
179
174
  }
180
175
  function finish(json, human) {
181
176
  if (isJsonMode())
@@ -47,16 +47,21 @@ function parseDotenv(text) {
47
47
  async function uploadVars(agentId, pairs, isSecret) {
48
48
  const uploaded = [];
49
49
  const failed = [];
50
+ // The backend warns when a deploy is mid-flight: that boot reads env at
51
+ // container start and may miss these values. One warning covers the batch.
52
+ let warning = null;
50
53
  for (const { key, value } of pairs) {
51
54
  try {
52
- await authPost(`/api/agents/${agentId}/env`, { key, value, is_secret: isSecret });
55
+ const resp = await authPost(`/api/agents/${agentId}/env`, { key, value, is_secret: isSecret });
56
+ if (resp?.warning)
57
+ warning = resp.warning;
53
58
  uploaded.push(key);
54
59
  }
55
60
  catch (error) {
56
61
  failed.push({ key, error: error instanceof Error ? error.message : String(error) });
57
62
  }
58
63
  }
59
- return { uploaded, failed };
64
+ return { uploaded, failed, warning };
60
65
  }
61
66
  /** Hot-reload env into the running container (falls back to restart server-side). */
62
67
  async function reloadEnv(agentId) {
@@ -126,7 +131,7 @@ envCommand
126
131
  const pairs = pairTokens.map(parsePair);
127
132
  const agent = await resolveAgent(target);
128
133
  const spinner = await makeSpinner(`Setting ${pairs.length} var${pairs.length === 1 ? '' : 's'} for ${agent.name}...`);
129
- const { uploaded, failed } = await uploadVars(agent.id, pairs, opts.secret);
134
+ const { uploaded, failed, warning } = await uploadVars(agent.id, pairs, opts.secret);
130
135
  let reloaded = false;
131
136
  if (opts.reload && uploaded.length > 0) {
132
137
  try {
@@ -141,9 +146,11 @@ envCommand
141
146
  spinner.fail(`Set ${uploaded.length}, failed ${failed.length}`);
142
147
  else
143
148
  spinner.succeed(`Set ${uploaded.length} var${uploaded.length === 1 ? '' : 's'} for ${chalk.bold(agent.name)}`);
144
- outputResult({ ok: failed.length === 0, agentId: agent.id, uploaded, failed, reloaded }, () => {
149
+ outputResult({ ok: failed.length === 0, agentId: agent.id, uploaded, failed, reloaded, warning }, () => {
145
150
  for (const f of failed)
146
151
  console.error(chalk.red(` ${f.key}: ${f.error}`));
152
+ if (warning)
153
+ console.log(chalk.yellow(` ${warning}`));
147
154
  if (reloaded)
148
155
  console.log(chalk.dim(' Reloaded into running container.'));
149
156
  else if (opts.reload)
@@ -205,7 +212,7 @@ envCommand
205
212
  }
206
213
  const agent = await resolveAgent(target);
207
214
  const spinner = await makeSpinner(`Importing ${pairs.length} vars into ${agent.name}...`);
208
- const { uploaded, failed } = await uploadVars(agent.id, pairs, !opts.plain);
215
+ const { uploaded, failed, warning } = await uploadVars(agent.id, pairs, !opts.plain);
209
216
  let reloaded = false;
210
217
  if (opts.reload && uploaded.length > 0) {
211
218
  try {
@@ -220,9 +227,11 @@ envCommand
220
227
  spinner.fail(`Imported ${uploaded.length}, failed ${failed.length}`);
221
228
  else
222
229
  spinner.succeed(`Imported ${uploaded.length} vars into ${chalk.bold(agent.name)}`);
223
- outputResult({ ok: failed.length === 0, agentId: agent.id, uploaded, failed, reloaded }, () => {
230
+ outputResult({ ok: failed.length === 0, agentId: agent.id, uploaded, failed, reloaded, warning }, () => {
224
231
  for (const f of failed)
225
232
  console.error(chalk.red(` ${f.key}: ${f.error}`));
233
+ if (warning)
234
+ console.log(chalk.yellow(` ${warning}`));
226
235
  if (reloaded)
227
236
  console.log(chalk.dim(' Reloaded into running container.'));
228
237
  else if (opts.reload)
@@ -332,7 +341,7 @@ envCommand
332
341
  keys.push(v.key);
333
342
  if (v.is_secret) {
334
343
  secretKeys.push(v.key);
335
- lines.push(`${v.key}= # secret — value not exported; fill it in`);
344
+ lines.push(`${v.key}= # secret: value not exported; fill it in`);
336
345
  }
337
346
  else {
338
347
  lines.push(`${v.key}=${v.value}`);
@@ -349,7 +358,7 @@ envCommand
349
358
  outputResult({ ok: true, agentId: agent.id, file: outFile, keys, secretKeys }, () => {
350
359
  console.log(chalk.green(`Pulled ${keys.length} var(s) → `) + chalk.bold(outFile));
351
360
  if (secretKeys.length) {
352
- console.log(chalk.dim(` ${secretKeys.length} secret value(s) masked — fill in: ${secretKeys.join(', ')}`));
361
+ console.log(chalk.dim(` ${secretKeys.length} secret value(s) masked. Fill in: ${secretKeys.join(', ')}`));
353
362
  }
354
363
  });
355
364
  }
@@ -13,9 +13,10 @@ const CONTRACT = {
13
13
  auth: 'Set the MARITIME_TOKEN env var to a long-lived API key (mk_…, minted via `maritime keys create`) or a login JWT. The CLI reads it before anything else; never run interactive login in automation.',
14
14
  json: 'Pass --json on every command. Success → one JSON value on stdout, stderr empty. Failure → one JSON object {ok:false,error:{code,message,status?}} on stderr, stdout empty.',
15
15
  exitCodes: { '0': 'ok', '1': 'error', '2': 'auth', '3': 'not_found', '4': 'usage' },
16
- interaction: 'Talk to a deployed agent with `maritime chat <agent> <message>` (or pipe the message via stdin). Returns the reply text (or {response} under --json). Sleeping serverless agents auto-wake. To message AS one of YOUR end-users (sticky per-user agents via the project front door), use `maritime message <agent> --user <externalUserId> <message>` — status:replied carries .reply inline; provisioning/queued means the reply arrives via the message.reply webhook.',
17
- resources: 'create accepts per-agent overrides: --ram <mb>, --cpu <cores>, --idle <seconds> | --always-on, --disk <gb>, --max-compute <minutes>. Omitted = inherit the tier/plan.',
18
- fleet: 'create --count <n> (2–50) spins up n identical agents named <name>-1..<name>-n in one call. Supported alongside --count: --template, --tier, --idle/--always-on, --repo, -e/--env; other create flags exit 4. --json returns {created:[{id,name,status}],failed:[{name,error}],requested,monthlyCostCents}. Exit 0 = all created, 1 = partial/none (402 insufficient wallet balance, 403 over the 50-agent cap → exit 1).',
16
+ billing: 'A plan sets how many machines you may have (the free plan includes 3). A machine is one micro-VM: an agent is a machine and so is a Computer, and both draw on the same count. When a create is refused for a billing reason the CLI exits 1 with error.status 402 and error.code from the server, usually seat_limit. error.message is the server sentence verbatim: it already names the fix (delete an agent, upgrade, renew a lapsed plan, or add your own INKBOX_API_KEY) and carries https://maritime.sh/billing. Surface it to your user unchanged instead of writing your own reason.',
17
+ interaction: 'Talk to a deployed agent with `maritime chat <agent> <message>` (or pipe the message via stdin). Returns the reply text (or {response} under --json). Sleeping serverless agents auto-wake. To message AS one of YOUR end-users (sticky per-user agents via the project front door), use `maritime message <agent> --user <externalUserId> <message>`; status:replied carries .reply inline; provisioning/queued means the reply arrives via the message.reply webhook.',
18
+ resources: 'create accepts per-agent overrides: --ram <mb>, --cpu <cores>, --idle <seconds> | --always-on, --disk <gb>. Omitted = platform defaults. Above the included 2 GB RAM / 5 GB SSD, and for --always-on, these are paid add-ons that need a plan; the 402 below says so.',
19
+ fleet: 'create --count <n> (2-50) spins up n identical agents named <name>-1..<name>-n in one call. Supported alongside --count: --template, --idle/--always-on, --repo, -e/--env; other create flags exit 4. --json returns {created:[{id,name,status}],failed:[{name,error}],requested}. Exit 0 = all created, 1 = partial/none. A 402 means a billing gate closed (error.code seat_limit): error.message is the complete server sentence naming the fix and the https://maritime.sh/billing link, so show it as-is. 403 over the 50-agent cap also exits 1.',
19
20
  project: 'A directory can be linked to an agent (like vercel/railway). `maritime init <name>` scaffolds maritime.json + AGENTS.md and links it; `maritime link <agent>` links an existing one; `maritime deploy` reconciles the agent to maritime.json. Once linked, the <agent> argument is optional on every command (resolved from .maritime/project.json, walking up from cwd).',
20
21
  apiBase: 'Override the API base with MARITIME_API_URL (default https://api.maritime.sh).',
21
22
  };
@@ -76,10 +77,11 @@ export const guideCommand = new Command('guide')
76
77
  return;
77
78
  }
78
79
  // Fallback if AGENTS.md wasn't shipped: print the contract essentials.
79
- console.log('Maritime CLI — programmatic / AI-agent usage\n');
80
+ console.log('Maritime CLI · programmatic / AI-agent usage\n');
80
81
  console.log(` Auth: ${CONTRACT.auth}`);
81
82
  console.log(` JSON: ${CONTRACT.json}`);
82
83
  console.log(` Chat: ${CONTRACT.interaction}`);
83
84
  console.log(` Limits: ${CONTRACT.resources}`);
85
+ console.log(` Billing: ${CONTRACT.billing}`);
84
86
  console.log('\n Run `maritime guide --json` for the full structured manifest.');
85
87
  });
@@ -40,7 +40,7 @@ export const historyCommand = new Command('history')
40
40
  const colorFn = statusColors[d.status] || chalk.white;
41
41
  const sha = d.commitSha ? d.commitSha.slice(0, 7) : chalk.dim('n/a');
42
42
  const started = new Date(d.startedAt).toLocaleString();
43
- const completed = d.completedAt ? new Date(d.completedAt).toLocaleString() : chalk.dim('—');
43
+ const completed = d.completedAt ? new Date(d.completedAt).toLocaleString() : chalk.dim('n/a');
44
44
  console.log(' ' +
45
45
  chalk.dim(d.id.slice(0, 12).padEnd(14)) +
46
46
  colorFn(d.status.padEnd(12)) +
@@ -30,8 +30,12 @@ export const infoCommand = new Command('info')
30
30
  const rows = [
31
31
  ['ID', chalk.dim(agent.id)],
32
32
  ['Status', statusColor(agent.status)],
33
+ [
34
+ 'Sleep',
35
+ agent.sleepPolicy ??
36
+ (agent.idleTtlSeconds != null && agent.idleTtlSeconds <= 0 ? 'always-on' : 'auto-sleep'),
37
+ ],
33
38
  ['Framework', agent.framework],
34
- ['Tier', agent.tier],
35
39
  ['Created', agent.createdAt ? new Date(agent.createdAt).toLocaleString() : 'n/a'],
36
40
  ];
37
41
  if (agent.githubRepo)
@@ -8,7 +8,7 @@ import { promptForValue } from '../prompt.js';
8
8
  import { isJsonMode, outputResult, fail, handleError, makeSpinner, EXIT } from '../output.js';
9
9
  const AGENTS_MD = (name, instructions) => `# ${name}
10
10
 
11
- ${instructions || 'Describe what this agent does and how it should behave. This file is the agent\'s persona — it is loaded into the agent\'s workspace at boot.'}
11
+ ${instructions || 'Describe what this agent does and how it should behave. This file is the agent\'s persona. It is loaded into the agent\'s workspace at boot.'}
12
12
 
13
13
  ## Guidelines
14
14
  - Be concise and helpful.
@@ -20,7 +20,6 @@ export const initCommand = new Command('init')
20
20
  .option('-t, --template <id>', 'Template to base the agent on (default: openclaw)')
21
21
  .option('--framework <framework>', 'Framework for bring-your-own-code agents (instead of a template)')
22
22
  .option('--instructions <text>', 'Plain-English persona for the agent')
23
- .option('--tier <tier>', 'Tier: smart, extended, always_on')
24
23
  .option('--no-create', 'Only write the config files; do not create the agent yet')
25
24
  .addHelpText('after', `
26
25
  Examples:
@@ -47,14 +46,12 @@ After init, run \`maritime deploy\` to push changes, or \`maritime chat "…"\`.
47
46
  ? undefined
48
47
  : opts.template || existing.template || 'openclaw';
49
48
  const instructions = opts.instructions ?? existing.instructions ?? '';
50
- const tier = opts.tier || existing.tier;
51
49
  const config = {
52
50
  name,
53
51
  ...(template ? { template } : {}),
54
52
  ...(framework ? { framework } : {}),
55
53
  ...(instructions ? { instructions } : {}),
56
54
  env: existing.env ?? [],
57
- ...(tier ? { tier } : {}),
58
55
  };
59
56
  const wroteConfig = !configExists();
60
57
  const configPath = writeConfig(config);
@@ -76,8 +73,6 @@ After init, run \`maritime deploy\` to push changes, or \`maritime chat "…"\`.
76
73
  body.templateId = template;
77
74
  if (framework)
78
75
  body.framework = framework;
79
- if (tier)
80
- body.tier = tier;
81
76
  if (instructions)
82
77
  body.instructions = instructions;
83
78
  agent = await authPost('/api/agents', body);
@@ -7,9 +7,9 @@ export const keysCommand = new Command('keys')
7
7
  .description('Manage long-lived API keys (mk_…) for non-interactive / AI-agent access');
8
8
  keysCommand
9
9
  .command('create')
10
- .description('Mint a new API key. Shown once — save it as MARITIME_TOKEN.')
10
+ .description('Mint a new API key. Shown once, so save it as MARITIME_TOKEN.')
11
11
  .option('-n, --name <name>', 'Label for the key', 'cli-agent')
12
- .option('-s, --scopes <scopes>', `Comma-separated scopes (${VALID_SCOPES.join(', ')}); "manage" = all. Defaults to full access — pass a narrower set to restrict the key.`, 'provision,deploy,secrets,manage')
12
+ .option('-s, --scopes <scopes>', `Comma-separated scopes (${VALID_SCOPES.join(', ')}); "manage" = all. Defaults to full access. Pass a narrower set to restrict the key.`, 'provision,deploy,secrets,manage')
13
13
  .action(async (opts) => {
14
14
  try {
15
15
  const scopes = String(opts.scopes)
@@ -27,7 +27,7 @@ keysCommand
27
27
  console.log();
28
28
  console.log(' ' + chalk.bold(created.raw_key));
29
29
  console.log();
30
- console.log(chalk.yellow(' Save this now — it will not be shown again.'));
30
+ console.log(chalk.yellow(' Save this now. It will not be shown again.'));
31
31
  console.log(chalk.dim(' Use it non-interactively with:'));
32
32
  console.log(chalk.dim(` export MARITIME_TOKEN=${created.raw_key}`));
33
33
  });
@@ -2,6 +2,11 @@ import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import { authGet } from '../api.js';
4
4
  import { isJsonMode, outputJson, handleError } from '../output.js';
5
+ function sleepPolicyOf(a) {
6
+ if (a.sleepPolicy)
7
+ return a.sleepPolicy;
8
+ return a.idleTtlSeconds != null && a.idleTtlSeconds <= 0 ? 'always-on' : 'auto-sleep';
9
+ }
5
10
  const statusColors = {
6
11
  active: chalk.green,
7
12
  sleeping: chalk.blue,
@@ -26,10 +31,10 @@ export const listCommand = new Command('list')
26
31
  console.log('\n ' +
27
32
  chalk.dim('NAME'.padEnd(24)) +
28
33
  chalk.dim('STATUS'.padEnd(12)) +
34
+ chalk.dim('SLEEP'.padEnd(12)) +
29
35
  chalk.dim('FRAMEWORK'.padEnd(20)) +
30
- chalk.dim('TIER'.padEnd(12)) +
31
36
  chalk.dim('CREATED'));
32
- console.log(chalk.dim(' ' + '\u2500'.repeat(80)));
37
+ console.log(chalk.dim(' ' + '\u2500'.repeat(88)));
33
38
  for (const a of agents) {
34
39
  const colorFn = statusColors[a.status] || chalk.white;
35
40
  const created = a.createdAt ? new Date(a.createdAt).toLocaleDateString() : '';
@@ -38,8 +43,8 @@ export const listCommand = new Command('list')
38
43
  console.log(' ' +
39
44
  chalk.bold(name.padEnd(24)) +
40
45
  colorFn(a.status.padEnd(12)) +
46
+ sleepPolicyOf(a).padEnd(12) +
41
47
  fw.padEnd(20) +
42
- a.tier.padEnd(12) +
43
48
  chalk.dim(created));
44
49
  }
45
50
  console.log();
@@ -5,7 +5,7 @@ import chalk from 'chalk';
5
5
  import open from 'open';
6
6
  import { config } from '../config.js';
7
7
  import { CliHttpError, getApiUrl, postJson } from '../api.js';
8
- import { makeSpinner } from '../output.js';
8
+ import { EXIT, fail, handleError, makeSpinner, outputResult } from '../output.js';
9
9
  import { promptForPassword, promptForValue } from '../prompt.js';
10
10
  const APP_URL = process.env.MARITIME_APP_URL || 'https://maritime.sh';
11
11
  const TIMEOUT_MS = 120_000;
@@ -75,12 +75,41 @@ function browserLogin() {
75
75
  });
76
76
  });
77
77
  }
78
+ /**
79
+ * Asks the server to send the email verification link again.
80
+ *
81
+ * The server always answers ok, also for an address with no account or an
82
+ * address that is already verified, so "Sent" does not confirm an account.
83
+ *
84
+ * @param emailFlag The value of `-e`. When absent, the email of the stored login is used.
85
+ */
86
+ async function resendVerification(emailFlag) {
87
+ const email = (emailFlag ?? config.get('user') ?? '').trim();
88
+ if (!email) {
89
+ fail('No email to send to. Run `maritime login --resend -e <email>`.', {
90
+ code: 'email_required',
91
+ exitCode: EXIT.USAGE,
92
+ });
93
+ }
94
+ try {
95
+ await postJson('/api/auth/resend-verification', { email });
96
+ }
97
+ catch (error) {
98
+ handleError(error);
99
+ }
100
+ outputResult({ ok: true, action: 'resend_verification', email }, `Sent. Check ${email}.`);
101
+ }
78
102
  export const loginCommand = new Command('login')
79
103
  .description('Authenticate with Maritime')
80
104
  .option('-e, --email <email>', 'Email address (for non-interactive login)')
81
105
  .option('-p, --password <password>', 'Password (for non-interactive login)')
82
106
  .option('-t, --token <token>', `Paste a token from ${APP_URL}/cli/auth (works for SSO / headless / CI)`)
107
+ .option('--resend', 'Send the email verification link again (uses -e, else the logged-in email)')
83
108
  .action(async (opts) => {
109
+ if (opts.resend) {
110
+ await resendVerification(opts.email);
111
+ return;
112
+ }
84
113
  // 1. Token paste — the universal path. Works for any account, including
85
114
  // OAuth-only (Google/GitHub) users who have no password to type.
86
115
  // Generate one at <app>/cli/auth.
@@ -141,7 +170,7 @@ export const loginCommand = new Command('login')
141
170
  .split(',')
142
171
  .join(', ');
143
172
  console.log(chalk.red('Error:') +
144
- ` this account signs in with ${chalk.bold(providers)} — there's no password to use here.`);
173
+ ` this account signs in with ${chalk.bold(providers)}. There's no password to use here.`);
145
174
  console.log('\nAuthenticate one of these ways instead:');
146
175
  console.log(' ' + chalk.bold('maritime login') + chalk.dim(' open the browser and approve'));
147
176
  console.log(' ' + chalk.bold('maritime login --token <token>') + chalk.dim(` paste a token from ${APP_URL}/cli/auth`));
@@ -22,7 +22,7 @@ Examples:
22
22
  maritime message support-bot --user cust_42 --wait 0 "hi" --json # ack + poll later
23
23
 
24
24
  A 200 with status=replied carries the reply inline. status=provisioning/queued
25
- means the user's agent is still being set up — the reply arrives via the
25
+ means the user's agent is still being set up. The reply arrives via the
26
26
  message.reply webhook (maritime guide: webhooks) or GET the message by id.`)
27
27
  .action(async (agentPos, messageParts, opts) => {
28
28
  try {
@@ -35,7 +35,7 @@ message.reply webhook (maritime guide: webhooks) or GET the message by id.`)
35
35
  // The summary omits projectId — fetch the full record for it.
36
36
  const full = await authGet(`/api/agents/${agent.id}`);
37
37
  if (!full.projectId) {
38
- fail(`Agent ${agent.name} has no project — recreate it or use \`maritime chat\`.`, {
38
+ fail(`Agent ${agent.name} has no project. Recreate it or use \`maritime chat\`.`, {
39
39
  code: 'no_project',
40
40
  });
41
41
  }
@@ -30,7 +30,8 @@ export const signupCommand = new Command('signup')
30
30
  config.set('userId', auth.user.id);
31
31
  config.set('apiUrl', process.env.MARITIME_API_URL || 'https://api.maritime.sh');
32
32
  spinner.succeed(chalk.green('Authenticated as ') + chalk.bold(auth.user.email));
33
- console.log(chalk.dim('\nToken saved. You can now deploy agents.'));
33
+ console.log(chalk.dim('\nToken saved.'));
34
+ console.log(`Verify your email to deploy: we sent a link to ${auth.user.email}.`);
34
35
  }
35
36
  catch (error) {
36
37
  spinner.fail('Signup failed');
@@ -19,7 +19,6 @@ export const statusCommand = new Command('status')
19
19
  console.log(chalk.dim('─'.repeat(40)));
20
20
  console.log(` ${'Status:'.padEnd(16)} ${statusColor(agent.status)}`);
21
21
  console.log(` ${'Framework:'.padEnd(16)} ${agent.framework}`);
22
- console.log(` ${'Tier:'.padEnd(16)} ${agent.tier}`);
23
22
  const resParts = [];
24
23
  if (agent.memMb)
25
24
  resParts.push(`${agent.memMb}MB`);
@@ -33,9 +32,6 @@ export const statusCommand = new Command('status')
33
32
  const idle = agent.idleTtlSeconds <= 0 ? 'always-on' : `${agent.idleTtlSeconds}s after request`;
34
33
  console.log(` ${'Idle:'.padEnd(16)} ${idle}`);
35
34
  }
36
- if (agent.computeMinutesLimit) {
37
- console.log(` ${'Compute cap:'.padEnd(16)} ${agent.computeMinutesLimit} min / period`);
38
- }
39
35
  console.log(` ${'ID:'.padEnd(16)} ${chalk.dim(agent.id)}`);
40
36
  if (agent.invocationCount !== undefined) {
41
37
  console.log(` ${'Invocations:'.padEnd(16)} ${agent.invocationCount}`);
@@ -39,14 +39,24 @@ const triggerListCmd = new Command('list')
39
39
  const triggerCreateCmd = new Command('create')
40
40
  .description('Create a trigger for an agent')
41
41
  .argument('<agent>', 'Agent name or ID')
42
- .requiredOption('--type <type>', 'Trigger type (webhook, cron, email)')
42
+ .requiredOption('--type <type>', 'Trigger type (webhook, cron, telegram, discord)')
43
43
  .option('--cron <expression>', 'Cron expression (for cron triggers)')
44
+ .option('--prompt <text>', 'Message delivered to the agent on each fire (cron triggers only, max 2000 chars)')
44
45
  .action(async (agentArg, opts) => {
45
46
  try {
47
+ if (opts.prompt !== undefined && opts.type !== 'cron') {
48
+ handleError(new Error('--prompt applies to cron triggers only'));
49
+ return;
50
+ }
46
51
  const agent = await resolveAgent(agentArg);
47
52
  const body = { type: opts.type };
53
+ const config = {};
48
54
  if (opts.cron)
49
- body.config = { cron: opts.cron };
55
+ config.cron = opts.cron;
56
+ if (opts.prompt)
57
+ config.prompt = opts.prompt;
58
+ if (Object.keys(config).length > 0)
59
+ body.config = config;
50
60
  const trigger = await authPost(`/api/agents/${agent.id}/triggers`, body);
51
61
  if (isJsonMode()) {
52
62
  outputJson(trigger);
package/dist/context.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * .maritime/project.json the LINK: which agent this directory operates on.
6
6
  * Machine-local, git-ignored. Written by `link`/`init`.
7
7
  * maritime.json the CONFIG: the source-of-truth description of the
8
- * agent (name, template/framework, persona, env keys,
9
- * tier). Committed to the repo; `deploy` reconciles
8
+ * agent (name, template/framework, persona, env
9
+ * keys). Committed to the repo; `deploy` reconciles
10
10
  * the remote agent to it.
11
11
  *
12
12
  * Both are discovered by walking up from the cwd, so commands work from any
@@ -26,8 +26,6 @@ export interface MaritimeConfig {
26
26
  instructions?: string;
27
27
  /** Env var KEYS this agent expects. Values are set via `env`, never committed. */
28
28
  env?: string[];
29
- /** Optional tier override (smart | extended | always_on). */
30
- tier?: string;
31
29
  }
32
30
  export declare function findLinkPath(start?: string): string | null;
33
31
  export declare function getLink(): ProjectLink | null;
package/dist/context.js CHANGED
@@ -5,8 +5,8 @@
5
5
  * .maritime/project.json the LINK: which agent this directory operates on.
6
6
  * Machine-local, git-ignored. Written by `link`/`init`.
7
7
  * maritime.json the CONFIG: the source-of-truth description of the
8
- * agent (name, template/framework, persona, env keys,
9
- * tier). Committed to the repo; `deploy` reconciles
8
+ * agent (name, template/framework, persona, env
9
+ * keys). Committed to the repo; `deploy` reconciles
10
10
  * the remote agent to it.
11
11
  *
12
12
  * Both are discovered by walking up from the cwd, so commands work from any
package/dist/index.js CHANGED
@@ -27,8 +27,6 @@ import { chatCommand } from './commands/chat.js';
27
27
  import { messageCommand } from './commands/message.js';
28
28
  import { historyCommand } from './commands/history.js';
29
29
  import { triggersCommand } from './commands/triggers.js';
30
- import { blueprintCommand } from './commands/blueprint.js';
31
- import { scaleCommand } from './commands/scale.js';
32
30
  import { sleepCommand } from './commands/sleep.js';
33
31
  import { checkForUpdates, printUpdateNotice, versionCheckSettled } from './version-check.js';
34
32
  import { guideCommand } from './commands/guide.js';
@@ -88,12 +86,10 @@ program.addCommand(startCommand, HIDDEN);
88
86
  program.addCommand(stopCommand, HIDDEN);
89
87
  program.addCommand(restartCommand, HIDDEN);
90
88
  program.addCommand(sleepCommand, HIDDEN);
91
- program.addCommand(scaleCommand, HIDDEN);
92
89
  program.addCommand(execCommand, HIDDEN);
93
90
  program.addCommand(infoCommand, HIDDEN);
94
91
  program.addCommand(historyCommand, HIDDEN);
95
92
  program.addCommand(triggersCommand, HIDDEN);
96
- program.addCommand(blueprintCommand, HIDDEN);
97
93
  program.addCommand(templatesCommand, HIDDEN);
98
94
  program.addCommand(openCommand, HIDDEN);
99
95
  // Make the programmatic contract discoverable from the first thing an agent
@@ -102,7 +98,7 @@ program.addHelpText('after', `
102
98
  Quickstart (a directory is an agent):
103
99
  maritime init my-agent create + link this folder to an agent
104
100
  maritime chat "hello" talk to the linked agent (no name needed)
105
- maritime deploy push maritime.json changes (persona, tier)
101
+ maritime deploy push maritime.json changes (persona)
106
102
  maritime logs · status · env · open all act on the linked agent
107
103
 
108
104
  For scripts & AI agents:
@@ -16,14 +16,12 @@ const COMMANDS = [
16
16
  { name: 'triggers', value: 'triggers', description: 'Manage triggers', needsAgent: false },
17
17
  { name: 'templates', value: 'templates', description: 'Browse templates', needsAgent: false },
18
18
  { name: 'history', value: 'history', description: 'View deploy history', needsAgent: true },
19
- { name: 'blueprint', value: 'blueprint', description: 'Manage blueprints', needsAgent: false },
20
- { name: 'scale', value: 'scale', description: 'Change agent tier', needsAgent: true },
21
19
  { name: 'open', value: 'open', description: 'Open agent in browser', needsAgent: true },
22
20
  { name: 'whoami', value: 'whoami', description: 'Show current user', needsAgent: false },
23
21
  { name: 'logout', value: 'logout', description: 'Log out', needsAgent: false },
24
22
  ];
25
23
  export async function runInteractive() {
26
- console.log(chalk.hex('#8B5CF6')('\n Maritime') + chalk.dim(' — interactive mode\n'));
24
+ console.log(chalk.hex('#8B5CF6')('\n Maritime') + chalk.dim(' · interactive mode\n'));
27
25
  const command = await select({
28
26
  message: 'What would you like to do?',
29
27
  choices: COMMANDS.map((c) => ({
package/dist/output.js CHANGED
@@ -79,6 +79,8 @@ function errorCodeForStatus(status) {
79
79
  case 401:
80
80
  case 403:
81
81
  return 'unauthorized';
82
+ case 402:
83
+ return 'payment_required';
82
84
  case 404:
83
85
  return 'not_found';
84
86
  case 409:
@@ -125,9 +127,14 @@ export function handleError(error) {
125
127
  if (error instanceof ExitSignal)
126
128
  throw error;
127
129
  if (error instanceof CliHttpError) {
130
+ // The server's own code wins when it sent one: a 402 that says
131
+ // `seat_limit` tells the caller exactly which gate closed, where the
132
+ // status-derived fallback would only say `payment_required`. The
133
+ // message is always the server's detail verbatim, which for billing
134
+ // gates is already a complete sentence naming the fix.
128
135
  fail(error.detail, {
129
136
  status: error.status,
130
- code: errorCodeForStatus(error.status),
137
+ code: error.code ?? errorCodeForStatus(error.status),
131
138
  exitCode: exitCodeForStatus(error.status),
132
139
  });
133
140
  }
package/dist/resolve.d.ts CHANGED
@@ -3,7 +3,6 @@ export interface AgentSummary {
3
3
  name: string;
4
4
  status: string;
5
5
  framework: string;
6
- tier?: string;
7
6
  createdAt?: string;
8
7
  }
9
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maritime-cli",
3
- "version": "1.6.2",
3
+ "version": "1.8.0",
4
4
  "description": "Maritime CLI - Deploy and talk to AI agents from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const blueprintCommand: Command;
@@ -1,92 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { authGet, authPost } from '../api.js';
4
- import { resolveAgent } from '../resolve.js';
5
- import { isJsonMode, outputJson, handleError, makeSpinner } from '../output.js';
6
- const blueprintListCmd = new Command('list')
7
- .description('List your blueprints')
8
- .action(async () => {
9
- try {
10
- const blueprints = await authGet('/api/blueprints');
11
- if (isJsonMode()) {
12
- outputJson(blueprints);
13
- return;
14
- }
15
- if (blueprints.length === 0) {
16
- console.log(chalk.dim('No blueprints found.'));
17
- return;
18
- }
19
- console.log('\n ' +
20
- chalk.dim('NAME'.padEnd(24)) +
21
- chalk.dim('STATUS'.padEnd(12)) +
22
- chalk.dim('VISIBILITY'.padEnd(14)) +
23
- chalk.dim('FRAMEWORK'));
24
- console.log(chalk.dim(' ' + '\u2500'.repeat(62)));
25
- for (const bp of blueprints) {
26
- console.log(' ' +
27
- chalk.bold(bp.name.padEnd(24)) +
28
- bp.status.padEnd(12) +
29
- bp.visibility.padEnd(14) +
30
- bp.framework);
31
- }
32
- console.log();
33
- }
34
- catch (error) {
35
- handleError(error);
36
- }
37
- });
38
- const blueprintCreateCmd = new Command('create')
39
- .description('Create a blueprint from an agent')
40
- .argument('<agent>', 'Agent name or ID')
41
- .option('--name <name>', 'Blueprint name')
42
- .option('--visibility <vis>', 'Visibility (private, unlisted, public)', 'private')
43
- .action(async (agentArg, opts) => {
44
- try {
45
- const agent = await resolveAgent(agentArg);
46
- const spinner = await makeSpinner('Creating blueprint...');
47
- const blueprint = await authPost('/api/blueprints', {
48
- agentId: agent.id,
49
- name: opts.name || agent.name,
50
- visibility: opts.visibility,
51
- });
52
- spinner.succeed(chalk.green('Blueprint created: ') + chalk.bold(blueprint.name));
53
- if (isJsonMode()) {
54
- outputJson(blueprint);
55
- }
56
- else {
57
- console.log(chalk.dim(` ID: ${blueprint.id}`));
58
- }
59
- }
60
- catch (error) {
61
- handleError(error);
62
- }
63
- });
64
- const blueprintDeployCmd = new Command('deploy')
65
- .description('Deploy a new agent from a blueprint')
66
- .argument('<slug>', 'Blueprint slug or ID')
67
- .option('--name <name>', 'Name for the new agent')
68
- .action(async (slug, opts) => {
69
- try {
70
- const spinner = await makeSpinner('Deploying from blueprint...');
71
- const body = {};
72
- if (opts.name)
73
- body.name = opts.name;
74
- const result = await authPost(`/api/marketplace/${encodeURIComponent(slug)}/deploy`, body);
75
- spinner.succeed(chalk.green('Agent created: ') + chalk.bold(result.name));
76
- if (isJsonMode()) {
77
- outputJson(result);
78
- }
79
- else {
80
- console.log(chalk.dim(` Agent ID: ${result.agentId}`));
81
- }
82
- }
83
- catch (error) {
84
- handleError(error);
85
- }
86
- });
87
- export const blueprintCommand = new Command('blueprint')
88
- .alias('bp')
89
- .description('Manage blueprints')
90
- .addCommand(blueprintListCmd)
91
- .addCommand(blueprintCreateCmd)
92
- .addCommand(blueprintDeployCmd);
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const scaleCommand: Command;
@@ -1,32 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { authPut } from '../api.js';
4
- import { resolveAgent } from '../resolve.js';
5
- import { isJsonMode, outputJson, handleError, fail, EXIT } from '../output.js';
6
- const VALID_TIERS = ['smart', 'extended', 'always_on'];
7
- export const scaleCommand = new Command('scale')
8
- .description('Change an agent tier')
9
- .argument('<agent>', 'Agent name or ID')
10
- .argument('<tier>', 'Target tier (smart, extended, always_on)')
11
- .action(async (agentArg, tier) => {
12
- if (!VALID_TIERS.includes(tier)) {
13
- fail(`Invalid tier "${tier}". Must be one of: ${VALID_TIERS.join(', ')}`, {
14
- code: 'usage',
15
- exitCode: EXIT.USAGE,
16
- });
17
- }
18
- try {
19
- const agent = await resolveAgent(agentArg);
20
- const result = await authPut(`/api/agents/${agent.id}`, {
21
- tier,
22
- });
23
- if (isJsonMode()) {
24
- outputJson(result);
25
- return;
26
- }
27
- console.log(chalk.green('Tier updated:') + ` ${chalk.bold(agent.name)} is now ${chalk.bold(tier)}`);
28
- }
29
- catch (error) {
30
- handleError(error);
31
- }
32
- });