Repository navigation
feat(cli): align the CLI with the cli-contract spec (F1) - #20
Merged
Merged
Conversation
Ported from Paddock, whose CLI this is, by three-way merging Paddock's own
changes onto Managers: B1 (paddock#981, #983), the launchd bootout/bootstrap
race fix (paddock#984) and the systemd restart-an-active-unit fix (paddock#986).
- /api/health answers { ok, version } (version.ts, shared with the OpenAPI
document and the management MCP handshake).
- `serve`, with `start` a permanent alias; the server logs to stderr so the
first stdout line is `Managers <version>: <url>`.
- Exit codes: usage errors 2 with the usage after; `service status` 0/3/4;
logs/start/stop/restart 4 with no unit; an install that never answers 1.
- `service status --json`, `service logs [-f] [-n]`; Linux logs go to
<data>/logs/service.log, rotated by copy-and-truncate.
- Units: realpath'd Node, a rebuilt PATH, quoted ExecStart, a linger check.
- launchd: poll until a bootout has finished, retry bootstrap on 5/37.
- systemd: install restarts a unit that was already active.
- Real-service CI (scripts/service-real.mjs) and the conformance runner
(@edspencer/cli-conformance ^0.2.0): 7 passed, 2 skipped (busy, F2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave F1 of the CLI-contract rollout (edspencer/cli-contract SPEC 0.2): Paddock's alignment, ported. Managers' CLI is Paddock's nearly line for line, so this is Paddock's own change applied by a three-way merge (Paddock before → Paddock after, with the Paddock→Managers renames applied to both sides, onto Managers) rather than rewritten:
launchd.tsonly; the rest of #984 is F2)systemd.tsonly)Conflicts were all Managers-only lines sitting next to Paddock's (the M14.5
/api/securityroute beside the new health route,start.ts's env scrub / MCP sequestering /loopbackNoAuth, Managers' own README), resolved by keeping both.What a user or script sees (minor changeset, which names each exit-code change):
/api/health→{ ok, version }, one version shared with the OpenAPI document and the management MCP handshake.managers serve, withstarta permanent alias. Server logs go to stderr, soserve's first stdout line isManagers <version>: <url>.service statusexits 0 / 3 / 4;logs,start,stop,restartexit 4 with no unit; an install that never answers exits 1.service status --json(matches the contract'sservice-status.schema.json),service logs [-f] [-n].<data-dir>/logs/service.log(rotated by copy-and-truncate at 8 MB, three generations), not the journal.PATH, quotedExecStart, a linger check, warnings for a vanished Node / version gap.installrestarts a unit that was already active.CI: two new jobs from Paddock —
CLI conformance(@edspencer/cli-conformance^0.2.0 against the packeddist-npm) andService (real launchd / real systemd)(scripts/service-real.mjs).cli-contract.jsonpins a throwaway data dir, batch drive mode (withMANAGERS_ALLOW_BATCH_DRIVE=1), and nullsHOST,PORT,NODE_ENVand the Claude credentials.Testing
check:nulclean.busy/busy-json, which F2 turns on).HOME:--versionbare;service statusandservice logswith no unit → 4;service bogus,serve --nope,logs→ 2 with the usage. Scoped flags (e.g.-fonstatus) arrive with F2/F3's flag table.Servicejobs here are the proof.No UI change.
🤖 Generated with Claude Code