maritime-cli 1.6.2 → 1.7.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 +24 -24
- package/dist/commands/blueprint.js +4 -4
- package/dist/commands/create.js +7 -12
- package/dist/commands/deploy.js +5 -10
- package/dist/commands/env.js +2 -2
- package/dist/commands/guide.js +4 -4
- package/dist/commands/history.js +1 -1
- package/dist/commands/info.js +0 -1
- package/dist/commands/init.js +1 -6
- package/dist/commands/keys.js +3 -3
- package/dist/commands/list.js +0 -2
- package/dist/commands/login.js +1 -1
- package/dist/commands/message.js +2 -2
- package/dist/commands/status.js +0 -1
- package/dist/context.d.ts +2 -4
- package/dist/context.js +2 -2
- package/dist/index.js +1 -3
- package/dist/interactive.js +2 -3
- package/dist/resolve.d.ts +0 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Maritime CLI
|
|
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
|
|
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
|
|
37
|
+
## Output contract: always pass `--json`
|
|
38
38
|
|
|
39
39
|
With `--json`, every command obeys a strict contract:
|
|
40
40
|
|
|
@@ -62,15 +62,15 @@ Always read stdout for results and branch on the exit code. Never parse human te
|
|
|
62
62
|
| `3` | not found (no such agent) |
|
|
63
63
|
| `4` | usage error (missing/invalid arguments) |
|
|
64
64
|
|
|
65
|
-
## The project model
|
|
65
|
+
## The project model: a directory is an agent
|
|
66
66
|
|
|
67
67
|
Like `vercel` / `railway`, you can link a directory to an agent and then run
|
|
68
68
|
commands without naming it. Two files:
|
|
69
69
|
|
|
70
|
-
- **`maritime.json
|
|
70
|
+
- **`maritime.json`**: committed config describing the agent: `name`,
|
|
71
71
|
`template` (or `framework`), persona `instructions`, env `["KEY", …]` (keys
|
|
72
|
-
only)
|
|
73
|
-
- **`.maritime/project.json
|
|
72
|
+
only). The source of truth.
|
|
73
|
+
- **`.maritime/project.json`**: machine-local link (git-ignored) pointing at
|
|
74
74
|
the agent this directory operates on.
|
|
75
75
|
|
|
76
76
|
```bash
|
|
@@ -79,7 +79,7 @@ maritime link <agent> --json # link this dir to an existing agent
|
|
|
79
79
|
maritime deploy --json # reconcile the agent to maritime.json, then ship
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Once linked, the `<agent>` argument is **optional on every command
|
|
82
|
+
Once linked, the `<agent>` argument is **optional on every command**. It falls
|
|
83
83
|
back to the linked agent (resolved by walking up from the cwd):
|
|
84
84
|
|
|
85
85
|
```bash
|
|
@@ -94,7 +94,7 @@ For automation you can ignore linking entirely and pass `<agent>` on every call
|
|
|
94
94
|
explicitly: `-a/--agent` on `chat`, or the positional name on commands that take
|
|
95
95
|
a single agent.
|
|
96
96
|
|
|
97
|
-
## The interaction primitive
|
|
97
|
+
## The interaction primitive: `chat`
|
|
98
98
|
|
|
99
99
|
Send a message to a deployed agent and get its reply. Sleeping serverless
|
|
100
100
|
agents are auto-woken by the backend.
|
|
@@ -113,7 +113,7 @@ cat prompt.txt | maritime chat <agent> --json
|
|
|
113
113
|
maritime chat <agent> "and the one before that?" --conversation-id abc123 --json
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
`<agent>` is a name (exact match), an ID prefix, or
|
|
116
|
+
`<agent>` is a name (exact match), an ID prefix, or (omitted) the linked agent.
|
|
117
117
|
|
|
118
118
|
Success shape:
|
|
119
119
|
|
|
@@ -123,7 +123,7 @@ Success shape:
|
|
|
123
123
|
|
|
124
124
|
Without `--json`, `chat` prints only the reply text on stdout (clean for piping).
|
|
125
125
|
|
|
126
|
-
### Messaging AS an end-user
|
|
126
|
+
### Messaging AS an end-user: `message`
|
|
127
127
|
|
|
128
128
|
`chat` targets one agent; `message` routes by YOUR end-user id through the
|
|
129
129
|
agent's project front door: the same `--user` always reaches the same
|
|
@@ -136,7 +136,7 @@ maritime message <agent> --user cust_42 --wait 0 "hi" --json # ack now; reply
|
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
`status:"replied"` carries `.reply` inline; `"provisioning"`/`"queued"` means
|
|
139
|
-
the user's agent is still booting
|
|
139
|
+
the user's agent is still booting. Poll the message id or subscribe to the
|
|
140
140
|
`message.reply` webhook (`POST /api/v1/webhooks`).
|
|
141
141
|
|
|
142
142
|
## Sizing (optional)
|
|
@@ -146,7 +146,7 @@ framework, and the agent auto-sleeps when idle and wakes on the next `chat`.
|
|
|
146
146
|
|
|
147
147
|
For hand-tuning one agent (e.g. a reseller dialing resources per client), `create`
|
|
148
148
|
accepts optional per-agent overrides. They're hidden from `--help` but fully
|
|
149
|
-
supported; omitted flags
|
|
149
|
+
supported; omitted flags get the platform defaults.
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
152
|
maritime create my-agent \
|
|
@@ -159,19 +159,19 @@ maritime create my-agent \
|
|
|
159
159
|
maritime create my-agent --always-on # never auto-sleep (mutually exclusive with --idle)
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
`--idle`/`--always-on` control how long the agent stays up after a request
|
|
163
|
-
|
|
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
|
|
164
164
|
that dispatches a long job and waits for a webhook won't be slept out from under
|
|
165
165
|
the wait. `--disk` and `--max-compute` are per-agent overrides on top of the
|
|
166
166
|
owner's account plan (disk is clamped to the plan's storage cap; the compute cap
|
|
167
167
|
auto-sleeps the agent for the rest of the billing period when hit).
|
|
168
168
|
`status <agent> --json` echoes `memMb`, `vcpus`, `idleTtlSeconds`
|
|
169
|
-
(`0` = always-on, `null` =
|
|
169
|
+
(`0` = always-on, `null` = platform default), `diskMb`, and `computeMinutesLimit`.
|
|
170
170
|
|
|
171
|
-
## Fleets
|
|
171
|
+
## Fleets: `create --count`
|
|
172
172
|
|
|
173
|
-
`maritime create <name> --count <n>` (n = 2
|
|
174
|
-
in a single call. `<name>` becomes the prefix
|
|
173
|
+
`maritime create <name> --count <n>` (n = 2-50) spins up **n identical agents**
|
|
174
|
+
in a single call. `<name>` becomes the prefix, so agents are named
|
|
175
175
|
`<name>-1` … `<name>-n`. `--count 1` (the default) is the classic single-agent
|
|
176
176
|
path, unchanged.
|
|
177
177
|
|
|
@@ -179,12 +179,12 @@ path, unchanged.
|
|
|
179
179
|
maritime create swarm --template openclaw --count 5 --idle 3600 --json
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
Flags supported alongside `--count > 1`: `--template`,
|
|
182
|
+
Flags supported alongside `--count > 1`: `--template`,
|
|
183
183
|
`--idle`/`--always-on`, `--repo`, and `-e/--env` (applied to every agent).
|
|
184
184
|
In the fleet path `--idle 0` means always-on (same as `--always-on`).
|
|
185
185
|
Any other `create` flag (`--branch`, `--public`, `--port`, `--framework`,
|
|
186
186
|
`--ram`, `--cpu`, `--disk`, `--max-compute`) combined with `--count > 1` is a
|
|
187
|
-
usage error (exit `4`)
|
|
187
|
+
usage error (exit `4`); nothing is silently dropped. `--count` above 50 is
|
|
188
188
|
also exit `4`; the 50-agent cap is enforced server-side too.
|
|
189
189
|
|
|
190
190
|
Success shape (`--json`, the backend response verbatim):
|
|
@@ -199,7 +199,7 @@ Success shape (`--json`, the backend response verbatim):
|
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
Exit codes: `0` = **all** requested agents created (`failed` empty);
|
|
202
|
-
`1` = partial or none
|
|
202
|
+
`1` = partial or none, so inspect `created`/`failed` on stdout. Billing/limit
|
|
203
203
|
rejections surface as the standard error object on stderr with exit `1`:
|
|
204
204
|
`402` → `error.code = "insufficient_balance"` (each agent bills $1/mo from the
|
|
205
205
|
wallet; n agents need n×$1 available), `403` → `error.code =
|
|
@@ -245,8 +245,8 @@ Config: `env {set,import,list,remove,reload,pull}`
|
|
|
245
245
|
Observe: `status`, `logs`
|
|
246
246
|
|
|
247
247
|
Advanced / ops (hidden from `--help`, still fully supported): `start`, `stop`,
|
|
248
|
-
`restart`, `sleep`, `
|
|
249
|
-
`triggers`, `blueprint`, `templates`. You rarely need these
|
|
248
|
+
`restart`, `sleep`, `exec <agent> <cmd...>`, `info`, `history`,
|
|
249
|
+
`triggers`, `blueprint`, `templates`. You rarely need these: lifecycle is
|
|
250
250
|
automatic (idle-sleep + auto-wake on `chat`).
|
|
251
251
|
|
|
252
252
|
Run `maritime <cmd> --help` for flags. Every command accepts the global
|
|
@@ -4,7 +4,7 @@ import { authGet, authPost } from '../api.js';
|
|
|
4
4
|
import { resolveAgent } from '../resolve.js';
|
|
5
5
|
import { isJsonMode, outputJson, handleError, makeSpinner } from '../output.js';
|
|
6
6
|
const blueprintListCmd = new Command('list')
|
|
7
|
-
.description('List your
|
|
7
|
+
.description('List your templates')
|
|
8
8
|
.action(async () => {
|
|
9
9
|
try {
|
|
10
10
|
const blueprints = await authGet('/api/blueprints');
|
|
@@ -36,7 +36,7 @@ const blueprintListCmd = new Command('list')
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
const blueprintCreateCmd = new Command('create')
|
|
39
|
-
.description('Create a
|
|
39
|
+
.description('Create a template from an agent')
|
|
40
40
|
.argument('<agent>', 'Agent name or ID')
|
|
41
41
|
.option('--name <name>', 'Blueprint name')
|
|
42
42
|
.option('--visibility <vis>', 'Visibility (private, unlisted, public)', 'private')
|
|
@@ -62,7 +62,7 @@ const blueprintCreateCmd = new Command('create')
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
const blueprintDeployCmd = new Command('deploy')
|
|
65
|
-
.description('Deploy a new agent from a
|
|
65
|
+
.description('Deploy a new agent from a template')
|
|
66
66
|
.argument('<slug>', 'Blueprint slug or ID')
|
|
67
67
|
.option('--name <name>', 'Name for the new agent')
|
|
68
68
|
.action(async (slug, opts) => {
|
|
@@ -86,7 +86,7 @@ const blueprintDeployCmd = new Command('deploy')
|
|
|
86
86
|
});
|
|
87
87
|
export const blueprintCommand = new Command('blueprint')
|
|
88
88
|
.alias('bp')
|
|
89
|
-
.description('Manage
|
|
89
|
+
.description('Manage templates')
|
|
90
90
|
.addCommand(blueprintListCmd)
|
|
91
91
|
.addCommand(blueprintCreateCmd)
|
|
92
92
|
.addCommand(blueprintDeployCmd);
|
package/dist/commands/create.js
CHANGED
|
@@ -29,7 +29,7 @@ export const createCommand = new Command('create')
|
|
|
29
29
|
.argument('[name]', 'Agent name')
|
|
30
30
|
.option('-t, --template <template>', 'Template to base the agent on (see `maritime templates`)')
|
|
31
31
|
.option('-e, --env <pairs...>', 'Environment variables (KEY=value)')
|
|
32
|
-
.option('--count <n>', 'Spin up N identical agents in one call (fleet)
|
|
32
|
+
.option('--count <n>', 'Spin up N identical agents in one call (fleet). Names become <name>-1..<name>-N')
|
|
33
33
|
.option('-r, --repo <url>', 'Deploy from a GitHub repo (must contain a Dockerfile)')
|
|
34
34
|
.option('-b, --branch <branch>', 'Git branch to deploy (with --repo)')
|
|
35
35
|
.option('--public', 'Serve a public, no-login web URL for this agent (web apps)')
|
|
@@ -40,8 +40,7 @@ export const createCommand = new Command('create')
|
|
|
40
40
|
// to hand-tune a specific agent (e.g. a reseller dialing RAM per client).
|
|
41
41
|
.addOption(new Option('-n, --name <name>', 'Agent name (alias for the positional argument)').hideHelp())
|
|
42
42
|
.addOption(new Option('--framework <framework>', 'Framework (default: custom)').hideHelp())
|
|
43
|
-
.addOption(new Option('--
|
|
44
|
-
.addOption(new Option('--ram <mb>', 'RAM in MB (per-agent override of the tier default)').hideHelp())
|
|
43
|
+
.addOption(new Option('--ram <mb>', 'RAM in MB (per-agent override of the default)').hideHelp())
|
|
45
44
|
.addOption(new Option('--cpu <cores>', 'vCPU cores, e.g. 0.5 or 2 (per-agent override)').hideHelp())
|
|
46
45
|
.addOption(new Option('--idle <seconds>', 'Auto-sleep this many seconds after the last request').hideHelp())
|
|
47
46
|
.addOption(new Option('--always-on', 'Never auto-sleep (mutually exclusive with --idle)').hideHelp())
|
|
@@ -69,7 +68,7 @@ Examples:
|
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
if (n > FLEET_CAP) {
|
|
72
|
-
fail('Fleet spin-ups are capped at 50 agents. Contact us if you need more
|
|
71
|
+
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 });
|
|
73
72
|
}
|
|
74
73
|
count = n;
|
|
75
74
|
}
|
|
@@ -94,7 +93,7 @@ Examples:
|
|
|
94
93
|
if (templates.length > 0) {
|
|
95
94
|
console.log(chalk.dim('\nAvailable templates:'));
|
|
96
95
|
templates.forEach((t, i) => {
|
|
97
|
-
console.log(` ${chalk.bold(String(i + 1))}. ${t.name} (${t.framework})${t.description ? '
|
|
96
|
+
console.log(` ${chalk.bold(String(i + 1))}. ${t.name} (${t.framework})${t.description ? ' · ' + t.description : ''}`);
|
|
98
97
|
});
|
|
99
98
|
console.log();
|
|
100
99
|
const choice = await promptForValue('Template number (or press Enter to skip)');
|
|
@@ -131,7 +130,7 @@ Examples:
|
|
|
131
130
|
unsupported.push('--max-compute');
|
|
132
131
|
if (unsupported.length > 0) {
|
|
133
132
|
fail(`${unsupported.join(', ')} cannot be combined with --count > 1. ` +
|
|
134
|
-
'Fleet spin-ups support --template, --
|
|
133
|
+
'Fleet spin-ups support --template, --idle/--always-on, --repo, and -e/--env.', { code: 'usage', exitCode: EXIT.USAGE });
|
|
135
134
|
}
|
|
136
135
|
if (opts.alwaysOn && opts.idle !== undefined) {
|
|
137
136
|
fail('--always-on and --idle are mutually exclusive.', { code: 'usage', exitCode: EXIT.USAGE });
|
|
@@ -139,8 +138,6 @@ Examples:
|
|
|
139
138
|
const batchBody = { namePrefix: name, count };
|
|
140
139
|
if (templateId)
|
|
141
140
|
batchBody.templateId = templateId;
|
|
142
|
-
if (opts.tier)
|
|
143
|
-
batchBody.tier = opts.tier;
|
|
144
141
|
if (opts.repo)
|
|
145
142
|
batchBody.githubRepo = opts.repo;
|
|
146
143
|
if (opts.env)
|
|
@@ -218,8 +215,6 @@ Examples:
|
|
|
218
215
|
body.templateId = templateId;
|
|
219
216
|
if (opts.framework)
|
|
220
217
|
body.framework = opts.framework;
|
|
221
|
-
if (opts.tier)
|
|
222
|
-
body.tier = opts.tier;
|
|
223
218
|
if (opts.env)
|
|
224
219
|
body.initialEnvVars = parseEnvPairs(opts.env);
|
|
225
220
|
if (opts.repo)
|
|
@@ -236,7 +231,7 @@ Examples:
|
|
|
236
231
|
body.exposedPort = Number(opts.port);
|
|
237
232
|
else if (opts.public)
|
|
238
233
|
body.exposedPort = 8080;
|
|
239
|
-
// Per-agent resource overrides (serverless). Omitted fields inherit the
|
|
234
|
+
// Per-agent resource overrides (serverless). Omitted fields inherit the defaults.
|
|
240
235
|
if (opts.alwaysOn && opts.idle !== undefined) {
|
|
241
236
|
fail('--always-on and --idle are mutually exclusive.', { code: 'usage', exitCode: 4 });
|
|
242
237
|
}
|
|
@@ -289,7 +284,7 @@ Examples:
|
|
|
289
284
|
}
|
|
290
285
|
spinner.succeed(chalk.green('Created ') + chalk.bold(agent.name) + chalk.dim(` (${agent.id})`));
|
|
291
286
|
outputResult({ ok: true, action: 'create', ...agent }, () => {
|
|
292
|
-
console.log(chalk.dim(` Framework: ${agent.framework} |
|
|
287
|
+
console.log(chalk.dim(` Framework: ${agent.framework} | Status: ${agent.status}`));
|
|
293
288
|
const res = [];
|
|
294
289
|
if (agent.memMb)
|
|
295
290
|
res.push(`RAM ${agent.memMb}MB`);
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { authPost
|
|
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
|
|
21
|
-
creates the agent if needed, applies the persona
|
|
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
|
|
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
|
|
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())
|
package/dist/commands/env.js
CHANGED
|
@@ -332,7 +332,7 @@ envCommand
|
|
|
332
332
|
keys.push(v.key);
|
|
333
333
|
if (v.is_secret) {
|
|
334
334
|
secretKeys.push(v.key);
|
|
335
|
-
lines.push(`${v.key}= # secret
|
|
335
|
+
lines.push(`${v.key}= # secret: value not exported; fill it in`);
|
|
336
336
|
}
|
|
337
337
|
else {
|
|
338
338
|
lines.push(`${v.key}=${v.value}`);
|
|
@@ -349,7 +349,7 @@ envCommand
|
|
|
349
349
|
outputResult({ ok: true, agentId: agent.id, file: outFile, keys, secretKeys }, () => {
|
|
350
350
|
console.log(chalk.green(`Pulled ${keys.length} var(s) → `) + chalk.bold(outFile));
|
|
351
351
|
if (secretKeys.length) {
|
|
352
|
-
console.log(chalk.dim(` ${secretKeys.length} secret value(s) masked
|
|
352
|
+
console.log(chalk.dim(` ${secretKeys.length} secret value(s) masked. Fill in: ${secretKeys.join(', ')}`));
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
355
|
}
|
package/dist/commands/guide.js
CHANGED
|
@@ -13,9 +13,9 @@ 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
|
|
17
|
-
resources: 'create accepts per-agent overrides: --ram <mb>, --cpu <cores>, --idle <seconds> | --always-on, --disk <gb>, --max-compute <minutes>. Omitted =
|
|
18
|
-
fleet: 'create --count <n> (2
|
|
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 = platform defaults.',
|
|
18
|
+
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,monthlyCostCents}. Exit 0 = all created, 1 = partial/none (402 insufficient wallet balance, 403 over the 50-agent cap → exit 1).',
|
|
19
19
|
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
20
|
apiBase: 'Override the API base with MARITIME_API_URL (default https://api.maritime.sh).',
|
|
21
21
|
};
|
|
@@ -76,7 +76,7 @@ export const guideCommand = new Command('guide')
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
// Fallback if AGENTS.md wasn't shipped: print the contract essentials.
|
|
79
|
-
console.log('Maritime CLI
|
|
79
|
+
console.log('Maritime CLI · programmatic / AI-agent usage\n');
|
|
80
80
|
console.log(` Auth: ${CONTRACT.auth}`);
|
|
81
81
|
console.log(` JSON: ${CONTRACT.json}`);
|
|
82
82
|
console.log(` Chat: ${CONTRACT.interaction}`);
|
package/dist/commands/history.js
CHANGED
|
@@ -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)) +
|
package/dist/commands/info.js
CHANGED
|
@@ -31,7 +31,6 @@ export const infoCommand = new Command('info')
|
|
|
31
31
|
['ID', chalk.dim(agent.id)],
|
|
32
32
|
['Status', statusColor(agent.status)],
|
|
33
33
|
['Framework', agent.framework],
|
|
34
|
-
['Tier', agent.tier],
|
|
35
34
|
['Created', agent.createdAt ? new Date(agent.createdAt).toLocaleString() : 'n/a'],
|
|
36
35
|
];
|
|
37
36
|
if (agent.githubRepo)
|
package/dist/commands/init.js
CHANGED
|
@@ -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
|
|
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);
|
package/dist/commands/keys.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
});
|
package/dist/commands/list.js
CHANGED
|
@@ -27,7 +27,6 @@ export const listCommand = new Command('list')
|
|
|
27
27
|
chalk.dim('NAME'.padEnd(24)) +
|
|
28
28
|
chalk.dim('STATUS'.padEnd(12)) +
|
|
29
29
|
chalk.dim('FRAMEWORK'.padEnd(20)) +
|
|
30
|
-
chalk.dim('TIER'.padEnd(12)) +
|
|
31
30
|
chalk.dim('CREATED'));
|
|
32
31
|
console.log(chalk.dim(' ' + '\u2500'.repeat(80)));
|
|
33
32
|
for (const a of agents) {
|
|
@@ -39,7 +38,6 @@ export const listCommand = new Command('list')
|
|
|
39
38
|
chalk.bold(name.padEnd(24)) +
|
|
40
39
|
colorFn(a.status.padEnd(12)) +
|
|
41
40
|
fw.padEnd(20) +
|
|
42
|
-
a.tier.padEnd(12) +
|
|
43
41
|
chalk.dim(created));
|
|
44
42
|
}
|
|
45
43
|
console.log();
|
package/dist/commands/login.js
CHANGED
|
@@ -141,7 +141,7 @@ export const loginCommand = new Command('login')
|
|
|
141
141
|
.split(',')
|
|
142
142
|
.join(', ');
|
|
143
143
|
console.log(chalk.red('Error:') +
|
|
144
|
-
` this account signs in with ${chalk.bold(providers)}
|
|
144
|
+
` this account signs in with ${chalk.bold(providers)}. There's no password to use here.`);
|
|
145
145
|
console.log('\nAuthenticate one of these ways instead:');
|
|
146
146
|
console.log(' ' + chalk.bold('maritime login') + chalk.dim(' open the browser and approve'));
|
|
147
147
|
console.log(' ' + chalk.bold('maritime login --token <token>') + chalk.dim(` paste a token from ${APP_URL}/cli/auth`));
|
package/dist/commands/message.js
CHANGED
|
@@ -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
|
|
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
|
|
38
|
+
fail(`Agent ${agent.name} has no project. Recreate it or use \`maritime chat\`.`, {
|
|
39
39
|
code: 'no_project',
|
|
40
40
|
});
|
|
41
41
|
}
|
package/dist/commands/status.js
CHANGED
|
@@ -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`);
|
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
|
|
9
|
-
*
|
|
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
|
|
9
|
-
*
|
|
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
|
@@ -28,7 +28,6 @@ import { messageCommand } from './commands/message.js';
|
|
|
28
28
|
import { historyCommand } from './commands/history.js';
|
|
29
29
|
import { triggersCommand } from './commands/triggers.js';
|
|
30
30
|
import { blueprintCommand } from './commands/blueprint.js';
|
|
31
|
-
import { scaleCommand } from './commands/scale.js';
|
|
32
31
|
import { sleepCommand } from './commands/sleep.js';
|
|
33
32
|
import { checkForUpdates, printUpdateNotice, versionCheckSettled } from './version-check.js';
|
|
34
33
|
import { guideCommand } from './commands/guide.js';
|
|
@@ -88,7 +87,6 @@ program.addCommand(startCommand, HIDDEN);
|
|
|
88
87
|
program.addCommand(stopCommand, HIDDEN);
|
|
89
88
|
program.addCommand(restartCommand, HIDDEN);
|
|
90
89
|
program.addCommand(sleepCommand, HIDDEN);
|
|
91
|
-
program.addCommand(scaleCommand, HIDDEN);
|
|
92
90
|
program.addCommand(execCommand, HIDDEN);
|
|
93
91
|
program.addCommand(infoCommand, HIDDEN);
|
|
94
92
|
program.addCommand(historyCommand, HIDDEN);
|
|
@@ -102,7 +100,7 @@ program.addHelpText('after', `
|
|
|
102
100
|
Quickstart (a directory is an agent):
|
|
103
101
|
maritime init my-agent create + link this folder to an agent
|
|
104
102
|
maritime chat "hello" talk to the linked agent (no name needed)
|
|
105
|
-
maritime deploy push maritime.json changes (persona
|
|
103
|
+
maritime deploy push maritime.json changes (persona)
|
|
106
104
|
maritime logs · status · env · open all act on the linked agent
|
|
107
105
|
|
|
108
106
|
For scripts & AI agents:
|
package/dist/interactive.js
CHANGED
|
@@ -16,14 +16,13 @@ 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
|
|
20
|
-
{ name: 'scale', value: 'scale', description: 'Change agent tier', needsAgent: true },
|
|
19
|
+
{ name: 'blueprint', value: 'blueprint', description: 'Manage templates', needsAgent: false },
|
|
21
20
|
{ name: 'open', value: 'open', description: 'Open agent in browser', needsAgent: true },
|
|
22
21
|
{ name: 'whoami', value: 'whoami', description: 'Show current user', needsAgent: false },
|
|
23
22
|
{ name: 'logout', value: 'logout', description: 'Log out', needsAgent: false },
|
|
24
23
|
];
|
|
25
24
|
export async function runInteractive() {
|
|
26
|
-
console.log(chalk.hex('#8B5CF6')('\n Maritime') + chalk.dim('
|
|
25
|
+
console.log(chalk.hex('#8B5CF6')('\n Maritime') + chalk.dim(' · interactive mode\n'));
|
|
27
26
|
const command = await select({
|
|
28
27
|
message: 'What would you like to do?',
|
|
29
28
|
choices: COMMANDS.map((c) => ({
|
package/dist/resolve.d.ts
CHANGED