Repository navigation
Conversation
Commands, groups and flags are now effect/cli Command, Flag and Argument values, and handlers are lazily imported Effect programs. Help and shell completion come from effect/cli (HelpDoc and Completions), replacing the command spec, the hand-written parser, the help formatter, the argv shims and the runtime __complete engine. cli.ts keeps an Effect-free --version fast path; everything else loads the command tree.
Record the command tree, every listed command's help, each shell's completion script and the parse-error envelopes, and keep oxfmt off the recorded files.
…eploy as deploy run A boolean flag took a following true/false/yes/no word as its value, so --json true ran the command; every boolean flag now goes through booleanFlag (Flag.withOptionalValue), as the spec parser did, and help still lists it as a plain switch. Bare clerk deploy is recorded as deploy run again in usage telemetry and feedback, the path the warehouse's deploy contract reads. The surface tests cover the parse cases the old argv shims handled.
|
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
|
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.
Stacked on #662 (base 7c8ccda).
Summary
Commands are now plain
effect/clivalues, andeffect/cliowns parsing, help and completion. The Commander-shaped layer between them is gone.packages/cli-core/src/ ├── cli.ts # Effect-free --version fast path, else runProgram ├── cli-program.ts # Command.make("clerk") + runWith, usage_error envelope ├── lib/ +│ ├── command.ts # global flags, flag helpers, action(path, run) -│ └── command-parser.ts ├── startup/ -│ ├── command-spec.ts -│ ├── help-format.ts -│ └── argv.ts ├── commands/<group>/index.ts # Command.make / Flag / Argument / withSubcommands ├── commands/completion/ -│ ├── __complete.ts -│ └── shells/*.ts # replaced by Completions.generate └── test/surface/ # Commander fixture + argv corpus → tree, help and completion snapshotsactionkeeps the startup contract: telemetry,--verbose,--mode, the environment banner and the update notice. Shims remain only where agent mode or scripts depend on them:--input-jsonexpansion,--modeon usage errors, theusage_errorenvelope with exit 2, a bare group exiting 1, and the Effect-free--version.Evidence
After: 308 test files, 8952 tests, all passing. Parsing is pinned by a snapshot of the command tree, a help snapshot per command, a completion script per shell, and a parse-error table:
--versionis the same or faster, since it never loads Effect;--helpis slower, since it loads Effect and the command tree; a parsed command is about the same.Merge Danger
Door: two-way
Reverting restores the old parser. Users who regenerated their shell completion would need to regenerate it again.
Blast Radius: CLI-wide
Every command line goes through the new parser. Breaking changes:
DESCRIPTION / USAGE / FLAGS / GLOBAL FLAGS / SUBCOMMANDS / EXAMPLES), in declaration order.clerk help <command>is gone: use--help.__completeand values computed at completion time (mcp install --client,migrate --source) are gone, andclerk completionneeds a shell.auth loginkeepssignin(signupandsign-inare gone), andauth logoutkeepssignout(sign-outis gone).--help --help,-h -hand--version=true --version=true; a bareclerk --version --versionstill prints the version.--=<value>is read as an argument: a usage error where none is taken, the endpoint inclerk api --=users.-X POST, not-XPOST), and a value starting with-needs--flag=-x.impersonate revoke --openis rejected,deploy status --domainreports an unknown flag, anddeploy --domain x statusignores the flag.deploy runis gone: runclerk deploy, which usage telemetry still records asdeploy run.mcp runno longer passes flags through, so a flag after it is a usage error.--xand also accepts that positive form (--skills,--with-identities).--modevalue is a parse error raised before any command starts, so it sends no usage telemetry event.--input-jsonreplaces the JSON key of the same name.