oleander-cli 0.25.4 → 0.27.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.
Files changed (3) hide show
  1. package/README.md +74 -0
  2. package/dist/index.cjs +1554 -70
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -150,6 +150,10 @@ oleander queries list
150
150
  oleander queries get daily_runs
151
151
  oleander query "$(oleander queries get daily_runs --query-only)"
152
152
 
153
+ # Edit notebooks as YAML files
154
+ oleander notebooks pull bluehouse-morning
155
+ oleander notebooks push bluehouse-morning.notebook.yaml --run
156
+
153
157
  # Profiles (one API key each)
154
158
  oleander configure --profile acme
155
159
  oleander switch acme
@@ -303,6 +307,76 @@ Note: `oleander query submit --destination` writes **query results** to a table.
303
307
  `oleander query --save` and `--table-name` flags are gone; a read no longer
304
308
  writes a table.
305
309
 
310
+ ## Notebooks
311
+
312
+ Notebooks round-trip as YAML files, so you (or a coding agent) can edit one in
313
+ your editor and review it in a pull request like any other code.
314
+
315
+ ```bash
316
+ oleander notebooks pull bluehouse-morning # writes bluehouse-morning.notebook.yaml
317
+ oleander notebooks plan bluehouse-morning.notebook.yaml # what saving would change
318
+ oleander notebooks push bluehouse-morning.notebook.yaml --run
319
+ ```
320
+
321
+ - `pull <slug>` writes `<slug>.notebook.yaml` exactly as saved, comments
322
+ included, and records the version it read in `.oleander/notebooks.json` in the
323
+ current directory.
324
+ - `push <file>` reads the slug from the file, prints the plan, then saves with
325
+ the recorded version as `If-Match` and records the new version. Validation
326
+ errors print as `path: message`. With `--run` it waits for the run (up to 10
327
+ minutes) and prints each cell's status, row count and error; a failed run
328
+ exits non-zero.
329
+ - A change that adds output tables, a schedule, destinations or a budget needs
330
+ an approved plan. `push` prints the plan, saves nothing and exits non-zero;
331
+ rerun it with `--plan-id <plan_id>` once you have reviewed it.
332
+ - If someone saved the notebook since your last pull, `push` stops with a
333
+ conflict. Copy your edits aside, `pull` again (it overwrites the file), merge
334
+ and push.
335
+ - `plan <file>` prints the diff, output tables, schedule, destinations,
336
+ packages, missing grants, the cost estimate and whether approval is needed.
337
+
338
+ On a live notebook (one with a schedule, an input trigger, an output table or a
339
+ destination) `push` saves a draft and leaves the published version alone. Draft
340
+ runs write to draft tables rather than the published outputs, and never deliver
341
+ anything. Publish the draft with the plan id `push` prints:
342
+
343
+ ```bash
344
+ oleander notebooks publish bluehouse-morning --plan <plan_id>
345
+ oleander notebooks plan bluehouse-morning --publish # a fresh publish plan
346
+ ```
347
+
348
+ Runs:
349
+
350
+ ```bash
351
+ oleander notebooks runs bluehouse-morning
352
+ oleander notebooks logs bluehouse-morning <run_id> [--cell posts_by_hour]
353
+ oleander notebooks cancel bluehouse-morning <run_id>
354
+ oleander notebooks compare bluehouse-morning <run_a> <run_b>
355
+ oleander notebooks backfill bluehouse-morning --param day --from 2026-11-01 --to 2026-11-15
356
+ oleander notebooks backfill bluehouse-morning --param day --from 2026-11-01 --to 2026-11-15 --plan-id <plan_id>
357
+ ```
358
+
359
+ `backfill` without `--plan-id` prints the plan and its cost estimate and starts
360
+ nothing. Every `notebooks` command takes `-o json`.
361
+
362
+ ### Sync from a repository
363
+
364
+ `sync` saves every changed `*.notebook.yaml` under a path, so a repository can
365
+ own your notebooks:
366
+
367
+ ```bash
368
+ oleander notebooks sync notebooks/ --dry-run # plan only
369
+ oleander notebooks sync notebooks/ --approve --publish # save and publish
370
+ ```
371
+
372
+ `--approve` applies changes that add outputs, a schedule, destinations or a
373
+ budget. `--publish` publishes live notebooks' drafts. `--summary <file>` writes
374
+ a Markdown report. Deleted files are ignored.
375
+
376
+ In GitHub Actions, use
377
+ [OleanderHQ/sync-oleander-notebooks](https://github.com/OleanderHQ/sync-oleander-notebooks):
378
+ it plans on pull requests and syncs on merge.
379
+
306
380
  ## Guidance for coding agents
307
381
 
308
382
  See [`AGENTS.md`](AGENTS.md) for command discovery, safe automation, and output-handling rules.