@oalo-ai/cli 0.4.2 → 0.4.4

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/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,13 +73,14 @@ 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: "Which schema later commands touch. Default dev." },
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
  ],
79
80
  notes: [
80
81
  "Every token is verified against the thing it is for BEFORE anything is saved, so a bad or mixed-up token fails here rather than later.",
81
82
  "Writes .oalo/config.json (safe to commit) and ~/.oalo/credentials.json (mode 0600, never in the project). OALO_HOME relocates the credential store.",
83
+ "Commands in a subfolder use the nearest .oalo/config.json above them, up to the git repository's root (as git finds its own folder). A link outside the repository (a parent folder, or the repository holding a nested one) is never used, since it may be another workspace's; the \"which workspace\" error names it, and `oalo link` in the subfolder or --server settles it. `oalo link --status` says which file is used.",
82
84
  "Also installs the Oalo skill for coding agents (.claude/skills/oalo/SKILL.md), or refreshes it, from this CLI version; an AGENTS.md section from `oalo skill --agents` is refreshed too.",
83
85
  ],
84
86
  exits: { 0: "linked", 1: "verification failed", 2: "missing or invalid arguments" },
@@ -86,8 +88,10 @@ export const COMMANDS = [
86
88
  {
87
89
  name: "typegen",
88
90
  summary: "Generate TypeScript bindings from the workspace's own schema: its models, and the workflows apps can call.",
89
- usage: ["oalo typegen [--out <file>] [--check]", "oalo typegen --dart [--out <project dir>] [--check]"],
91
+ 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.",
92
+ usage: ["oalo typegen [--out <file>] [--check] [--env dev|prod]", "oalo typegen --dart [--out <project dir>] [--check] [--env dev|prod]"],
90
93
  flags: [
94
+ { flag: "--env dev|prod", desc: "Which env to read. Default: the project's, else dev." },
91
95
  { flag: "--out <file>", desc: "Output path. Default oalo.generated.ts. With --dart, the Flutter project's root (default the current folder)." },
92
96
  { 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
97
  { flag: "--check", desc: "Do not write; exit non-zero if the file is stale or missing. For CI." },
@@ -124,7 +128,8 @@ export const COMMANDS = [
124
128
  {
125
129
  name: "call",
126
130
  summary: "Call any build-surface event directly. The escape hatch.",
127
- usage: ["oalo call <event> ['<json params>']", "oalo call --list [text] [--json]"],
131
+ 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\".",
132
+ usage: ["oalo call <event> ['<json params>' | @file.json | -]", "oalo call --list [text] [--json]"],
128
133
  flags: [
129
134
  { flag: "--list [text]", desc: "List the events you can call, from the workspace. With text, the matching events and the params each accepts." },
130
135
  { flag: "--namespaces", desc: "The events you may call, counted per namespace (what `--list` with no text shows)." },
@@ -133,9 +138,11 @@ export const COMMANDS = [
133
138
  notes: [
134
139
  "The build surface has ~500 events. First-class commands cover the common ones; this reaches the rest without a command per feature.",
135
140
  "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.",
141
+ "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
142
  "--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
143
  "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
144
  "Example: oalo call loops:run_now '{\"name\":\"Nurture\"}'",
145
+ "From a file: oalo call loops:get @params.json. From stdin: jq -n '{name: \"Nurture\"}' | oalo call loops:get",
139
146
  "Needs a CLI token.",
140
147
  ],
141
148
  exits: { 0: "the call succeeded", 1: "the call failed or was rejected", 2: "bad arguments or no token" },
@@ -143,14 +150,18 @@ export const COMMANDS = [
143
150
  {
144
151
  name: "run",
145
152
  summary: "Fire a loop, or send a bot a test message, and watch what happens.",
146
- usage: ['oalo run loop <name> [--env dev|prod] [--watch]', 'oalo run bot <id> "<message>"'],
153
+ 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.",
154
+ usage: ['oalo run loop <name> [--env dev|prod] [--payload \'{"email": "..."}\' | --input \'{...}\'] [--watch]', 'oalo run bot <id> "<message>"'],
147
155
  flags: [
156
+ { flag: "--payload <json>", desc: "loop: the run starts as if its event came with this payload, read as {{trigger.payload.<field>}}." },
157
+ { flag: "--input <json>", desc: "loop: the trigger's whole output, as is (for a loop that reads {{trigger.<field>}} directly)." },
148
158
  { flag: "--watch", desc: "Stream events after firing. Default on for bots." },
149
159
  { flag: "--timeout <s>", desc: "How long to watch. Default 30." },
150
- { flag: "--env dev|prod", desc: "Which schema the loop runs against." },
160
+ { flag: "--env dev|prod", desc: "loop: which env's data it runs on. Default: the project's, else dev." },
151
161
  { 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
162
  ],
153
163
  notes: [
164
+ "A loop that's off doesn't run for real: `oalo loops test <name>` tries it while it's off, with sends and record changes simulated.",
154
165
  "IMPORTANT: `run loop` fires the loop DIRECTLY and does NOT exercise its trigger binding. Triggers come from the event bus (a real form submission, a real inbound message). So this proves the loop body works; to test that its trigger is wired, use `oalo emit`.",
155
166
  "bot ids accept an integer, a numeric string, or a public bot_ id.",
156
167
  "Needs a CLI token.",
@@ -160,11 +171,12 @@ export const COMMANDS = [
160
171
  {
161
172
  name: "emit",
162
173
  summary: "Fire a domain event (form.submitted, order.created, ...) to test a loop's trigger.",
174
+ 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
175
  usage: ["oalo emit <event type> [--payload '<json>'] [--contact <id>] [--dry-run] [--json]", "oalo emit --list [--json]"],
164
176
  flags: [
165
177
  { flag: "--payload <json>", desc: "The event's payload, a JSON object. `oalo emit --list` shows each event's fields." },
166
178
  { flag: "--contact <id>", desc: "An existing contact the event is about. Never creates one." },
167
- { flag: "--dry-run", desc: "List the loops it would fire, and emit nothing." },
179
+ { flag: "--dry-run", desc: "Emit nothing. Lists the loops it would fire, the ones that would match but are off (the loop or its trigger), and the ones listening for the type whose filter doesn't match this payload, with the filter. So it checks a filter on a loop that is kept off, too. A bot_id in a filter matches the bot's public id (bot_...) or its number." },
168
180
  { flag: "--list", desc: "Every event a trigger can listen for, with its payload fields and the loops listening now." },
169
181
  { flag: "--json", desc: "Print the reply as JSON." },
170
182
  ],
@@ -179,6 +191,7 @@ export const COMMANDS = [
179
191
  {
180
192
  name: "data",
181
193
  summary: "Models and rows in this workspace: list, read, push (bulk upsert), delete, watch, promote, and make tables searchable by bots.",
194
+ 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
195
  usage: [
183
196
  "oalo data models [--json]",
184
197
  "oalo data models create <name> --field name:type [--field ...] [--owned-by <field>]",
@@ -216,8 +229,9 @@ export const COMMANDS = [
216
229
  { flag: "--json", desc: "Print the reply as JSON." },
217
230
  ],
218
231
  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.",
232
+ "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
233
  "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).",
234
+ "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
235
  "models create and promote run as you over the CLI token, so they follow your dashboard access.",
222
236
  "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
237
  "Every write syncs to apps on that schema at once. A delete marks the row deleted; it leaves synced apps.",
@@ -231,6 +245,7 @@ export const COMMANDS = [
231
245
  {
232
246
  name: "incidents",
233
247
  summary: "A live app's outages and restart bursts, as Oalo's uptime check saw them, newest first.",
248
+ env: "prod (the live app) only. The preview isn't checked; `oalo logs` shows it.",
234
249
  usage: ["oalo incidents [--app <slug>] [--all] [--json]"],
235
250
  flags: [
236
251
  { flag: "--app <slug>", desc: "The app. Default: the one saved with `oalo link --app`." },
@@ -246,6 +261,7 @@ export const COMMANDS = [
246
261
  {
247
262
  name: "db",
248
263
  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.",
264
+ 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
265
  usage: [
250
266
  'oalo db query "<sql>" [--env dev|prod] [--limit <n>] [--json]',
251
267
  "oalo db tables [--env dev|prod]",
@@ -254,7 +270,7 @@ export const COMMANDS = [
254
270
  "oalo db restore --from-env <VAR> --env dev|prod [--schema <name>] [--check] [--yes]",
255
271
  ],
256
272
  flags: [
257
- { flag: "--env dev|prod", desc: "query, tables: which env. Default the project's (dev). dump: which env's data. Default prod. restore: which env the data goes into, always on the command line." },
273
+ { 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
274
  { flag: "--limit <n>", desc: "query: rows to show. Default 100, at most 1000." },
259
275
  { flag: "--json", desc: "query: {columns, rows, truncated} as JSON." },
260
276
  { flag: "--out <file.sql>", desc: "Where to write it. Default <workspace>-<env>-<date>.sql here." },
@@ -283,6 +299,7 @@ export const COMMANDS = [
283
299
  {
284
300
  name: "metrics",
285
301
  summary: "A number from the workspace's data: count, sum or average over a model's rows, events or contacts, grouped or over time.",
302
+ 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
303
  usage: [
287
304
  "oalo metrics <model | events | contacts> [--sum|--avg|--min|--max|--distinct <field>] [--by <field>] [--every day|week|month] [--days N] [--where <filter>] [--json]",
288
305
  ],
@@ -299,7 +316,7 @@ export const COMMANDS = [
299
316
  { flag: "--event <type>", desc: "events: one type, like order.created. Default: every type." },
300
317
  { 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
318
  { 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." },
319
+ { 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
320
  { flag: "--json", desc: "The answer as JSON." },
304
321
  ],
305
322
  notes: [
@@ -311,6 +328,7 @@ export const COMMANDS = [
311
328
  {
312
329
  name: "dashboards",
313
330
  summary: "The workspace's dashboards, and a chart put on one (made when no dashboard has that name).",
331
+ 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
332
  usage: [
315
333
  "oalo dashboards [--json]",
316
334
  'oalo dashboards add <dashboard> <model | events | contacts> --title "<title>" --kind number|line|bars|table [metrics flags] [--app <slug>] [--width 1|2|3]',
@@ -326,13 +344,14 @@ export const COMMANDS = [
326
344
  ],
327
345
  notes: [
328
346
  "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.",
347
+ "The flags after the model are the same as oalo metrics, --env included.",
330
348
  ],
331
349
  exits: { 0: "done", 1: "the request failed", 2: "bad arguments or no CLI token" },
332
350
  },
333
351
  {
334
352
  name: "products",
335
353
  summary: "What the workspace sells (Oalo commerce on its own Stripe account): list, create, rename, change a price, archive, and see orders.",
354
+ 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
355
  usage: [
337
356
  "oalo products [--all] [--json]",
338
357
  'oalo products create <id> --name "<name>" --price <amount> --once|--monthly|--yearly [--trial <days>] [--currency <code>] [--description <text>] [--live] [--yes]',
@@ -445,16 +464,17 @@ export const COMMANDS = [
445
464
  {
446
465
  name: "sources",
447
466
  summary: "Feeds that send Oalo rows from outside (another system, a webhook, an export), keeping only the fields you choose.",
467
+ 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
468
  usage: [
449
469
  "oalo sources [list] [--json]",
450
- "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]",
470
+ "oalo sources create <name> --from <sample.csv|.json|.jsonl> [--table <new model>] [--id-field <field>] [--records-at <path>] [--mode upsert|snapshot] [--auth bearer|hmac|url] [--env dev|prod]",
451
471
  "oalo sources create <name> --table <existing model or table> [--fields a,b] [--id-field <field>] [--auth bearer|hmac|url]",
452
- " (either form) [--keep-from-ai a,b] [--retention <days>]",
472
+ " (either form) [--keep-from-ai a,b] [--retention <days>] [--hmac-header <name>] [--hmac-format sha256=hex|hex|base64]",
453
473
  "oalo sources show <name> [--json]",
454
474
  "oalo sources create <name> --bot <bot> [--auth bearer|hmac|url]",
455
475
  "oalo sources create <name> --from-postgres <postgres url> --relation <schema.view> [--key <column>] [--cursor <column>] [--every <minutes>] [--table <new model>] [--now]",
456
476
  "oalo sources push <name> <file.csv|.json|.jsonl> [--json]",
457
- "oalo sources push <name> <doc.pdf|.docx|.md|.html|.txt> [more...] [--json]",
477
+ "oalo sources push <name> <doc.pdf|.docx|.md|.html|.txt> [more...] [--prune] [--json]",
458
478
  "oalo sources remove <name> <document>",
459
479
  "oalo sources fetch <name> <https url> [--every <minutes>] [--header <\"Name: value\">] [--records-at <path>] [--document <name>] [--now]",
460
480
  "oalo sources fetch <name> <postgres url> --relation <schema.view> [--key <column>] [--cursor <column>] [--every <minutes>] [--now]",
@@ -475,10 +495,12 @@ export const COMMANDS = [
475
495
  { flag: "--id-field <field>", desc: "create: the field that identifies a record (default id). A record sent again updates its row." },
476
496
  { 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
497
  { 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 model the rows go to. Default prod." },
498
+ { 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
499
  { flag: "--every <minutes>", desc: "fetch: how often Oalo fetches the address, 5 to 10080 minutes. Default 60." },
480
500
  { 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
- { flag: "--records-at <path>", desc: "fetch, a table's source: the records are the list at this key of the JSON answer (data.items)." },
501
+ { flag: "--records-at <path>", desc: "create: where each record sits in what a sender posts, for a webhook that wraps it ({\"event\": ..., \"delivery\": {...}} is --records-at delivery; an object there is one record, a list is several). The --from sample is read the same way, and --id-field and --fields name fields inside it. fetch, a table's source: the records are the list at this key of the JSON answer (data.items)." },
502
+ { flag: "--hmac-header <name>", desc: "create, --auth hmac: the header that carries the signature. Default x-signature." },
503
+ { flag: "--hmac-format <f>", desc: "create, --auth hmac: how the signature is written: sha256=hex (default, as GitHub and Shopify-style senders do), hex (the bare hex digest) or base64. A signature in another format is refused as not a sender of this source." },
482
504
  { flag: "--document <name>", desc: "fetch, a knowledge source: the document's name (default the address's last part)." },
483
505
  { flag: "--relation <name>", desc: "fetch, a postgres:// address: the view (or table) to read, like public.orders_for_oalo. Write a view of just the columns to share." },
484
506
  { flag: "--key <column>", desc: "fetch, a postgres:// address: the view's column that identifies a row. Default the source's id field." },
@@ -486,10 +508,12 @@ export const COMMANDS = [
486
508
  { flag: "--now", desc: "fetch: fetch once now, and say what was stored." },
487
509
  { flag: "--off", desc: "fetch: stop fetching." },
488
510
  { flag: "--wipe", desc: "delete: also delete the rows, when the source made the model." },
511
+ { flag: "--prune", desc: "push, a knowledge source: the files sent are the whole set, so each document the source has and they don't is removed. Nothing is removed when a file fails. `oalo sources push help docs/*.md --prune` keeps the bot in step with a folder." },
489
512
  { flag: "--json", desc: "The reply as JSON." },
490
513
  ],
491
514
  notes: [
492
515
  "A sender posts JSON (an object or an array), NDJSON or CSV to the source's address. Keys and CSV headers are snake-cased as the CSV import does it, so \"Order ID\" and order_id are one field.",
516
+ "Only top-level fields are fields. A field that holds an object or a list is stored whole, everything inside it included, and --fields can't pick inside it, so a webhook that wraps its record (\"delivery\": {...}) needs --records-at, or a sensitive field inside the wrapper is stored. create warns when a sample has such a field.",
493
517
  "The secret is shown when the source is made, and by rotate; it only writes. Each upload answers what it stored, rejected and dropped, is listed in show, and fires source.<name>.received for workflows.",
494
518
  "Rows sync to your apps at once and fire the model's row events, as Sync API writes do. Up to 10,000 records a request, 120 requests a minute per source, 200,000 rows a day per workspace.",
495
519
  "push sends a file from here, over your CLI token, in batches of 1,000; in snapshot mode the rows missing from the whole file are deleted after its last batch.",
@@ -503,6 +527,7 @@ export const COMMANDS = [
503
527
  {
504
528
  name: "bots",
505
529
  summary: "The workspace's bots: the tables each can search, and every setting (knowledge, memory, model, replies, limits).",
530
+ 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
531
  usage: [
507
532
  "oalo bots [--json]",
508
533
  "oalo bots knowledge <bot> [--json]",
@@ -511,13 +536,17 @@ export const COMMANDS = [
511
536
  "oalo bots settings <bot> [--json]",
512
537
  "oalo bots settings <bot> set key=value [key=value ...] [--yes] [--dry-run] [--json]",
513
538
  "oalo bots settings --explain [<key> | <group>] [--json]",
539
+ "oalo bots graph <bot> [--build] [--json]",
540
+ "oalo bots graph <bot> --reset --yes [--json]",
514
541
  ],
515
542
  flags: [
516
543
  { flag: "tools --add <tool>", desc: "Let the bot call one of the workspace's tools, by name. Your server apps' own endpoints are listed once a deploy reads their .oalo/app.json (see `oalo docs app-tools`). --remove takes it away." },
517
544
  { flag: "--add <source>", desc: "knowledge: attach a searchable table: its handle (model:products, table:prod.faq) or just its name when that's unique. Repeat it, or comma-separate." },
518
545
  { flag: "--remove <source>", desc: "Detach one. The table stays searchable for other bots." },
519
546
  { flag: "set key=value", desc: "settings: change one or more. A value starting with @ is read from that file (for the frame). none, default or an empty value clears a setting where its help says so." },
520
- { flag: "--yes", desc: "settings set: apply to a published bot. Without it a published bot's change is shown and not saved." },
547
+ { flag: "--yes", desc: "settings set: apply to a published bot. Without it a published bot's change is shown and not saved. graph --reset: go ahead." },
548
+ { flag: "--build", desc: "graph: build the bot's knowledge graph from its documents, in the background (a minute or two). After that, each new document keeps it current. Run it again to rebuild it whole." },
549
+ { flag: "--reset", desc: "graph: delete the whole graph, links added by hand or imported included. Needs --yes." },
521
550
  { flag: "--dry-run", desc: "settings set: show what would change; save nothing." },
522
551
  { flag: "--explain [key]", desc: "settings: what each setting does, its values and default. A key, a group (knowledge, memory, model, replies, limits, data) or all." },
523
552
  { flag: "--json", desc: "The bots, or the bot's sources and what else could be attached, as JSON." },
@@ -528,12 +557,14 @@ export const COMMANDS = [
528
557
  "The same as ticking a table in the bot's Knowledge pane in the dashboard, with the same access as there.",
529
558
  "settings go through the dashboard's own actions, with the same checks and access. A change sets only the settings it names: the model without the provider keeps the provider, one limit keeps the others, one context.* key keeps the rest of the context config.",
530
559
  "Every setting is described in `man oalo` (BOT SETTINGS) and by `oalo bots settings --explain`.",
560
+ "The knowledge graph links a bot's passages: each document's sections, and the sections like each other, so a match can bring in related ones and the topics above it. A bot has none until `oalo bots graph <bot> --build`. graph shows its size and whether links are labeled; how answers use it is in settings (graph_retrieval, ancestor_preload_depth, graph_classify_edges). Markdown front matter's related: list links pages by name.",
531
561
  ],
532
562
  exits: { 0: "done", 1: "refused or failed", 2: "bad arguments or no CLI token" },
533
563
  },
534
564
  {
535
565
  name: "tokens",
536
566
  summary: "List, create and revoke the workspace's sync tokens, for an app's own server.",
567
+ 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
568
  usage: [
538
569
  "oalo tokens list [--json]",
539
570
  "oalo tokens create --name <name> --scope write:<table> [--scope ...] [--days N] [--json]",
@@ -541,12 +572,13 @@ export const COMMANDS = [
541
572
  ],
542
573
  flags: [
543
574
  { flag: "--name <name>", desc: "What the token is for, shown in the dashboard." },
544
- { flag: "--scope <scope>", desc: "read, write, read_manifest, read:<table>, write:<table>, events (send events to POST /api/events/v1), workflows (call workflows, POST /api/workflows/v1/<name>/run), chat (sign the chat widget in as your app's user, POST /api/chat/v1/sessions), or env:dev / env:prod (lock it to one env's data: env:dev makes events and workflow calls safe test runs, for running your app on your machine). Repeat it. Prefer the narrowest. An unknown scope is refused." },
575
+ { flag: "--scope <scope>", desc: "read, write, read_manifest, read:<table>, write:<table>, events (send events to POST /api/events/v1), workflows (call workflows, POST /api/workflows/v1/<name>/run), chat (sign the chat widget in as your app's user, POST /api/chat/v1/sessions), or env:dev / env:prod (lock it to one env's data: env:dev makes events and workflow calls safe test runs, for running your app on your machine). Repeat it. Prefer the narrowest. An unknown scope is refused. A <table> is an Oalo data model, one `oalo data models` lists: a plain Postgres table (made by `oalo db restore` or by the app) can't be served by the Sync API, and create warns when a table scope names no model." },
545
576
  { flag: "--days N", desc: "Expiry in days (default 90; 0 for none)." },
546
577
  ],
547
578
  notes: [
548
579
  "A sync token reads or writes every row of its tables, for every member. It belongs in a server's secrets, never in a mobile or web app.",
549
580
  "The token is printed once. Copy it into the app server's secrets right away.",
581
+ "Table scopes (read:<table>, write:<table>) are for Oalo data models, what `oalo data models` lists. They don't reach a plain table: an app's server reads its own tables over DATABASE_URL.",
550
582
  ],
551
583
  exits: { 0: "done", 1: "refused or failed", 2: "bad arguments or no CLI token" },
552
584
  },
@@ -577,6 +609,7 @@ export const COMMANDS = [
577
609
  {
578
610
  name: "deploy",
579
611
  summary: "Send this repo's commits to an app and run them: the preview (dev) by default, the live release with --env prod.",
612
+ 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
613
  usage: [
581
614
  "oalo deploy [--app <slug>] [--env dev|prod] [--allow-dirty] [--json]",
582
615
  "oalo deploy --new [<name>] [--name \"Display name\"]",
@@ -589,7 +622,7 @@ export const COMMANDS = [
589
622
  flags: [
590
623
  { flag: "--app <slug>", desc: "The app (`oalo apps` lists them). Default: the app saved with `oalo link --app`." },
591
624
  { flag: "--env dev|prod", desc: "dev updates the preview; prod builds and swaps the live release. prod must be on the command line." },
592
- { flag: "--new [<name>]", desc: "Make a new app from this repo: its type found from the files at the repo's root (no Dockerfile needed), its commits kept as the app's history, its preview set up. The name (default: the repo's folder) becomes its slug, and this project is linked to it. When nothing at the root says what the app is (a monorepo, say), it is made as code only and the deploy says what to add: see `oalo docs bring-your-repo`." },
625
+ { flag: "--new [<name>]", desc: "Make a new app from this repo: its type found from the files at the repo's root (no Dockerfile needed), its commits kept as the app's history, its preview set up. The name (default: the repo's folder) becomes its slug: lowercase letters, digits and dashes, so `my_app` becomes `my-app`, and the deploy says so when it changed what you typed. This project is linked to it. When nothing at the root says what the app is (a monorepo, say), it is made as code only and the deploy says what to add: see `oalo docs bring-your-repo`." },
593
626
  { flag: "--name <display name>", desc: "With --new: the app's display name. Default: its slug." },
594
627
  { flag: "--from <https url>", desc: "With --new: make the app from a Git repository at this address instead of this folder (no local checkout needed). The Base clones one branch with its whole history (https to a public host only, up to 200 MB, 5 minutes), then makes the app as --new does. The name defaults to the repository's. Nothing is linked here." },
595
628
  { flag: "--branch <name>", desc: "With --from: the branch to import. Default: the repository's default branch." },
@@ -615,6 +648,7 @@ export const COMMANDS = [
615
648
  {
616
649
  name: "migrate",
617
650
  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.",
651
+ 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
652
  usage: [
619
653
  "oalo migrate <heroku|railway|render|fly|primcloud> [--from-app <name>] [--env-file <file>] [--json]",
620
654
  "oalo migrate <platform> --apply [--app <slug>]",
@@ -638,6 +672,7 @@ export const COMMANDS = [
638
672
  {
639
673
  name: "env",
640
674
  summary: "An app's environment variables on Oalo (API keys, settings), per env: list, set, unset, rotate-token.",
675
+ 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
676
  usage: [
642
677
  "oalo env [--app <slug>] [--env dev|prod] [--json]",
643
678
  "oalo env set NAME=value [NAME=value ...] [--secret | --public] [--no-restart]",
@@ -699,10 +734,11 @@ export const COMMANDS = [
699
734
  {
700
735
  name: "logs",
701
736
  summary: "What an app's own processes printed (server, workers, release command), per env.",
737
+ env: "--env dev (the preview) or prod (the live app), else the project's env, else dev.",
702
738
  usage: ["oalo logs [--app <slug>] [--env dev|prod] [--process web|<worker>] [--limit N] [--follow] [--json]"],
703
739
  flags: [
704
740
  { 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." },
741
+ { flag: "--env dev|prod", desc: "dev is the preview, prod the live app. Default: the project's, else dev." },
706
742
  { 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
743
  { flag: "--limit N", desc: "How many recent lines (default 200, at most 2000)." },
708
744
  { flag: "--follow", desc: "Keep printing new lines as they come, until Ctrl-C." },
@@ -718,6 +754,7 @@ export const COMMANDS = [
718
754
  {
719
755
  name: "loops",
720
756
  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.",
757
+ 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
758
  usage: [
722
759
  "oalo loops list [--json]",
723
760
  "oalo loops test <name> [--sample latest|example] [--input <json|@file.json>] [--json]",
@@ -737,6 +774,7 @@ export const COMMANDS = [
737
774
  ],
738
775
  notes: [
739
776
  "A test runs every step. Steps that send messages or change records are simulated, and their output says what they would have done. Custom tools and AI steps run for real. It works on a loop that is off.",
777
+ "A message step (email, WhatsApp, SMS, team chat) shows its rendered text whole: subject, body, text. Other outputs show up to 2,000 characters on one line; --json has everything.",
740
778
  "A loop that is on runs for real whenever its triggers fire. Starting a run now, for real: `oalo run loop <name>`.",
741
779
  "Deleting can't be undone; turning a loop off keeps it.",
742
780
  ],
@@ -745,6 +783,7 @@ export const COMMANDS = [
745
783
  {
746
784
  name: "flows",
747
785
  summary: "Turn a chat flow on or off, or delete it, by bot and flow name, without pulling and pushing it.",
786
+ 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
787
  usage: ["oalo flows on <bot> <flow>", "oalo flows off <bot> <flow>", "oalo flows delete <bot> <flow>"],
749
788
  flags: [],
750
789
  notes: [
@@ -789,14 +828,16 @@ export const COMMANDS = [
789
828
  {
790
829
  name: "lint",
791
830
  summary: "Check flow and loop files without saving anything.",
792
- usage: ["oalo lint [<file>...] [--verbose] [--json]"],
831
+ usage: ["oalo lint [<file or folder>...] [--verbose] [--json]"],
793
832
  flags: [
794
833
  { flag: "--verbose", desc: "Also show info-level findings." },
795
- { flag: "--json", desc: "One JSON object per file: {path, findings}." },
834
+ { flag: "--json", desc: "One JSON object per file: {path, findings}, plus a note for a tool file." },
796
835
  ],
797
836
  notes: [
798
837
  "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
838
  "Each finding names the node, what is wrong and how to fix it.",
839
+ "A folder means every flow, loop and tool file inside it, e.g. oalo lint .oalo/loops.",
840
+ "A tool file isn't linted: its code is compiled and checked when you push it.",
800
841
  "Needs a CLI token.",
801
842
  ],
802
843
  exits: { 0: "no errors (warnings allowed)", 1: "errors found", 2: "no token" },
@@ -804,6 +845,7 @@ export const COMMANDS = [
804
845
  {
805
846
  name: "push",
806
847
  summary: "Lint and save edited flow, loop and tool files, guarded against concurrent edits.",
848
+ 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
849
  usage: ["oalo push [<file>...] [--dry-run] [--no-strict] [--force] [--all] [--verbose]"],
808
850
  flags: [
809
851
  { flag: "--dry-run", desc: "Lint only; save nothing." },
@@ -824,6 +866,7 @@ export const COMMANDS = [
824
866
  {
825
867
  name: "qa",
826
868
  summary: "Run a scripted test conversation with a bot and print the transcript.",
869
+ 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
870
  usage: [
828
871
  'oalo qa <bot> "<message>" ["<message>" ...] [--channel web|whatsapp|instagram|sms] [--flow <name>] [--timeout <s>] [--json]',
829
872
  "oalo qa <bot> --script <file.json>",
@@ -834,11 +877,13 @@ export const COMMANDS = [
834
877
  { flag: "--script <file>", desc: 'A JSON file: {"channel": "whatsapp", "flow": "<name>", "messages": ["...", "..."]}.' },
835
878
  { flag: "--timeout <s>", desc: "How long one turn may take to settle. Default 90, at most 300." },
836
879
  { flag: "--label <text>", desc: "Tag stored on the test conversation." },
837
- { flag: "--json", desc: "Print the whole run as JSON: turns (replies, flow state, ms, settled), flow_path, cost_usd." },
880
+ { flag: "--json", desc: "Print the whole run as JSON: turns (replies, the tools called, flow state, ms, settled), flow_path, cost_usd." },
838
881
  ],
839
882
  notes: [
840
883
  "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, collected contact details are saved, handoffs happen. Use a test bot, or flows whose side effects you are fine repeating.",
884
+ "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.",
885
+ "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.",
886
+ "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
887
  "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
888
  "At most 20 messages per run. bot accepts a numeric id or a public bot_ id.",
844
889
  "Needs a CLI token.",
@@ -848,11 +893,12 @@ export const COMMANDS = [
848
893
  {
849
894
  name: "rehearse",
850
895
  summary: "Rehearse inbound WhatsApp conversations end to end: routing, triage and the bot's reply.",
896
+ env: "No --env. The bot that answers uses its own env: dev while it's a draft, prod once published.",
851
897
  usage: ["oalo rehearse [--number <phone_number_id>] [--responder <bot_...>] [--timeout <s>] [--json]", "oalo rehearse --script <file.json>"],
852
898
  flags: [
853
899
  { flag: "--number <id>", desc: "The WhatsApp number (phone_number_id) the customer writes to. Default: the workspace's default number." },
854
- { flag: "--responder <bot_...>", desc: "The bot that should end up answering, by its public id (`oalo bots` lists them). Default: the bot an enabled triage loop hands threads to, else the number's bot." },
855
- { flag: "--script <file>", desc: 'A JSON file: {"scenarios": [{"name", "messages", "known_contact", "opted_out", "open_thread": {"bot_id", "number", "hours_ago", "tags", "assigned", "deal"}, "expect": {"reply", "bot_id", "assigned"}}]}.' },
900
+ { flag: "--responder <bot_...>", desc: "The bot the checks expect to end up answering, by its public id (`oalo bots` lists them). It's a check, not routing: messages still go where the number and its triage send them. To rehearse a bot that isn't on the number, give a --script scenario with an open_thread on that bot. Default: the bot an enabled triage loop hands threads to, else the number's bot." },
901
+ { flag: "--script <file>", desc: 'A JSON file: {"scenarios": [{"name", "messages", "known_contact", "opted_out", "open_thread": {"bot_id", "number", "hours_ago", "tags", "assigned", "deal", "messages"}, "expect": {"reply", "bot_id", "assigned"}}]}. open_thread.bot_id is a public id (bot_...) or number. An open thread starts with one earlier exchange: open_thread.messages [customer, reply] when given, else a Spanish greeting ("Hola" / "¡Hola! ¿En qué te puedo ayudar?"), which can set the language the bot answers in.' },
856
902
  { flag: "--timeout <s>", desc: "How long one message may take to settle. Default 120, at most 300." },
857
903
  { flag: "--json", desc: "Print every scenario as JSON: turns (what was sent), threads, loop runs and their steps, checks, why_silent, cost_usd." },
858
904
  ],
@@ -883,11 +929,13 @@ export const COMMANDS = [
883
929
  {
884
930
  name: "mcp",
885
931
  summary: "Serve the workspace over MCP on stdio, for Claude Code or Cursor.",
932
+ 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
933
  usage: ["oalo mcp"],
887
934
  flags: [],
888
935
  notes: [
889
936
  "stdout is the MCP protocol stream. Diagnostics go to stderr.",
890
937
  "Exposes a curated tool set plus an oalo_call passthrough; the build surface has ~442 events and mapping them all would wreck tool selection.",
938
+ "oalo_describe is a short summary (apps, bots and loops by name, the tool groups, how dev and prod work, the docs index); its section argument pages through the full records. A reply longer than about 60,000 characters has its longest list cut, with a `_cut` note saying how to get the rest (oalo_call takes match and offset; oalo_node_catalog takes node_type).",
891
939
  "Reads OALO_URL and OALO_CLI_TOKEN, or falls back to what `oalo link --cli-token` saved.",
892
940
  "Needs a CLI token.",
893
941
  ],
@@ -948,6 +996,22 @@ export const COMMANDS = [
948
996
  },
949
997
  ];
950
998
 
999
+ /**
1000
+ * dev and prod, in plain lines, for `oalo help`, `help --json` and the man
1001
+ * page. Agents in the CLI trial wrote setup to one env and tested in the
1002
+ * other, so this says which surface uses which. A command's own `env` line
1003
+ * says what that command does.
1004
+ */
1005
+ export const ENVIRONMENTS = [
1006
+ "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.",
1007
+ "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.",
1008
+ "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.",
1009
+ "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.",
1010
+ "`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).",
1011
+ "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.",
1012
+ "When it matters, pass --env (MCP and `oalo call`: \"env\") every time instead of relying on a default.",
1013
+ ];
1014
+
951
1015
  export const ENV_VARS = [
952
1016
  { name: "OALO_URL", desc: "Workspace URL; overrides the linked config." },
953
1017
  { name: "OALO_SYNC_TOKEN", desc: "Sync token; overrides the stored one." },
@@ -970,8 +1034,10 @@ export function overview() {
970
1034
  `Run \`oalo help <command>\` for detail, or \`oalo help --json\` for a`,
971
1035
  `machine-readable description of every command, flag and exit code.`,
972
1036
  ``,
973
- `Two token kinds, NOT interchangeable:`,
1037
+ `Environments (dev = staging, prod = live):`,
974
1038
  );
1039
+ for (const e of ENVIRONMENTS) lines.push(` - ${e}`);
1040
+ lines.push(``, `Two token kinds, NOT interchangeable:`);
975
1041
  for (const t of TOKENS) {
976
1042
  lines.push(` ${pad(t.kind, 5)} ${t.plane}`);
977
1043
  lines.push(` from ${t.where}`);
@@ -984,7 +1050,9 @@ export function commandHelp(name) {
984
1050
  const c = COMMANDS.find((x) => x.name === name);
985
1051
  if (!c) return null;
986
1052
 
987
- const lines = [`oalo ${c.name}: ${c.summary}`, ``, `Usage:`];
1053
+ const lines = [`oalo ${c.name}: ${c.summary}`, ``];
1054
+ if (c.env) lines.push(`Env: ${c.env}`, ``);
1055
+ lines.push(`Usage:`);
988
1056
  for (const u of c.usage) lines.push(` ${u}`);
989
1057
 
990
1058
  if (c.flags.length) {
@@ -1006,7 +1074,7 @@ export function commandHelp(name) {
1006
1074
  /** Machine-readable. Intended for an agent deciding how to drive the CLI. */
1007
1075
  export function helpJson() {
1008
1076
  return JSON.stringify(
1009
- { name: "oalo", tagline: TAGLINE, commands: PUBLIC, tokens: TOKENS, env: ENV_VARS },
1077
+ { name: "oalo", tagline: TAGLINE, environments: ENVIRONMENTS, commands: PUBLIC, tokens: TOKENS, env: ENV_VARS },
1010
1078
  null,
1011
1079
  2,
1012
1080
  );