@oalo-ai/cli 0.1.1 → 0.3.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/man/oalo.1 +152 -4
- package/package.json +5 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/oalo/SKILL.md +39 -1
- package/src/commands/coord-bin.js +103 -0
- package/src/commands/db.js +336 -4
- package/src/commands/migrate.js +324 -0
- package/src/coord-release.json +25 -0
- package/src/help.js +77 -21
- package/src/index.js +18 -6
- package/src/migrate/plan.js +478 -0
- package/src/migrate/toml.js +242 -0
- package/src/migrate/yaml.js +179 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.3.0",
|
|
3
|
+
"targets": {
|
|
4
|
+
"darwin-arm64": {
|
|
5
|
+
"file": "oalo-coord-darwin-arm64.gz",
|
|
6
|
+
"sha256": "28713e014cec77f4cadbd76a3cad033a8263d51b7cd20b1f063f8b70cf32a8e6",
|
|
7
|
+
"bytes": 24850777
|
|
8
|
+
},
|
|
9
|
+
"darwin-x64": {
|
|
10
|
+
"file": "oalo-coord-darwin-x64.gz",
|
|
11
|
+
"sha256": "9139ca0b2733e1a560f244732846d9d4e9bc1035c76a03096c4f5b906206b796",
|
|
12
|
+
"bytes": 26989487
|
|
13
|
+
},
|
|
14
|
+
"linux-x64": {
|
|
15
|
+
"file": "oalo-coord-linux-x64.gz",
|
|
16
|
+
"sha256": "dca7ea4f4ea550cb25022d69dd4917268184731a8325d92d234c960ae3f048e5",
|
|
17
|
+
"bytes": 36881871
|
|
18
|
+
},
|
|
19
|
+
"linux-arm64": {
|
|
20
|
+
"file": "oalo-coord-linux-arm64.gz",
|
|
21
|
+
"sha256": "2cd721a2c1a987aedf18a99cbe62fe9379173a887ea72f5763a284353b5013c0",
|
|
22
|
+
"bytes": 37122672
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/help.js
CHANGED
|
@@ -245,18 +245,35 @@ export const COMMANDS = [
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: "db",
|
|
248
|
-
summary: "All of an env's data as plain SQL (every app's own tables and the Oalo models), to keep a copy or take it anywhere.",
|
|
249
|
-
usage: [
|
|
248
|
+
summary: "All of an env's data as plain SQL (every app's own tables and the Oalo models), to keep a copy or take it anywhere. Or load an existing Postgres database into an env.",
|
|
249
|
+
usage: [
|
|
250
|
+
"oalo db dump [--env dev|prod] [--out <file.sql>] [--force]",
|
|
251
|
+
"oalo db restore <file> --env dev|prod [--schema <name>] [--check] [--yes]",
|
|
252
|
+
"oalo db restore --from-env <VAR> --env dev|prod [--schema <name>] [--check] [--yes]",
|
|
253
|
+
],
|
|
250
254
|
flags: [
|
|
251
|
-
{ flag: "--env dev|prod", desc: "
|
|
255
|
+
{ flag: "--env dev|prod", desc: "dump: which env's data. Default prod. restore: which env the data goes into, always on the command line." },
|
|
252
256
|
{ flag: "--out <file.sql>", desc: "Where to write it. Default <workspace>-<env>-<date>.sql here." },
|
|
253
257
|
{ flag: "--force", desc: "Replace the file if it exists." },
|
|
258
|
+
{ flag: "--from-env <VAR>", desc: "restore: copy from a running database instead of a file. VAR is the environment variable that holds its postgres:// or postgresql:// URL. Only its host is ever shown." },
|
|
259
|
+
{ flag: "--schema <name>", desc: "restore: the source schema to load. Default public, or the only one when there's just one." },
|
|
260
|
+
{ flag: "--check", desc: "restore: do everything but the write, and report what would happen. Nothing is written, so it never asks." },
|
|
261
|
+
{ flag: "--yes", desc: "restore: go ahead with prod without asking. Needed for prod when there's no terminal to ask at." },
|
|
254
262
|
],
|
|
255
263
|
notes: [
|
|
256
264
|
"Workspace admins only: it holds every member's data. Restore it into any Postgres with psql -f.",
|
|
257
265
|
"Your code is in git (oalo deploy --pull); this is the data. Together they are everything you need to run your apps elsewhere.",
|
|
266
|
+
"restore loads a dump file made by pg_dump (like Heroku's latest.dump), up to 10 GB, or copies from a database URL. Admins only, and one restore at a time per Base.",
|
|
267
|
+
"The tables land in the env's schema, owned by the app's database login, so its Procfile `release:` migrations can alter them. Your app reads them at DATABASE_URL.",
|
|
268
|
+
"It's refused if a table name already exists there, and the names are listed. A failed restore leaves the env as it was.",
|
|
269
|
+
"The URL is never a flag value, since that stays in your shell history. Put it in a variable and pass --from-env VAR.",
|
|
270
|
+
"Run it with --check first. prod asks before it writes; without a terminal it needs --yes. Stop writes to the old database before the copy: writes made after it starts are lost.",
|
|
258
271
|
],
|
|
259
|
-
exits: {
|
|
272
|
+
exits: {
|
|
273
|
+
0: "a whole dump was written, or the restore (or check) passed",
|
|
274
|
+
1: "refused, unreachable, cut off (a partial dump is removed), or the restore failed or was declined",
|
|
275
|
+
2: "bad arguments, the file exists or is missing, or no CLI token",
|
|
276
|
+
},
|
|
260
277
|
},
|
|
261
278
|
{
|
|
262
279
|
name: "metrics",
|
|
@@ -560,6 +577,29 @@ export const COMMANDS = [
|
|
|
560
577
|
],
|
|
561
578
|
exits: { 0: "deployed", 1: "refused or failed", 2: "bad arguments, no CLI token, or not in a git repo" },
|
|
562
579
|
},
|
|
580
|
+
{
|
|
581
|
+
name: "migrate",
|
|
582
|
+
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.",
|
|
583
|
+
usage: [
|
|
584
|
+
"oalo migrate <heroku|railway|render|fly|primcloud> [--from-app <name>] [--env-file <file>] [--json]",
|
|
585
|
+
"oalo migrate <platform> --apply [--app <slug>]",
|
|
586
|
+
],
|
|
587
|
+
flags: [
|
|
588
|
+
{ flag: "--from-app <name>", desc: "The app or service on the old platform (a Heroku or Fly app, a Railway or Render service). Default: what that platform's CLI is linked to here, or fly.toml's app." },
|
|
589
|
+
{ flag: "--env-file <file>", desc: "More variables, from a .env file (NAME=value lines). They win over what the platform's CLI reported. For Primcloud, and for Fly secrets, which can't be read back." },
|
|
590
|
+
{ flag: "--apply", desc: "Write the Procfile and .oalo/app.json (never over an existing Procfile; app.json only gains keys it lacks), and set the variables on the app's prod env. Without it, nothing changes." },
|
|
591
|
+
{ flag: "--no-cli", desc: "Don't run the old platform's CLI; read only the files here and --env-file." },
|
|
592
|
+
{ flag: "--app <slug>", desc: "The Oalo app the variables go to. Default: the app this folder is linked to (oalo deploy --new links it)." },
|
|
593
|
+
{ flag: "--json", desc: "The plan as JSON: names only, never a value." },
|
|
594
|
+
],
|
|
595
|
+
notes: [
|
|
596
|
+
"Run it in the app's repo. It reads fly.toml, railway.json or railway.toml, render.yaml, app.json and the Procfile, and asks the platform's CLI for variables (heroku, railway), secret names (fly) and dyno sizes (heroku) when it's installed and signed in.",
|
|
597
|
+
"Variables: PORT and each platform's own (HEROKU_*, RAILWAY_*, RENDER_*, FLY_*) are left out, and DATABASE_URL becomes EXTERNAL_DATABASE_URL, since DATABASE_URL on Oalo is the Base's own Postgres. Values are never printed or written to a file; --apply sends them to prod without restarting the app.",
|
|
598
|
+
"It says what doesn't carry over: cron jobs, volumes and disks, private addresses (*.railway.internal, *.flycast), extra replicas, build commands, an Aptfile, a VM bigger than large.",
|
|
599
|
+
"The order: oalo migrate <platform> (read the plan), --apply, commit, oalo deploy --new, oalo migrate <platform> --apply again (now the app exists, it sets the variables), then the data (oalo db restore) and oalo deploy --env prod. `oalo docs migrating-from-<platform>` walks through it.",
|
|
600
|
+
],
|
|
601
|
+
exits: { 0: "the plan was shown, or applied", 1: "a config file couldn't be read, or the variables couldn't be set", 2: "bad arguments, an unknown platform, or no CLI token" },
|
|
602
|
+
},
|
|
563
603
|
{
|
|
564
604
|
name: "env",
|
|
565
605
|
summary: "An app's environment variables on Oalo (API keys, settings), per env: list, set, unset, rotate-token.",
|
|
@@ -818,40 +858,56 @@ export const COMMANDS = [
|
|
|
818
858
|
},
|
|
819
859
|
{
|
|
820
860
|
name: "coord",
|
|
821
|
-
|
|
822
|
-
// it's left out of help, the man page and help --json until it ships as a
|
|
823
|
-
// binary. `bun src/index.js coord` still runs it in development.
|
|
824
|
-
hidden: true,
|
|
825
|
-
summary: "Coordinate several agents on one codebase: task board, worktrees, merge queue.",
|
|
861
|
+
summary: "Several agents on one codebase: a shared task board, a worktree per task, a merge queue. First run: `oalo coord install`.",
|
|
826
862
|
usage: [
|
|
863
|
+
"oalo coord install [--force] [--json]",
|
|
827
864
|
"oalo coord init [--main <branch>] [--test-cmd <cmd>] [--merge auto|manual] [--signal-review]",
|
|
865
|
+
"oalo coord hooks install [--claude] [--opencode]",
|
|
828
866
|
"oalo coord mcp",
|
|
829
867
|
"oalo coord board [--json]",
|
|
830
868
|
"oalo coord events [--follow] [--since <id>] [--json]",
|
|
869
|
+
"oalo coord files [--json] [--main <branch>]",
|
|
870
|
+
"oalo coord view [--port <n>] [--main <branch>] [--no-open]",
|
|
831
871
|
"oalo coord claim <task>",
|
|
832
872
|
"oalo coord merge [--all]",
|
|
833
|
-
"oalo coord approve plan | merge <task> | signal <task> <milestone> | proposal <id>",
|
|
834
|
-
"oalo coord reject proposal <id>",
|
|
835
|
-
"oalo coord
|
|
836
|
-
"oalo coord hook <pre-tool|stop|subagent-stop|check-write|check-stop>",
|
|
873
|
+
"oalo coord approve plan [--yes] | merge <task> | signal <task> <milestone> | proposal <id> [--note <text>]",
|
|
874
|
+
"oalo coord reject proposal <id> [--note <text>]",
|
|
875
|
+
"oalo coord hook <pre-tool|stop|subagent-stop|check-write|check-stop|check-command>",
|
|
837
876
|
],
|
|
838
877
|
flags: [
|
|
878
|
+
{ flag: "--force", desc: "install: download again even if this version is installed." },
|
|
839
879
|
{ flag: "--main <branch>", desc: "init: branch the merge queue integrates into. Default: current branch." },
|
|
840
880
|
{ flag: "--test-cmd <cmd>", desc: "init: merge-gate test command. Default: detected (mix test, npm test, ...)." },
|
|
841
881
|
{ flag: "--merge auto|manual", desc: "init: manual holds each merge for `approve merge`." },
|
|
842
882
|
{ flag: "--signal-review", desc: "init: milestones unblock dependents only after `approve signal`." },
|
|
843
|
-
{ flag: "--
|
|
883
|
+
{ flag: "--yes", desc: "approve plan: skip the confirmation after the plan is shown." },
|
|
884
|
+
{ flag: "--note <text>", desc: "approve/reject proposal: a note the worker sees with the decision." },
|
|
885
|
+
{ flag: "--json", desc: "install/board/events/files: machine-readable output." },
|
|
844
886
|
{ flag: "--follow", desc: "events: keep streaming." },
|
|
845
887
|
{ flag: "--all", desc: "merge: keep merging until the queue is idle or blocked." },
|
|
846
888
|
],
|
|
847
889
|
notes: [
|
|
848
|
-
"
|
|
849
|
-
"
|
|
850
|
-
"
|
|
851
|
-
"
|
|
852
|
-
"
|
|
853
|
-
|
|
854
|
-
|
|
890
|
+
"Coord lets several coding agent sessions (Claude Code, OpenCode, Codex, any MCP client) work on one git repo at once. It runs on your machine; the board is .oalo/coord.db in the repo. No Oalo workspace or sign-in is needed. Full guide: https://oalo.ai/docs/several-agents-one-repo (or `oalo docs several-agents-one-repo` when signed in).",
|
|
891
|
+
"Setup, once per machine: `oalo coord install` downloads coord for it (about 25 MB on macOS, 37 MB on Linux, checked against this package's checksum). Once per repo: `oalo coord init`, then `oalo coord hooks install`, then commit .oalo/coord.json, .gitignore, .claude/settings.json, .mcp.json, opencode.json and .opencode/. .claude/settings.local.json holds this machine's worktree folder and stays out of git.",
|
|
892
|
+
"Coord never starts agents. The person opens the sessions, or a manager starts workers as its harness's own subagents. Every session opened in the repo, or in a task's worktree, gets the board's tools through the `oalo-coord` MCP server that hooks install registers; the server finds the one board from any worktree. The board also gives each session a short orientation; the person tells it its role. Manager: \"You're the oalo coord manager for this repo. Call manager_guide, then plan: <goal>\". Worker: \"You're an oalo coord worker. Call task_next and follow the brief.\"",
|
|
893
|
+
"Manager: reads manager_guide (the full playbook), then drafts tasks with task_create (title, spec, acceptance criteria, writes: the globs it may change, provides: milestones it will signal, depends_on), then calls plan_submit. Nothing runs until the person approves. Then it handles the inbox (inbox, ack, answer, decide), reviews reports (task_detail, task_reopen) and merges (merge_next). Other tools: task_update, task_cancel, board, wait.",
|
|
894
|
+
"Worker: calls task_next, which returns a claim token, its own git worktree and a brief with the spec and how to finish. It works only inside that worktree and its write set, commits, calls signal as soon as a milestone others wait on is committed, and ends with task_done or task_fail and a report. Other tools: release (paths it is finished with), signal_amend, lease_acquire / lease_release (a port, the dev database, migrations), ask, propose_change, report_blocked, notify, wait. Every worker call passes its claim.",
|
|
895
|
+
"Messages need no polling: each worker reply carries its notices (answers, decisions, changed dependencies) and who is waiting on it. In Claude Code and OpenCode, a worker that stops while holding a task is sent back to finish it (up to three times) and gets answers to its questions. In Claude Code the manager's stop also waits for its inbox while tasks are running; in other harnesses the manager calls wait.",
|
|
896
|
+
"Only a person approves, in their own terminal: `approve plan` (shows the design, the tasks and their files, then asks to type yes; it covers only the drafts sent with plan_submit, unchanged since), `approve merge`, `approve signal`, `approve proposal`, `reject proposal`. They refuse from an agent's shell. An agent tells the person what is waiting and the command to run.",
|
|
897
|
+
"Scheduling: a task starts when every milestone it depends on is signalled and no running task's write set overlaps its own. A worker that signals a milestone mid-task lets its dependents start from that commit right away.",
|
|
898
|
+
"Merge queue (merge_next, `oalo coord merge`): one run at a time. A task merges with a merge commit after every task it builds on has merged, and only if the project's test command passes, then the task's own test_cmd if it has one. A conflict or failing test sends it back to a worker with the output. A branch that changes .oalo/coord.json, .oalo/setup or the hook and MCP config waits for `approve merge`.",
|
|
899
|
+
"Rework: task_reopen, a merge conflict or a failing merge test sends a task back, and they count together: first held for the same worker for claim_ttl_s, then any worker; the third time it stops as needs_human until the manager sets it back to ready. A worker silent for claim_ttl_s (15 minutes) loses its claim, the manager gets its commits in a report, and the next worker resumes the same worktree.",
|
|
900
|
+
"Settings in .oalo/coord.json (a person edits them): main_branch, test_cmd, merge (auto or manual), signal_review, claim_ttl_s, port_base, port_span. Task worktrees live in ~/.oalo/worktrees/<repo>-<hash>/<task> (OALO_HOME moves them). An executable .oalo/setup runs in each new worktree with OALO_TASK_ID, OALO_WORKTREE, OALO_PROJECT_ROOT, OALO_PORT_BASE, OALO_PORT_SPAN and OALO_DB_NAME set.",
|
|
901
|
+
"The hooks block edits outside a worker's worktree and write set, and edits to coord's own files. Shell writes (sed -i, redirects) aren't intercepted; the merge queue still catches their damage. Harnesses without hooks rely on the merge queue alone.",
|
|
902
|
+
"macOS and Linux only.",
|
|
903
|
+
],
|
|
904
|
+
exits: {
|
|
905
|
+
0: "ok",
|
|
906
|
+
1: "operation refused or failed (message on stderr)",
|
|
907
|
+
2: "bad arguments",
|
|
908
|
+
3: "no board here; run `oalo coord init`",
|
|
909
|
+
4: "coord isn't installed on this machine; run `oalo coord install`",
|
|
910
|
+
},
|
|
855
911
|
},
|
|
856
912
|
];
|
|
857
913
|
|
package/src/index.js
CHANGED
|
@@ -32,6 +32,9 @@ import { channels } from "./commands/channels.js";
|
|
|
32
32
|
import { products } from "./commands/products.js";
|
|
33
33
|
import { metrics, dashboards } from "./commands/metrics.js";
|
|
34
34
|
import { db } from "./commands/db.js";
|
|
35
|
+
import { migrate } from "./commands/migrate.js";
|
|
36
|
+
import { coordInstall, coordRun } from "./commands/coord-bin.js";
|
|
37
|
+
import { existsSync } from "node:fs";
|
|
35
38
|
import { overview, commandHelp, helpJson, COMMANDS } from "./help.js";
|
|
36
39
|
import { parse } from "./args.js";
|
|
37
40
|
|
|
@@ -169,6 +172,9 @@ async function dispatch(cmd) {
|
|
|
169
172
|
case "db":
|
|
170
173
|
await db(flags, rest);
|
|
171
174
|
break;
|
|
175
|
+
case "migrate":
|
|
176
|
+
await migrate(flags, rest);
|
|
177
|
+
break;
|
|
172
178
|
case "secrets":
|
|
173
179
|
await secrets(flags, rest);
|
|
174
180
|
break;
|
|
@@ -203,13 +209,19 @@ async function dispatch(cmd) {
|
|
|
203
209
|
await mcp(flags);
|
|
204
210
|
break;
|
|
205
211
|
case "coord": {
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
212
|
+
// Coord needs bun:sqlite, so it ships as its own compiled binary that
|
|
213
|
+
// `oalo coord install` downloads. Under Bun with the sources present
|
|
214
|
+
// (development), it runs from source instead.
|
|
215
|
+
if (rest[1] === "install") {
|
|
216
|
+
await coordInstall(flags);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
if (typeof Bun !== "undefined" && existsSync(new URL("./commands/coord.ts", import.meta.url))) {
|
|
220
|
+
const { coord } = await import("./commands/coord.ts");
|
|
221
|
+
await coord(flags, rest);
|
|
222
|
+
break;
|
|
210
223
|
}
|
|
211
|
-
|
|
212
|
-
await coord(flags, rest);
|
|
224
|
+
coordRun(process.argv.slice(process.argv.indexOf("coord")));
|
|
213
225
|
break;
|
|
214
226
|
}
|
|
215
227
|
}
|