Repository navigation
Closed
Labels
area:cliTouches the cli areaarea:docsTouches the docs areaready-for-agentFully specified, ready for an AFK agent
Description
Problem
The CLI is commander with hand-rolled exit codes and its own HTTP calls. It moves to effect/unstable/cli on the derived HttpApiClient and promises the contract decided on CLI contract on Effect cli.
Do
- Commands
auth set,whoami,status,validate,upload(anddeleteif #41 has landed) asCommands; all HTTP through@patchy/api's client onNodeHttpClient. - Exit codes: one
CliErrorunion, each tag carryingkind: "local" | "rejected" | "unreachable"; one tablekind → 1 | 2 | 3; 130 on interruption; nothing else. HTTP status → kind: 4xxrejected, 5xx / connect / timeout / unparseableunreachable. --jsonglobal flag: success one stdout document in theapishape, stderr empty (upload warnings inwarnings: []); failure{ ok: false, error, kind }on stderr, stdout empty.--api-urlglobal flag feeding oneInstanceservice:--api-url>.local/dev/env(walk up from cwd) >PATCHY_API_URL>~/.patchy> default; exposes URL + source;status --jsonreports it and mutating commands print "target came from …".- Signals: Effect's mapping (SIGINT/SIGTERM → interrupt → 130, no
128+n); the hidden-token prompt's terminal restore as anacquireReleasefinalizer. - Built-ins: Effect's defaults stay (
--help,--versionprinting the bare version,--completions,--wizard,--log-level); defects render as oneUnexpected error: <message>line, exit 1, stack only at--log-level debug. Starting point:packages/effect-slice/src/cli.tsonprototype/effect-slice(CliOutput.layeroverrides). - Bundle: esbuild with the
createRequirebanner (packages/effect-slice/scripts/build-cli.mjs);skills/still copied in. - e2e (
scripts/packed-cli-e2e.mjs): keep asserting contract — exit codes per the ladder, one-line stderr, bare--version, token never in argv/output,--jsonshapes; move the 130/143 signal probes and process-group assertions to harness tests or drop them. - ADR CLI contract for agents in
docs/adr/(the ladder + the.local/dev/envprecedence); move the Publishing glossary intopackages/cli/CONTEXT.md(agents primary operator, developers secondary). Promote the language-service warnings toerrorfor the package. Updatepackages/cli/README.mdandskills/patchy/SKILL.mdfor the exit codes and--json.
Done when
The packed-CLI e2e passes on the ladder; pnpm dev then patchy upload in the worktree targets the local instance with no env set; commander is gone from the lockfile.
Decisions implemented
Spec §5; CLI contract on Effect cli; Local dev environment (precedence); vertical slice.
Filed from the Effect v4 port spec (#68) by the map task Write the port spec and file the build tickets.
Metadata
Metadata
Assignees
Labels
area:cliTouches the cli areaarea:docsTouches the docs areaready-for-agentFully specified, ready for an AFK agent
Activity
chore(lint): the Effect ESLint rules, and every language-service rule…
chore(lint): the Effect ESLint rules, and every language-service rule…
feat(server): serve on HttpApi and HttpRouter; delete config and db (#88