@odla-ai/cli 0.17.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,73 @@ hosted security command.
16
16
  It does not know about any specific app. App identity, environments, services,
17
17
  schema, rules, integrations, auth, AI provider, and links all come from config.
18
18
 
19
+ ## Start with the runbooks, not this file
20
+
21
+ odla's operational procedures — releasing, backups, database work, security
22
+ setup — are **rows in a database**, not documents in a package. They are edited
23
+ the moment a step turns out to be wrong, with no release in between. So the
24
+ answer this CLI fetches is current, and every written copy of it (including
25
+ this README, and including your training data) is a snapshot of some earlier
26
+ day.
27
+
28
+ Ask before you search the web or work from memory:
29
+
30
+ ```bash
31
+ npx @odla-ai/cli runbook ask "how do I roll back a bad publish?" # written, cited answer
32
+ npx @odla-ai/cli runbook search "restore a tenant" # the passages behind it
33
+ npx @odla-ai/cli runbook get release # the whole procedure
34
+ npx @odla-ai/cli runbook list # what exists
35
+ ```
36
+
37
+ Reading works for any signed-in developer and needs no `odla.config.mjs` — the
38
+ advice is most useful before there is a project.
39
+
40
+ **Runbooks are procedure; JSDoc is API.** What a function takes, returns, and
41
+ guarantees is documented on the export itself, ships in the installed
42
+ `.d.ts`, and renders per package at <https://odla.ai/docs>. A runbook will tell
43
+ you *when* to call something and never invents a signature. Most real questions
44
+ need both halves — take the steps from the runbook and the arguments from the
45
+ JSDoc, and neither from memory.
46
+
47
+ **After you change something, ask which runbooks you invalidated:**
48
+
49
+ ```bash
50
+ npx @odla-ai/cli runbook impact # vs origin/main, uncommitted work included
51
+ npx @odla-ai/cli runbook impact --base HEAD~1
52
+ ```
53
+
54
+ It diffs the working tree, works out which surfaces moved — a package, its
55
+ exported API, a JSDoc block, a console area — and names the runbooks whose steps
56
+ describe them, with the command to read each one. Changing an exported API or
57
+ its JSDoc is exactly when a procedure quoting that API goes stale, so run it
58
+ before you call the change finished. Fixing what it finds is one command and
59
+ takes effect immediately:
60
+
61
+ ```bash
62
+ npx @odla-ai/cli runbook edit db --note "retract replaced the null write"
63
+ ```
64
+
65
+ Platform runbook edits need admin or the `platform:runbook:write` capability,
66
+ which the CLI requests for you; a plain handshake token is never admin by
67
+ design, and `odla-ai whoami` reports what this terminal actually holds.
68
+
69
+ **Is the corpus itself still true?**
70
+
71
+ ```bash
72
+ npx odla-ai runbook lint
73
+ ```
74
+
75
+ Because a runbook is edited without a release, its text can name a command that
76
+ only a newer CLI has — and no gate in any repository can see that, since the
77
+ text is a row in a database rather than a file. `lint` closes that: it holds
78
+ every `odla-ai …` command the runbooks name against this CLI's actual command
79
+ surface, and against the minimum versions each runbook declares in `requires`.
80
+
81
+ A runbook may record the versions its steps assume, as `name@version` specs read
82
+ as minimums (`@odla-ai/cli@0.18.0`). When yours is older, `runbook get` says so
83
+ on **stderr** — never stdout, so piping the procedure into an agent still yields
84
+ the procedure and nothing else.
85
+
19
86
  ## Install
20
87
 
21
88
  No install needed — the package ships a single `odla-ai` binary, so npx can run
@@ -54,13 +121,21 @@ npm i -D --save-exact @odla-ai/cli@0.16.6
54
121
  ## Commands
55
122
 
56
123
  ```bash
124
+ npx odla-ai runbook ask "how do I roll back a bad publish?"
125
+ npx odla-ai runbook search "restore a tenant" --limit 5
126
+ npx odla-ai runbook get release
127
+ npx odla-ai runbook list
128
+ npx odla-ai runbook impact --base origin/main
129
+ npx odla-ai runbook lint
130
+ npx odla-ai runbook edit db --note "what changed"
131
+ npx odla-ai runbook comment release --body "step 4 no longer applies"
132
+ npx odla-ai whoami
57
133
  npx odla-ai setup
58
134
  npx odla-ai init --app-id my-app --name "My App"
59
135
  npx odla-ai doctor
60
136
  npx odla-ai calendar status --env dev
61
137
  npx odla-ai calendar calendars --env dev
62
138
  npx odla-ai calendar connect --env dev
63
- npx odla-ai calendar resync --env dev
64
139
  npx odla-ai calendar disconnect --env dev --yes
65
140
  npx odla-ai capabilities --json
66
141
  npx odla-ai code connect --platform https://odla.ai --app-id my-app --env dev --email owner@example.com
@@ -260,19 +335,18 @@ agent automation. Once connected, `calendar calendars` lists ids visible to the
260
335
  Google identity so the checked-in selection can be refined. `calendar connect`
261
336
  applies the checked-in booking-page setting and starts consent when the
262
337
  connection is absent, failed, disconnected, or degraded (so an agent can
263
- repair revoked credentials); a healthy connection is reused. A `needs_sync`
264
- connection already has provider credentials, so connect/provision resyncs it
265
- without requesting Google consent again; an existing authorization or initial
266
- sync is awaited instead of creating a duplicate attempt.
267
- `calendar resync` asks the hosted connector to sync immediately; `calendar
268
- disconnect --yes` stops watches and deletes this app/environment connection's
269
- encrypted platform token and cursors without purging retained mirror rows,
270
- which may therefore remain readable but stale. It does not revoke the shared
271
- user-to-Google-OAuth-project grant, because that could invalidate other odla
272
- connections for the same user. A future explicitly global revoke command would
273
- need cross-connection accounting and warning. Production resync requires
274
- `--yes`, as does a direct production connect. None of these commands accepts a
275
- Google authorization code, client secret, access token, or refresh token.
338
+ repair revoked credentials); a healthy connection is reused. A connection that
339
+ already holds provider credentials is reused without requesting Google consent
340
+ again, and an in-flight authorization is awaited rather than duplicated.
341
+
342
+ Nothing syncs: Google Calendar is the source of truth and odla stores no events
343
+ and no attendees, so there is no resync to ask for. `calendar disconnect --yes`
344
+ deletes this app/environment connection's encrypted platform token. It does not
345
+ revoke the shared user-to-Google-OAuth-project grant, because that could
346
+ invalidate other odla connections for the same user. A future explicitly global
347
+ revoke command would need cross-connection accounting and warning. A direct
348
+ production connect requires `--yes`. None of these commands accepts a Google
349
+ authorization code, client secret, access token, or refresh token.
276
350
 
277
351
  The SDK uses the existing server-side db values (`ODLA_ENDPOINT`,
278
352
  `ODLA_TENANT`, `ODLA_API_KEY`), so calendar adds no Worker secret. Never expose