@oalo-ai/cli 0.4.2 → 0.4.3
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/man/oalo.1 +95 -15
- package/package.json +1 -1
- package/plugin/skills/oalo/SKILL.md +30 -7
- package/src/commands/bots.js +3 -1
- package/src/commands/call.js +66 -16
- package/src/commands/graphs.js +18 -7
- package/src/commands/switches.js +28 -10
- package/src/coord-release.json +9 -9
- package/src/data.js +11 -3
- package/src/graphfiles.js +44 -1
- package/src/help.js +68 -16
- package/src/mcp/tools.js +17 -17
- package/src/workspace.js +4 -3
package/src/commands/switches.js
CHANGED
|
@@ -21,7 +21,7 @@ export async function loops(flags, rest, opts = {}) {
|
|
|
21
21
|
if (sub === "runs") return runs(flags, name, opts);
|
|
22
22
|
if (sub === "list") return list(flags, opts);
|
|
23
23
|
if (!["test", "on", "off", "delete"].includes(sub) || !name) {
|
|
24
|
-
return fail("usage: oalo loops list, oalo loops test|on|off|delete <name>, or oalo loops runs [<name>] [--id <run>]", 2);
|
|
24
|
+
return fail("usage: oalo loops list, oalo loops test|on|off|delete <name>, or oalo loops runs [<name>] [--id <run>]", 2, flags);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
let input;
|
|
@@ -29,11 +29,11 @@ export async function loops(flags, rest, opts = {}) {
|
|
|
29
29
|
try {
|
|
30
30
|
input = readInput(flags.input);
|
|
31
31
|
} catch (e) {
|
|
32
|
-
return fail(e.message, 2);
|
|
32
|
+
return fail(e.message, 2, flags);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
if (flags.sample !== undefined && !["latest", "example"].includes(flags.sample)) {
|
|
36
|
-
return fail("--sample is latest or example", 2);
|
|
36
|
+
return fail("--sample is latest or example", 2, flags);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return withChannel(flags, opts, async (ch) => {
|
|
@@ -60,7 +60,7 @@ export async function loops(flags, rest, opts = {}) {
|
|
|
60
60
|
export async function flows(flags, rest, opts = {}) {
|
|
61
61
|
const [, sub, bot, flow] = rest;
|
|
62
62
|
if (!["on", "off", "delete"].includes(sub) || !bot || !flow) {
|
|
63
|
-
return fail("usage: oalo flows on|off|delete <bot> <flow> (bot: its public id; flow: its name or id)", 2);
|
|
63
|
+
return fail("usage: oalo flows on|off|delete <bot> <flow> (bot: its public id; flow: its name or id)", 2, flags);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return withChannel(flags, opts, async (ch) => {
|
|
@@ -96,7 +96,7 @@ async function runs(flags, name, opts) {
|
|
|
96
96
|
const r = await ch.call("loops:get_run", { run_id: Number(flags.id) });
|
|
97
97
|
if (flags.json) return void console.log(JSON.stringify(r, null, 2));
|
|
98
98
|
const run = r.run || {};
|
|
99
|
-
console.log(`${run.name} run ${run.id}: ${run.status}${run.error ? `: ${oneLine(run.error)}` : ""} ${dim(`(${run.trigger || "?"}, ${
|
|
99
|
+
console.log(`${run.name} run ${run.id}: ${run.status}${run.error ? `: ${oneLine(run.error)}` : ""} ${dim(`(${run.trigger || "?"}, ${utc(run.started_at, true)})`)}`);
|
|
100
100
|
for (const n of r.nodes || []) {
|
|
101
101
|
console.log(` ${n.node_id} ${dim(`(${n.node_type}${n.status ? `, ${n.status}` : ""})`)}`);
|
|
102
102
|
const out = n.error || n.output;
|
|
@@ -109,7 +109,7 @@ async function runs(flags, name, opts) {
|
|
|
109
109
|
if (flags.json) return void console.log(JSON.stringify(r.runs, null, 2));
|
|
110
110
|
if (!r.runs?.length) return void console.log(name ? `no runs of ${name} yet` : "no loop runs yet");
|
|
111
111
|
for (const x of r.runs) {
|
|
112
|
-
const when =
|
|
112
|
+
const when = utc(x.started_at);
|
|
113
113
|
const test = x.rehearsal ? ", test" : "";
|
|
114
114
|
console.log(`${String(x.id).padEnd(7)} ${x.name} ${x.status}${x.error ? dim(`: ${oneLine(x.error).slice(0, 120)}`) : ""} ${dim(`${when}, ${x.trigger}${test}`)}`);
|
|
115
115
|
}
|
|
@@ -129,6 +129,19 @@ function printTest(r) {
|
|
|
129
129
|
if (r.final_output !== undefined && r.final_output !== null) console.log(`output: ${oneLine(r.final_output)}`);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
/**
|
|
133
|
+
* A run's start time as "2026-11-07 08:00 UTC" (with seconds when asked). The
|
|
134
|
+
* server's times are UTC; one without a zone is read as UTC too.
|
|
135
|
+
*/
|
|
136
|
+
export function utc(ts, seconds = false) {
|
|
137
|
+
if (!ts) return "?";
|
|
138
|
+
const s = String(ts);
|
|
139
|
+
const zoned = /(Z|[+-]\d\d:?\d\d)$/i.test(s);
|
|
140
|
+
const d = new Date(zoned ? s : `${s}Z`);
|
|
141
|
+
if (Number.isNaN(d.getTime())) return s;
|
|
142
|
+
return `${d.toISOString().slice(0, seconds ? 19 : 16).replace("T", " ")} UTC`;
|
|
143
|
+
}
|
|
144
|
+
|
|
132
145
|
function oneLine(v) {
|
|
133
146
|
const text = typeof v === "string" ? v : JSON.stringify(v);
|
|
134
147
|
return text.length > 300 ? text.slice(0, 300) + "..." : text;
|
|
@@ -154,20 +167,25 @@ async function pinnedApp(ch, flags) {
|
|
|
154
167
|
async function withChannel(flags, opts, fn) {
|
|
155
168
|
const cfg = resolveConfig(flags);
|
|
156
169
|
const { url, token } = controlPlane(cfg);
|
|
157
|
-
if (!url || !token) return fail(`this needs a CLI token.\n\n${HOW_TO_CONNECT}`, 2);
|
|
170
|
+
if (!url || !token) return fail(`this needs a CLI token.\n\n${HOW_TO_CONNECT}`, 2, flags);
|
|
158
171
|
|
|
159
172
|
const ch = (opts.channel || ((o) => new OaloChannel(o)))({ url, token });
|
|
160
173
|
try {
|
|
161
174
|
await ch.connect();
|
|
162
175
|
await fn(ch);
|
|
163
176
|
} catch (e) {
|
|
164
|
-
fail(e.message, 1);
|
|
177
|
+
fail(e.message, 1, flags, e.code);
|
|
165
178
|
} finally {
|
|
166
179
|
ch.close();
|
|
167
180
|
}
|
|
168
181
|
}
|
|
169
182
|
|
|
170
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Print an error and set the exit code. Under --json it is also printed to
|
|
185
|
+
* stdout as {"error", "code"?}, so a program reading stdout sees why it failed.
|
|
186
|
+
*/
|
|
187
|
+
function fail(message, exitCode, flags = {}, code = undefined) {
|
|
171
188
|
console.error(message);
|
|
172
|
-
|
|
189
|
+
if (flags.json) console.log(JSON.stringify({ error: message, ...(code ? { code } : {}) }));
|
|
190
|
+
process.exitCode = exitCode;
|
|
173
191
|
}
|
package/src/coord-release.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.4.
|
|
2
|
+
"version": "0.4.3",
|
|
3
3
|
"targets": {
|
|
4
4
|
"darwin-arm64": {
|
|
5
5
|
"file": "oalo-coord-darwin-arm64.gz",
|
|
6
|
-
"sha256": "
|
|
7
|
-
"bytes":
|
|
6
|
+
"sha256": "cc0685ae983b04ca73fe8451c64ced465a894e15385ec10a9dc3be2ecf4d356c",
|
|
7
|
+
"bytes": 24853827
|
|
8
8
|
},
|
|
9
9
|
"darwin-x64": {
|
|
10
10
|
"file": "oalo-coord-darwin-x64.gz",
|
|
11
|
-
"sha256": "
|
|
12
|
-
"bytes":
|
|
11
|
+
"sha256": "565c6ca3d5c783625ce4e45ce3369e1c04d09c539225b291ff5c18abd4e891eb",
|
|
12
|
+
"bytes": 26992076
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"file": "oalo-coord-linux-x64.gz",
|
|
16
|
-
"sha256": "
|
|
17
|
-
"bytes":
|
|
16
|
+
"sha256": "a7fdc3119120ea386f1e748d31cf29530e7f7edb4d65f0c32f7dcd19e8552e8f",
|
|
17
|
+
"bytes": 36884995
|
|
18
18
|
},
|
|
19
19
|
"linux-arm64": {
|
|
20
20
|
"file": "oalo-coord-linux-arm64.gz",
|
|
21
|
-
"sha256": "
|
|
22
|
-
"bytes":
|
|
21
|
+
"sha256": "6e088ca338ccef4bff2f01fb5ceb2de3e127946c9d4c17685771922074968daa",
|
|
22
|
+
"bytes": 37125644
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
package/src/data.js
CHANGED
|
@@ -330,7 +330,9 @@ const defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
|
330
330
|
* Saved per workspace with the tables it covers. When a write needs a table it
|
|
331
331
|
* doesn't cover, a new token is made for the old tables plus the new one and
|
|
332
332
|
* the old token is revoked, so there is one write token per workspace, limited
|
|
333
|
-
* to the tables this machine has written. It expires after 30 days.
|
|
333
|
+
* to the tables this machine has written. It expires after 30 days. Every use
|
|
334
|
+
* logs the tables it covers, since any project on this machine may have
|
|
335
|
+
* widened it.
|
|
334
336
|
*
|
|
335
337
|
* `channel` is a connected OaloChannel on the CLI token. `log` reports what was
|
|
336
338
|
* created, since making a credential should never be silent.
|
|
@@ -339,7 +341,12 @@ export async function writeTokenFor(serverUrl, tables, channel, { log = () => {}
|
|
|
339
341
|
const saved = readEntry(serverUrl)?.sync_write;
|
|
340
342
|
const covered = new Set(saved?.tables || []);
|
|
341
343
|
const live = saved?.token && (!saved.expires_at || Date.parse(saved.expires_at) > now + 60_000);
|
|
342
|
-
|
|
344
|
+
// The token is shared by every project on this machine for this workspace,
|
|
345
|
+
// so say what it can write each time it is used.
|
|
346
|
+
if (live && tables.every((t) => covered.has(t))) {
|
|
347
|
+
log(`write token covers: ${[...covered].sort().join(", ")}`);
|
|
348
|
+
return saved.token;
|
|
349
|
+
}
|
|
343
350
|
|
|
344
351
|
const all = [...new Set([...(live ? covered : []), ...tables])].sort();
|
|
345
352
|
const expires_at = new Date(now + WRITE_TOKEN_DAYS * 86_400_000).toISOString();
|
|
@@ -351,7 +358,8 @@ export async function writeTokenFor(serverUrl, tables, channel, { log = () => {}
|
|
|
351
358
|
if (!minted?.token) throw new Error("the workspace did not return a token");
|
|
352
359
|
|
|
353
360
|
writeToken({ serverUrl, appId: null }, minted.token, "sync_write", { id: minted.id, tables: all, expires_at });
|
|
354
|
-
|
|
361
|
+
const until = `(expires ${expires_at.slice(0, 10)}). See it with \`oalo tokens list\`.`;
|
|
362
|
+
log(live ? `widened the write token. It covers: ${all.join(", ")} ${until}` : `made a write token for ${all.join(", ")} ${until}`);
|
|
355
363
|
|
|
356
364
|
if (saved?.id && saved.id !== minted.id) {
|
|
357
365
|
try {
|
package/src/graphfiles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { readFileSync, writeFileSync, mkdirSync, readdirSync, existsSync, unlinkSync } from "node:fs";
|
|
2
|
+
import { readFileSync, writeFileSync, mkdirSync, readdirSync, existsSync, unlinkSync, statSync } from "node:fs";
|
|
3
3
|
import { join, dirname, relative } from "node:path";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,6 +30,7 @@ export const ROOT = ".oalo";
|
|
|
30
30
|
export const FLOW_FIELDS = [
|
|
31
31
|
"name",
|
|
32
32
|
"description",
|
|
33
|
+
"goal",
|
|
33
34
|
"enabled",
|
|
34
35
|
"trigger",
|
|
35
36
|
"trigger_instructions",
|
|
@@ -101,6 +102,10 @@ export const catalogPath = (surface, cwd = process.cwd()) => join(cwd, ROOT, "ca
|
|
|
101
102
|
/** A flow as the server returned it -> the file we keep. */
|
|
102
103
|
export function flowFile(remote, bot) {
|
|
103
104
|
const flow = pick(remote, FLOW_FIELDS);
|
|
105
|
+
// The server sends a Decimal as a string ("0.50"); keep the file a number.
|
|
106
|
+
if (typeof flow.max_cost_usd === "string" && flow.max_cost_usd.trim() !== "" && Number.isFinite(Number(flow.max_cost_usd))) {
|
|
107
|
+
flow.max_cost_usd = Number(flow.max_cost_usd);
|
|
108
|
+
}
|
|
104
109
|
return { $about: ABOUT.flow, kind: "flow", bot, id: remote.id, version: remote.version ?? null, base_hash: hashOf(flow), flow };
|
|
105
110
|
}
|
|
106
111
|
|
|
@@ -264,6 +269,44 @@ export function removeFile(path) {
|
|
|
264
269
|
// aid, not a file to push.
|
|
265
270
|
const isGraphFile = (f) => f.endsWith(".json") && !f.endsWith(".server.json");
|
|
266
271
|
|
|
272
|
+
/**
|
|
273
|
+
* The files a command was given, with each directory expanded to the flow,
|
|
274
|
+
* loop and tool files anywhere inside it (`oalo lint .oalo/loops`). A JSON
|
|
275
|
+
* file in a directory that isn't one (a node catalog) is skipped; one that
|
|
276
|
+
* doesn't parse is kept, so the command reports it. Files named directly are
|
|
277
|
+
* kept as they are.
|
|
278
|
+
*/
|
|
279
|
+
export function expandTargets(paths) {
|
|
280
|
+
const out = [];
|
|
281
|
+
for (const p of paths) {
|
|
282
|
+
if (existsSync(p) && statSync(p).isDirectory()) out.push(...graphFilesIn(p));
|
|
283
|
+
else out.push(p);
|
|
284
|
+
}
|
|
285
|
+
return [...new Set(out)];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const SKIP_DIRS = new Set(["node_modules", ".git"]);
|
|
289
|
+
|
|
290
|
+
function graphFilesIn(dir) {
|
|
291
|
+
const out = [];
|
|
292
|
+
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
293
|
+
const p = join(dir, e.name);
|
|
294
|
+
if (e.isDirectory()) {
|
|
295
|
+
if (!SKIP_DIRS.has(e.name)) out.push(...graphFilesIn(p));
|
|
296
|
+
} else if (e.isFile() && isGraphFile(e.name)) {
|
|
297
|
+
let kind;
|
|
298
|
+
try {
|
|
299
|
+
kind = JSON.parse(readFileSync(p, "utf8"))?.kind;
|
|
300
|
+
} catch {
|
|
301
|
+
out.push(p);
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (["flow", "loop", "tool"].includes(kind)) out.push(p);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return out.sort();
|
|
308
|
+
}
|
|
309
|
+
|
|
267
310
|
/** Every flow and loop file under .oalo/, as absolute paths. */
|
|
268
311
|
export function listGraphFiles(cwd = process.cwd()) {
|
|
269
312
|
const out = [];
|
package/src/help.js
CHANGED
|
@@ -63,6 +63,7 @@ export const COMMANDS = [
|
|
|
63
63
|
{
|
|
64
64
|
name: "link",
|
|
65
65
|
summary: "Point this project at a workspace and save credentials.",
|
|
66
|
+
env: "Sets the project's default env, `env` in .oalo/config.json: --env dev (staging, the default) or prod (live). Running link again without --env sets it back to dev. Only data, db query, db tables, deploy, env, logs, run loop and typegen read it.",
|
|
66
67
|
usage: [
|
|
67
68
|
"oalo link --server <url> [--token <sync token>] [--cli-token <token>] [--app <slug>] [--env dev|prod] [--no-skill]",
|
|
68
69
|
"oalo link --status",
|
|
@@ -72,7 +73,7 @@ export const COMMANDS = [
|
|
|
72
73
|
{ flag: "--token <token>", desc: "Sync token (data plane). Not needed after oalo login, which saved one." },
|
|
73
74
|
{ flag: "--cli-token <token>", desc: "CLI token (control plane), for tail and mcp. Optional." },
|
|
74
75
|
{ flag: "--app <slug>", desc: "The app that deploy, env, logs, secrets and dockerfile use when you don't pass --app (`oalo apps` lists them). `oalo deploy --new` sets it." },
|
|
75
|
-
{ flag: "--env dev|prod", desc: "
|
|
76
|
+
{ flag: "--env dev|prod", desc: "The project's default env for the commands that read it. Default dev." },
|
|
76
77
|
{ flag: "--status", desc: "Show the current link and re-check reachability." },
|
|
77
78
|
{ flag: "--no-skill", desc: "Don't install or refresh the Oalo skill for coding agents (see `oalo skill`)." },
|
|
78
79
|
],
|
|
@@ -86,8 +87,10 @@ export const COMMANDS = [
|
|
|
86
87
|
{
|
|
87
88
|
name: "typegen",
|
|
88
89
|
summary: "Generate TypeScript bindings from the workspace's own schema: its models, and the workflows apps can call.",
|
|
89
|
-
|
|
90
|
+
env: "--env dev|prod, else the project's env (`oalo link --env`), else dev. It is stamped in the file's header, and --dart writes it into .oalo/dart-defines.json as OALO_ENV.",
|
|
91
|
+
usage: ["oalo typegen [--out <file>] [--check] [--env dev|prod]", "oalo typegen --dart [--out <project dir>] [--check] [--env dev|prod]"],
|
|
90
92
|
flags: [
|
|
93
|
+
{ flag: "--env dev|prod", desc: "Which env to read. Default: the project's, else dev." },
|
|
91
94
|
{ flag: "--out <file>", desc: "Output path. Default oalo.generated.ts. With --dart, the Flutter project's root (default the current folder)." },
|
|
92
95
|
{ flag: "--dart", desc: "For a Flutter app from Oalo's template: write lib/sync/generated and lib/models (the Base's own Dart generator, the one the box uses), and .oalo/dart-defines.json with the Base's address, the linked app's slug and the env, for `flutter run --dart-define-from-file=.oalo/dart-defines.json`." },
|
|
93
96
|
{ flag: "--check", desc: "Do not write; exit non-zero if the file is stale or missing. For CI." },
|
|
@@ -124,7 +127,8 @@ export const COMMANDS = [
|
|
|
124
127
|
{
|
|
125
128
|
name: "call",
|
|
126
129
|
summary: "Call any build-surface event directly. The escape hatch.",
|
|
127
|
-
|
|
130
|
+
env: "Doesn't add the project's env. An event that takes one reads only \"env\" in the params, with its own default: booking:* and metrics:query use prod, loops:run_now dev. For a draft bot's booking setup, pass \"env\": \"dev\".",
|
|
131
|
+
usage: ["oalo call <event> ['<json params>' | @file.json | -]", "oalo call --list [text] [--json]"],
|
|
128
132
|
flags: [
|
|
129
133
|
{ flag: "--list [text]", desc: "List the events you can call, from the workspace. With text, the matching events and the params each accepts." },
|
|
130
134
|
{ flag: "--namespaces", desc: "The events you may call, counted per namespace (what `--list` with no text shows)." },
|
|
@@ -133,9 +137,11 @@ export const COMMANDS = [
|
|
|
133
137
|
notes: [
|
|
134
138
|
"The build surface has ~500 events. First-class commands cover the common ones; this reaches the rest without a command per feature.",
|
|
135
139
|
"Params are a JSON object. Org and user identity come from your token, never the params, so a call cannot exceed what you can do.",
|
|
140
|
+
"Params can be inline JSON, @file.json to read that file, or - to read stdin. With no params and input piped in, stdin is read.",
|
|
136
141
|
"--list comes from the server's own handlers and is filtered to what you may call, so it never goes stale. On an older workspace it falls back to a list of namespaces.",
|
|
137
142
|
"An unknown event returns a clean error naming what you sent. An event that exists but gets the wrong params says which params it takes.",
|
|
138
143
|
"Example: oalo call loops:run_now '{\"name\":\"Nurture\"}'",
|
|
144
|
+
"From a file: oalo call loops:get @params.json. From stdin: jq -n '{name: \"Nurture\"}' | oalo call loops:get",
|
|
139
145
|
"Needs a CLI token.",
|
|
140
146
|
],
|
|
141
147
|
exits: { 0: "the call succeeded", 1: "the call failed or was rejected", 2: "bad arguments or no token" },
|
|
@@ -143,11 +149,12 @@ export const COMMANDS = [
|
|
|
143
149
|
{
|
|
144
150
|
name: "run",
|
|
145
151
|
summary: "Fire a loop, or send a bot a test message, and watch what happens.",
|
|
152
|
+
env: "loop: --env dev|prod, else the project's env, else dev (a loop fired by its real trigger or schedule runs on prod). bot: no --env; the bot uses its own env, dev while it's a draft, prod once published.",
|
|
146
153
|
usage: ['oalo run loop <name> [--env dev|prod] [--watch]', 'oalo run bot <id> "<message>"'],
|
|
147
154
|
flags: [
|
|
148
155
|
{ flag: "--watch", desc: "Stream events after firing. Default on for bots." },
|
|
149
156
|
{ flag: "--timeout <s>", desc: "How long to watch. Default 30." },
|
|
150
|
-
{ flag: "--env dev|prod", desc: "
|
|
157
|
+
{ flag: "--env dev|prod", desc: "loop: which env's data it runs on. Default: the project's, else dev." },
|
|
151
158
|
{ flag: "--app <slug>", desc: "Only for a loop pinned to one app: that app's slug (`oalo apps`) or id. Loops are org-wide by default." },
|
|
152
159
|
],
|
|
153
160
|
notes: [
|
|
@@ -160,6 +167,7 @@ export const COMMANDS = [
|
|
|
160
167
|
{
|
|
161
168
|
name: "emit",
|
|
162
169
|
summary: "Fire a domain event (form.submitted, order.created, ...) to test a loop's trigger.",
|
|
170
|
+
env: "No --env. The loops it fires run on prod (live data), as they do for a real event. To try a loop on dev data, use `oalo loops test`.",
|
|
163
171
|
usage: ["oalo emit <event type> [--payload '<json>'] [--contact <id>] [--dry-run] [--json]", "oalo emit --list [--json]"],
|
|
164
172
|
flags: [
|
|
165
173
|
{ flag: "--payload <json>", desc: "The event's payload, a JSON object. `oalo emit --list` shows each event's fields." },
|
|
@@ -179,6 +187,7 @@ export const COMMANDS = [
|
|
|
179
187
|
{
|
|
180
188
|
name: "data",
|
|
181
189
|
summary: "Models and rows in this workspace: list, read, push (bulk upsert), delete, watch, promote, and make tables searchable by bots.",
|
|
190
|
+
env: "--env dev|prod, else the project's env (`oalo link --env`), else dev. push and delete write prod only with --env prod typed out. models create makes the model in both; promote copies its rows dev to prod; events fire on prod rows only; vectorize and keep-from-ai cover both envs of a model, and only the --env copy of a plain table.",
|
|
182
191
|
usage: [
|
|
183
192
|
"oalo data models [--json]",
|
|
184
193
|
"oalo data models create <name> --field name:type [--field ...] [--owned-by <field>]",
|
|
@@ -216,8 +225,9 @@ export const COMMANDS = [
|
|
|
216
225
|
{ flag: "--json", desc: "Print the reply as JSON." },
|
|
217
226
|
],
|
|
218
227
|
notes: [
|
|
219
|
-
"dev is a sandbox; live apps read prod. Push to dev, check it, then `oalo data promote <table>` copies dev rows to prod.",
|
|
228
|
+
"dev is a sandbox; live apps and published bots read prod, draft bots read dev. Push to dev, check it, then `oalo data promote <table>` copies dev rows to prod.",
|
|
220
229
|
"Reads use the saved data token (read-only). Row writes use a write token limited to the tables written, made as you over the CLI token the first time you write a table and saved beside it (`oalo tokens list` shows it; it expires in 30 days).",
|
|
230
|
+
"That write token is shared by every project on this machine for the workspace: writing a new table widens it to cover that table too. push and delete print the tables it covers.",
|
|
221
231
|
"models create and promote run as you over the CLI token, so they follow your dashboard access.",
|
|
222
232
|
"push sends up to 1,000 rows per request, waits out the rate limit (120 writes a minute), retries network errors, and lists rows the server rejected.",
|
|
223
233
|
"Every write syncs to apps on that schema at once. A delete marks the row deleted; it leaves synced apps.",
|
|
@@ -231,6 +241,7 @@ export const COMMANDS = [
|
|
|
231
241
|
{
|
|
232
242
|
name: "incidents",
|
|
233
243
|
summary: "A live app's outages and restart bursts, as Oalo's uptime check saw them, newest first.",
|
|
244
|
+
env: "prod (the live app) only. The preview isn't checked; `oalo logs` shows it.",
|
|
234
245
|
usage: ["oalo incidents [--app <slug>] [--all] [--json]"],
|
|
235
246
|
flags: [
|
|
236
247
|
{ flag: "--app <slug>", desc: "The app. Default: the one saved with `oalo link --app`." },
|
|
@@ -246,6 +257,7 @@ export const COMMANDS = [
|
|
|
246
257
|
{
|
|
247
258
|
name: "db",
|
|
248
259
|
summary: "Read an env's tables with SQL (your app's own included), dump all of an env's data as plain SQL to keep or take anywhere, or load an existing Postgres database into an env.",
|
|
260
|
+
env: "query and tables: --env dev|prod, else the project's env, else dev. dump: --env, default prod, whatever the project's env is. restore: --env is required.",
|
|
249
261
|
usage: [
|
|
250
262
|
'oalo db query "<sql>" [--env dev|prod] [--limit <n>] [--json]',
|
|
251
263
|
"oalo db tables [--env dev|prod]",
|
|
@@ -254,7 +266,7 @@ export const COMMANDS = [
|
|
|
254
266
|
"oalo db restore --from-env <VAR> --env dev|prod [--schema <name>] [--check] [--yes]",
|
|
255
267
|
],
|
|
256
268
|
flags: [
|
|
257
|
-
{ flag: "--env dev|prod", desc: "query, tables: which env. Default the project's
|
|
269
|
+
{ flag: "--env dev|prod", desc: "query, tables: which env. Default the project's, else dev. dump: which env's data. Default prod. restore: which env the data goes into, always on the command line." },
|
|
258
270
|
{ flag: "--limit <n>", desc: "query: rows to show. Default 100, at most 1000." },
|
|
259
271
|
{ flag: "--json", desc: "query: {columns, rows, truncated} as JSON." },
|
|
260
272
|
{ flag: "--out <file.sql>", desc: "Where to write it. Default <workspace>-<env>-<date>.sql here." },
|
|
@@ -283,6 +295,7 @@ export const COMMANDS = [
|
|
|
283
295
|
{
|
|
284
296
|
name: "metrics",
|
|
285
297
|
summary: "A number from the workspace's data: count, sum or average over a model's rows, events or contacts, grouped or over time.",
|
|
298
|
+
env: "A model's rows: prod (live) unless you pass --env dev. The project's env is not read. Events and contacts have one copy, not one per env.",
|
|
286
299
|
usage: [
|
|
287
300
|
"oalo metrics <model | events | contacts> [--sum|--avg|--min|--max|--distinct <field>] [--by <field>] [--every day|week|month] [--days N] [--where <filter>] [--json]",
|
|
288
301
|
],
|
|
@@ -299,7 +312,7 @@ export const COMMANDS = [
|
|
|
299
312
|
{ flag: "--event <type>", desc: "events: one type, like order.created. Default: every type." },
|
|
300
313
|
{ flag: "--time <created|changed|field>", desc: "A model row counts at when it was created (default), last changed, or one of its date fields." },
|
|
301
314
|
{ flag: "--compare", desc: "Also the same over the window before (needs --days)." },
|
|
302
|
-
{ flag: "--env dev|prod", desc: "A model's live (default) or dev data." },
|
|
315
|
+
{ flag: "--env dev|prod", desc: "A model's live (prod, the default) or dev data. To count rows a test or a draft bot wrote, pass --env dev." },
|
|
303
316
|
{ flag: "--json", desc: "The answer as JSON." },
|
|
304
317
|
],
|
|
305
318
|
notes: [
|
|
@@ -311,6 +324,7 @@ export const COMMANDS = [
|
|
|
311
324
|
{
|
|
312
325
|
name: "dashboards",
|
|
313
326
|
summary: "The workspace's dashboards, and a chart put on one (made when no dashboard has that name).",
|
|
327
|
+
env: "add: a chart over a model reads prod (live) unless you pass --env dev, and keeps reading that env. The project's env is not read. Event, contact and funnel charts have one copy.",
|
|
314
328
|
usage: [
|
|
315
329
|
"oalo dashboards [--json]",
|
|
316
330
|
'oalo dashboards add <dashboard> <model | events | contacts> --title "<title>" --kind number|line|bars|table [metrics flags] [--app <slug>] [--width 1|2|3]',
|
|
@@ -326,13 +340,14 @@ export const COMMANDS = [
|
|
|
326
340
|
],
|
|
327
341
|
notes: [
|
|
328
342
|
"add runs the query first and refuses one that can't draw, then prints its numbers. It changes what everyone with access sees.",
|
|
329
|
-
"The flags after the model are the same as oalo metrics.",
|
|
343
|
+
"The flags after the model are the same as oalo metrics, --env included.",
|
|
330
344
|
],
|
|
331
345
|
exits: { 0: "done", 1: "the request failed", 2: "bad arguments or no CLI token" },
|
|
332
346
|
},
|
|
333
347
|
{
|
|
334
348
|
name: "products",
|
|
335
349
|
summary: "What the workspace sells (Oalo commerce on its own Stripe account): list, create, rename, change a price, archive, and see orders.",
|
|
350
|
+
env: "Not dev or prod: a product is on your Stripe test key, or on the live key with --live. --env does nothing here.",
|
|
336
351
|
usage: [
|
|
337
352
|
"oalo products [--all] [--json]",
|
|
338
353
|
'oalo products create <id> --name "<name>" --price <amount> --once|--monthly|--yearly [--trial <days>] [--currency <code>] [--description <text>] [--live] [--yes]',
|
|
@@ -445,6 +460,7 @@ export const COMMANDS = [
|
|
|
445
460
|
{
|
|
446
461
|
name: "sources",
|
|
447
462
|
summary: "Feeds that send Oalo rows from outside (another system, a webhook, an export), keeping only the fields you choose.",
|
|
463
|
+
env: "create: rows go to prod (live) unless you pass --env dev, and the source keeps that env (list and show name it). The project's env is not read. A --bot source has no env: its documents are live at once.",
|
|
448
464
|
usage: [
|
|
449
465
|
"oalo sources [list] [--json]",
|
|
450
466
|
"oalo sources create <name> --from <sample.csv|.json|.jsonl> [--table <new model>] [--id-field <field>] [--mode upsert|snapshot] [--auth bearer|hmac|url] [--env dev|prod]",
|
|
@@ -475,7 +491,7 @@ export const COMMANDS = [
|
|
|
475
491
|
{ flag: "--id-field <field>", desc: "create: the field that identifies a record (default id). A record sent again updates its row." },
|
|
476
492
|
{ flag: "--mode snapshot", desc: "create: each upload is the whole set, and rows it leaves out are deleted. Only for a model the source makes. Default upsert." },
|
|
477
493
|
{ flag: "--auth bearer|hmac|url", desc: "create: how a sender proves it's allowed. bearer (default): Authorization: Bearer <secret>. hmac: a signature header over the raw body (--hmac-header, default x-signature; --hmac-format sha256=hex, hex or base64), for tools that sign their webhooks. url: the secret is the last part of the address, for tools that can only send to an address." },
|
|
478
|
-
{ flag: "--env dev|prod", desc: "create: which copy of the
|
|
494
|
+
{ flag: "--env dev|prod", desc: "create: which env's copy of the table the rows go to. Default prod, whatever the project's env is." },
|
|
479
495
|
{ flag: "--every <minutes>", desc: "fetch: how often Oalo fetches the address, 5 to 10080 minutes. Default 60." },
|
|
480
496
|
{ flag: "--header <value>", desc: "fetch: a request header, \"Name: value\" (an API key, say: --header \"Authorization: Bearer $KEY\"). Repeat it for more, up to 10. Sealed on the server; show prints only the names. Left out, the ones set before stay; --header \"\" clears them." },
|
|
481
497
|
{ flag: "--records-at <path>", desc: "fetch, a table's source: the records are the list at this key of the JSON answer (data.items)." },
|
|
@@ -503,6 +519,7 @@ export const COMMANDS = [
|
|
|
503
519
|
{
|
|
504
520
|
name: "bots",
|
|
505
521
|
summary: "The workspace's bots: the tables each can search, and every setting (knowledge, memory, model, replies, limits).",
|
|
522
|
+
env: "No --env. A bot's status (shown by `oalo bots`) picks its env: a draft searches dev tables and books against dev booking data, a published bot uses prod. Load a draft bot's data in dev.",
|
|
506
523
|
usage: [
|
|
507
524
|
"oalo bots [--json]",
|
|
508
525
|
"oalo bots knowledge <bot> [--json]",
|
|
@@ -534,6 +551,7 @@ export const COMMANDS = [
|
|
|
534
551
|
{
|
|
535
552
|
name: "tokens",
|
|
536
553
|
summary: "List, create and revoke the workspace's sync tokens, for an app's own server.",
|
|
554
|
+
env: "A token with env:dev or env:prod is locked to that env. Without one it can use either, and a Sync API request that doesn't pass ?env= gets prod.",
|
|
537
555
|
usage: [
|
|
538
556
|
"oalo tokens list [--json]",
|
|
539
557
|
"oalo tokens create --name <name> --scope write:<table> [--scope ...] [--days N] [--json]",
|
|
@@ -577,6 +595,7 @@ export const COMMANDS = [
|
|
|
577
595
|
{
|
|
578
596
|
name: "deploy",
|
|
579
597
|
summary: "Send this repo's commits to an app and run them: the preview (dev) by default, the live release with --env prod.",
|
|
598
|
+
env: "--env dev (the preview, the default) or prod (the live release). It follows the project's env, but prod must be typed as --env prod. --new always starts on dev and sets the project's env to dev.",
|
|
580
599
|
usage: [
|
|
581
600
|
"oalo deploy [--app <slug>] [--env dev|prod] [--allow-dirty] [--json]",
|
|
582
601
|
"oalo deploy --new [<name>] [--name \"Display name\"]",
|
|
@@ -615,6 +634,7 @@ export const COMMANDS = [
|
|
|
615
634
|
{
|
|
616
635
|
name: "migrate",
|
|
617
636
|
summary: "Move an app from Heroku, Railway, Render, Fly.io or Primcloud: its Procfile, sizes, health path and variables, worked out from its files and that platform's CLI.",
|
|
637
|
+
env: "--apply sets the variables on prod (the live app) only, whatever the project's env is. Set the preview's with `oalo env set ... --env dev`.",
|
|
618
638
|
usage: [
|
|
619
639
|
"oalo migrate <heroku|railway|render|fly|primcloud> [--from-app <name>] [--env-file <file>] [--json]",
|
|
620
640
|
"oalo migrate <platform> --apply [--app <slug>]",
|
|
@@ -638,6 +658,7 @@ export const COMMANDS = [
|
|
|
638
658
|
{
|
|
639
659
|
name: "env",
|
|
640
660
|
summary: "An app's environment variables on Oalo (API keys, settings), per env: list, set, unset, rotate-token.",
|
|
661
|
+
env: "--env dev (the preview) or prod (the live app), else the project's env, else dev. Changing prod needs --env prod typed out; listing it doesn't.",
|
|
641
662
|
usage: [
|
|
642
663
|
"oalo env [--app <slug>] [--env dev|prod] [--json]",
|
|
643
664
|
"oalo env set NAME=value [NAME=value ...] [--secret | --public] [--no-restart]",
|
|
@@ -699,10 +720,11 @@ export const COMMANDS = [
|
|
|
699
720
|
{
|
|
700
721
|
name: "logs",
|
|
701
722
|
summary: "What an app's own processes printed (server, workers, release command), per env.",
|
|
723
|
+
env: "--env dev (the preview) or prod (the live app), else the project's env, else dev.",
|
|
702
724
|
usage: ["oalo logs [--app <slug>] [--env dev|prod] [--process web|<worker>] [--limit N] [--follow] [--json]"],
|
|
703
725
|
flags: [
|
|
704
726
|
{ flag: "--app <slug>", desc: "The app (`oalo apps` lists them). Default: the app saved with `oalo link --app`." },
|
|
705
|
-
{ flag: "--env dev|prod", desc: "dev is the preview, prod the live app. Default dev." },
|
|
727
|
+
{ flag: "--env dev|prod", desc: "dev is the preview, prod the live app. Default: the project's, else dev." },
|
|
706
728
|
{ flag: "--process <name>", desc: "Only this process: web, a Procfile worker's name, release, build (a live build's output, with --env prod), or oalo (Oalo's own notes)." },
|
|
707
729
|
{ flag: "--limit N", desc: "How many recent lines (default 200, at most 2000)." },
|
|
708
730
|
{ flag: "--follow", desc: "Keep printing new lines as they come, until Ctrl-C." },
|
|
@@ -718,6 +740,7 @@ export const COMMANDS = [
|
|
|
718
740
|
{
|
|
719
741
|
name: "loops",
|
|
720
742
|
summary: "List the loops, test one (sends simulated), see its past runs, turn it on or off, or delete it, without pulling and pushing it.",
|
|
743
|
+
env: "test always runs on dev (staging) data, whatever the project's env is. A loop has one copy, so on, off and delete take no env, and its real runs (triggers, schedules) use prod.",
|
|
721
744
|
usage: [
|
|
722
745
|
"oalo loops list [--json]",
|
|
723
746
|
"oalo loops test <name> [--sample latest|example] [--input <json|@file.json>] [--json]",
|
|
@@ -745,6 +768,7 @@ export const COMMANDS = [
|
|
|
745
768
|
{
|
|
746
769
|
name: "flows",
|
|
747
770
|
summary: "Turn a chat flow on or off, or delete it, by bot and flow name, without pulling and pushing it.",
|
|
771
|
+
env: "No env: a flow has one copy. Its steps use the bot's env, dev while the bot is a draft, prod once published.",
|
|
748
772
|
usage: ["oalo flows on <bot> <flow>", "oalo flows off <bot> <flow>", "oalo flows delete <bot> <flow>"],
|
|
749
773
|
flags: [],
|
|
750
774
|
notes: [
|
|
@@ -789,14 +813,16 @@ export const COMMANDS = [
|
|
|
789
813
|
{
|
|
790
814
|
name: "lint",
|
|
791
815
|
summary: "Check flow and loop files without saving anything.",
|
|
792
|
-
usage: ["oalo lint [<file>...] [--verbose] [--json]"],
|
|
816
|
+
usage: ["oalo lint [<file or folder>...] [--verbose] [--json]"],
|
|
793
817
|
flags: [
|
|
794
818
|
{ flag: "--verbose", desc: "Also show info-level findings." },
|
|
795
|
-
{ flag: "--json", desc: "One JSON object per file: {path, findings}." },
|
|
819
|
+
{ flag: "--json", desc: "One JSON object per file: {path, findings}, plus a note for a tool file." },
|
|
796
820
|
],
|
|
797
821
|
notes: [
|
|
798
822
|
"The same checks the server runs before a strict save: node types and keys against the catalog, required settings, edges and conditions, references between steps, and tools the flow or loop calls.",
|
|
799
823
|
"Each finding names the node, what is wrong and how to fix it.",
|
|
824
|
+
"A folder means every flow, loop and tool file inside it, e.g. oalo lint .oalo/loops.",
|
|
825
|
+
"A tool file isn't linted: its code is compiled and checked when you push it.",
|
|
800
826
|
"Needs a CLI token.",
|
|
801
827
|
],
|
|
802
828
|
exits: { 0: "no errors (warnings allowed)", 1: "errors found", 2: "no token" },
|
|
@@ -804,6 +830,7 @@ export const COMMANDS = [
|
|
|
804
830
|
{
|
|
805
831
|
name: "push",
|
|
806
832
|
summary: "Lint and save edited flow, loop and tool files, guarded against concurrent edits.",
|
|
833
|
+
env: "No env: flows, loops and tools have one copy, and a save is live at once. There is no dev copy to push to first.",
|
|
807
834
|
usage: ["oalo push [<file>...] [--dry-run] [--no-strict] [--force] [--all] [--verbose]"],
|
|
808
835
|
flags: [
|
|
809
836
|
{ flag: "--dry-run", desc: "Lint only; save nothing." },
|
|
@@ -824,6 +851,7 @@ export const COMMANDS = [
|
|
|
824
851
|
{
|
|
825
852
|
name: "qa",
|
|
826
853
|
summary: "Run a scripted test conversation with a bot and print the transcript.",
|
|
854
|
+
env: "No --env. The bot uses its own env: a draft reads and writes dev (tables, bookings), a published bot prod, in a test too. Set up a draft bot's data in dev before testing it.",
|
|
827
855
|
usage: [
|
|
828
856
|
'oalo qa <bot> "<message>" ["<message>" ...] [--channel web|whatsapp|instagram|sms] [--flow <name>] [--timeout <s>] [--json]',
|
|
829
857
|
"oalo qa <bot> --script <file.json>",
|
|
@@ -838,7 +866,9 @@ export const COMMANDS = [
|
|
|
838
866
|
],
|
|
839
867
|
notes: [
|
|
840
868
|
"The conversation is a preview with no phone number or external id: the inbox leaves it out and nothing is sent to WhatsApp, Instagram or SMS.",
|
|
841
|
-
"Everything else is real: the bot's tools and flows run
|
|
869
|
+
"Everything else is real: the bot's tools and flows run and handoffs happen. Use a test bot, or flows whose side effects you are fine repeating.",
|
|
870
|
+
"qa only sends text. It can't fill in or submit a web form or tap a widget, so test those steps in the dashboard's chat preview.",
|
|
871
|
+
"Contact details the bot collects reach a contact only when the test chat has one linked. On whatsapp and sms the test contact is removed when the run ends.",
|
|
842
872
|
"Each message waits until the bot settles (no new message and no running flow), then the next is sent. Any flow still active at the end is cancelled and the conversation is closed.",
|
|
843
873
|
"At most 20 messages per run. bot accepts a numeric id or a public bot_ id.",
|
|
844
874
|
"Needs a CLI token.",
|
|
@@ -848,6 +878,7 @@ export const COMMANDS = [
|
|
|
848
878
|
{
|
|
849
879
|
name: "rehearse",
|
|
850
880
|
summary: "Rehearse inbound WhatsApp conversations end to end: routing, triage and the bot's reply.",
|
|
881
|
+
env: "No --env. The bot that answers uses its own env: dev while it's a draft, prod once published.",
|
|
851
882
|
usage: ["oalo rehearse [--number <phone_number_id>] [--responder <bot_...>] [--timeout <s>] [--json]", "oalo rehearse --script <file.json>"],
|
|
852
883
|
flags: [
|
|
853
884
|
{ flag: "--number <id>", desc: "The WhatsApp number (phone_number_id) the customer writes to. Default: the workspace's default number." },
|
|
@@ -883,6 +914,7 @@ export const COMMANDS = [
|
|
|
883
914
|
{
|
|
884
915
|
name: "mcp",
|
|
885
916
|
summary: "Serve the workspace over MCP on stdio, for Claude Code or Cursor.",
|
|
917
|
+
env: "The tools never read the project's env. oalo_read_rows, oalo_list_models and oalo_db_query default to dev; oalo_query_metrics and dashboard widgets to prod; oalo_write_rows needs env. Pass env in each call.",
|
|
886
918
|
usage: ["oalo mcp"],
|
|
887
919
|
flags: [],
|
|
888
920
|
notes: [
|
|
@@ -948,6 +980,22 @@ export const COMMANDS = [
|
|
|
948
980
|
},
|
|
949
981
|
];
|
|
950
982
|
|
|
983
|
+
/**
|
|
984
|
+
* dev and prod, in plain lines, for `oalo help`, `help --json` and the man
|
|
985
|
+
* page. Agents in the CLI trial wrote setup to one env and tested in the
|
|
986
|
+
* other, so this says which surface uses which. A command's own `env` line
|
|
987
|
+
* says what that command does.
|
|
988
|
+
*/
|
|
989
|
+
export const ENVIRONMENTS = [
|
|
990
|
+
"Every workspace has two envs: dev (staging, a sandbox) and prod (live: what customers and live apps see). Tables and their rows, booking data, an app's variables, logs and releases are kept per env.",
|
|
991
|
+
"The project's default env is `env` in .oalo/config.json, set by `oalo link --env dev|prod` (default dev; `oalo deploy --new` sets dev). data, db query, db tables, deploy, env, logs, run loop and typegen follow it; --env on the command line wins.",
|
|
992
|
+
"Other commands don't read it: metrics, dashboards add, sources create and db dump default to prod; loops test always runs on dev; migrate --apply writes prod; db restore needs --env. MCP tools never read it: pass env in each call.",
|
|
993
|
+
"A draft (unpublished) bot reads and writes dev: it searches dev tables and books against dev booking data. A published bot uses prod. A test conversation (qa, run bot) uses the bot's env too, so set up a draft bot's tables and booking data in dev, and a published bot's in prod.",
|
|
994
|
+
"`oalo data promote <table>` copies a table's rows from dev to prod. Writing prod by hand needs --env prod typed out (data push and delete, deploy, env changes).",
|
|
995
|
+
"Flows, loops and code tools have one copy, not one per env: a saved one is live. Loops fired by real triggers and schedules run on prod. Contacts and events have one copy too.",
|
|
996
|
+
"When it matters, pass --env (MCP and `oalo call`: \"env\") every time instead of relying on a default.",
|
|
997
|
+
];
|
|
998
|
+
|
|
951
999
|
export const ENV_VARS = [
|
|
952
1000
|
{ name: "OALO_URL", desc: "Workspace URL; overrides the linked config." },
|
|
953
1001
|
{ name: "OALO_SYNC_TOKEN", desc: "Sync token; overrides the stored one." },
|
|
@@ -970,8 +1018,10 @@ export function overview() {
|
|
|
970
1018
|
`Run \`oalo help <command>\` for detail, or \`oalo help --json\` for a`,
|
|
971
1019
|
`machine-readable description of every command, flag and exit code.`,
|
|
972
1020
|
``,
|
|
973
|
-
`
|
|
1021
|
+
`Environments (dev = staging, prod = live):`,
|
|
974
1022
|
);
|
|
1023
|
+
for (const e of ENVIRONMENTS) lines.push(` - ${e}`);
|
|
1024
|
+
lines.push(``, `Two token kinds, NOT interchangeable:`);
|
|
975
1025
|
for (const t of TOKENS) {
|
|
976
1026
|
lines.push(` ${pad(t.kind, 5)} ${t.plane}`);
|
|
977
1027
|
lines.push(` from ${t.where}`);
|
|
@@ -984,7 +1034,9 @@ export function commandHelp(name) {
|
|
|
984
1034
|
const c = COMMANDS.find((x) => x.name === name);
|
|
985
1035
|
if (!c) return null;
|
|
986
1036
|
|
|
987
|
-
const lines = [`oalo ${c.name}: ${c.summary}`,
|
|
1037
|
+
const lines = [`oalo ${c.name}: ${c.summary}`, ``];
|
|
1038
|
+
if (c.env) lines.push(`Env: ${c.env}`, ``);
|
|
1039
|
+
lines.push(`Usage:`);
|
|
988
1040
|
for (const u of c.usage) lines.push(` ${u}`);
|
|
989
1041
|
|
|
990
1042
|
if (c.flags.length) {
|
|
@@ -1006,7 +1058,7 @@ export function commandHelp(name) {
|
|
|
1006
1058
|
/** Machine-readable. Intended for an agent deciding how to drive the CLI. */
|
|
1007
1059
|
export function helpJson() {
|
|
1008
1060
|
return JSON.stringify(
|
|
1009
|
-
{ name: "oalo", tagline: TAGLINE, commands: PUBLIC, tokens: TOKENS, env: ENV_VARS },
|
|
1061
|
+
{ name: "oalo", tagline: TAGLINE, environments: ENVIRONMENTS, commands: PUBLIC, tokens: TOKENS, env: ENV_VARS },
|
|
1010
1062
|
null,
|
|
1011
1063
|
2,
|
|
1012
1064
|
);
|