Repository navigation
Conversation
Records every command's flags, positionals, aliases and defaults, the shell completion answers, and the exit code of malformed invocations from the Commander tree, and diffs the live surface against it. Differences must be declared in breaking-changes.json.
…/cli Adds command specs (startup/command-spec.ts) that registration, help and completion can read without loading Effect, the help renderer over them, argv preparation (aliases, default subcommands, pass-through, attached values, last-wins), and lib/command-parser.ts, which builds effect/cli commands from the specs and parses a command line. Ports apps, whoami, link and unlink to specs alongside their Commander registrants; a per-group test diffs each spec against the recorded surface.
…rface logs list --group-type and --status already accepted repeats through collectChoice; the recorder only recognised collectOptionValues.
…ment names for specs Record whether an option is variadic in the surface, and count webhooks listen --header as repeatable.
createProgram() now returns the root command spec. runProgram prepares argv, parses it with effect/cli (loaded lazily, so startup stays Effect-free), renders help itself, and maps parse errors to usage errors. Shell completion, telemetry, feedback --command and the integration harness walk the spec tree. The commander registrants, the setExamples augmentation and both commander dependencies are gone. BREAKING CHANGE: a parse error (unknown flag or subcommand, missing value, bad choice) exits 2 with the usage_error envelope in agent mode instead of exit 1 with plain text; --keys, --for and --android-fingerprint take one value per occurrence (repeat the flag or use commas); groups no longer have an implicit help subcommand (use clerk help <group> or --help).
Confirm, select, multiselect, text and password run on effect/cli's Prompt behind the Prompts service; search is a Prompt.Custom with an async source. A Terminal over stdin, or /dev/tty when stdin is piped, reads the keys. Spinners, intro/outro and gutter lines are drawn by an Effect-free frame renderer with the same line shapes. Agent mode and non-TTY runs still never render a prompt and fail the same way. BREAKING CHANGE: prompts look and respond differently (effect/cli style, y/n confirm, inline validation), and Ctrl-C while a spinner runs now exits 130 instead of 0.
🦋 Changeset detectedLatest commit: 7c8ccda The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
`bun --bun vitest` puts a `node` that runs Bun first on PATH, so `npx node …` tried to install the `node` package and the fixture dev servers ran on Bun. The e2e setup drops it from PATH; the worker itself still runs on Bun.
A vitest fork worker's stdin is a pipe that never closes, and `clerk api` without `-d` reads a non-terminal stdin to its end for a body, so every test user delete hung until the hook timed out. A shared `clerk` template in test/e2e/lib/cli.ts runs the CLI with stdin from /dev/null and replaces the per-file CLI_PATH constants.
Vitest sets VITEST, VITEST_*, TEST, MODE, DEV, PROD, SSR and BASE_URL in its workers, and the fixture dev servers inherited them. Astro skips installing its dev request handler when VITEST is set, so the Astro page never loaded Clerk. npm ci, the fixture builds, typechecks and dev servers now run with toolEnv(), which drops them.
Fixture files run in parallel, so their clerk link and clerk init calls reach the Platform API in a burst it can answer with 429. Setup runs in beforeAll, which vitest's retry does not rerun, so setupFixture runs once more in fresh temp dirs after a 429.
wyattjoh
force-pushed
the
wyattjoh/effect-rewrite-cli
branch
from
December 1, 2026 09:43
de52f1d to
33a8de6
Compare
Contributor
Author
|
Folded into #661, which now moves the CLI from Commander to native effect/cli in one PR, including the effect 4.1.7 upgrade. Closing this layer. |
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.
Summary
Bumps
effect,@effect/platform-bunand@effect/vitestfrom 4.0.3 to 4.1.7, and removes the two effect/cli workarounds that 4.1.7 makes unnecessary. This unblocks@distilled.cloud/clerkrc.21, which peers~4.1.7.Compile fixes for 4.1's API changes:
Terminalnow requires asizestream. The TTY terminal follows stdout resizes, and the parser and test terminals share a fixed 80x24 one.HttpClientRequest.methodwidened tostring, so webhook forwarding casts its method toHttpMethod.File.Info.devis now abigint, and the fake spawner revealsRedactedspawn args and env values.These workarounds stay because 4.1.7 still lacks the feature: multiple aliases, default subcommands, pass-through, last-wins repeats, a parent and child sharing a flag, variadic flags,
--prefixed values, and runtime completion.Evidence
clerk -v -v(and--version --version) exited 2 withInvalid value for flag --version: "2 occurrences". On 4.0.3 it printed the version.After: prints the version again. Pinned by
command-parser.test.ts(a repeated version flag ["-v","-v"] still prints the version).--version=true --version=true,-v --no-version,--no-help --no-helpand other mixes of spellings exited 2 the same way.After: every spelling of a built-in counts as the same flag and the first value is read, as on 4.0.3. Pinned by
a repeated built-in … still ends in ….clerk api ls --=userssearched for--=usersand exited 0.After: exits 2 with
Unrecognized flag: --, as on 4.0.3, and still gives way to help or the version (clerk --=x --help=trueprints help).--json truestayed a switch plus an argument only becauseprepareArgvrewrote it to--json=true.After:
parseAndRun(["users","--verbose","true"])givesverbose: true, user: "true"with no rewrite. The test fails ifwithOptionalValueis dropped.breaking-changes.jsontests pass with no new declared differences. A side-by-side run from source on 4.0.3 and 4.1.7, covering built-in spellings, their repeats and--=x, gives the same exit codes and stdout. Some usage errors differ in stderr only: the--=error has no "Did you mean this?" hint, a repeated--=xis reported once, theUnrecognized flag: --line is left out when a built-in is already being rejected, and some rejected--help/--versionvalues name the subcommand in the closingRun … --helpline where 4.0.3 namedclerk.--versionand--helpstartup time on the compiled binary is unchanged, within noise.Merge Danger
Door: two-way
Revert the branch to go back to 4.0.3; no data or config format changes.
Blast Radius: parsing
Every command line goes through the changed
prepareArgvand parser setup, so a missed edge case would show up as a usage error (exit 2) where a command used to run. Separately, Effect 4.1 no longer letscatch/catchTagrecover a failure when a finalizer also dies:fail(E).pipe(Effect.ensuring(die), Effect.catchTag("E", …))recovered on 4.0.3 and does not on 4.1.7, and the same goes foracquireReleaseandaddFinalizer. A failure next to a defect from concurrentEffect.allorforEachstill recovers. A command whose cleanup dies would now report an unexpected error instead of the tagged one. No test exercises this, and thecatchsites around resources have not been audited.Stacked on #661.