feat: Support POSIX-style short-flag bundling in CLI parser#1047
Conversation
🦋 Changeset detectedLatest commit: 8b4fdd8 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 |
arkenv
@arkenv/bun-plugin
@arkenv/cli
@arkenv/fumadocs-ui
@arkenv/vite-plugin
commit: |
📦 Bundle Size Report✅ All size limits passed! |
There was a problem hiding this comment.
Important
One parser edge case should be fixed before merging: bundled -e does not inherit dash-prefixed value preservation.
Reviewed changes — This PR adds short-flag bundle expansion to the @arkenv/cli argument parser while keeping the existing init command surfaces.
- Expand bundled boolean flags —
CLInow rewrites short bundles such as-yqand-yfqinto individual short flags before validation. - Preserve raw value followers — The parser attempts to avoid expanding the token after raw value-taking flags such as
-e/--example. - Cover parser behavior —
packages/cli/src/cli/cli.test.tsadds cases for bundled flags, positional names, and dash-prefixed followers. - Release note —
.changeset/posix-flag-bundling.mdrecords a minor@arkenv/clichange.
GPT | 𝕏
|
Addressed review #4336035989 by preserving dash-prefixed values after bundled value-taking flags and adding a regression test for Task list (8/8 completed)
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Since the prior Pullfrog review, this PR changed only the @arkenv/cli release classification for the short-flag bundling feature.
- Downgraded
@arkenv/clichangeset bump —.changeset/posix-flag-bundling.mdnow marks the change as apatchrelease instead ofminor, which is consistent with existing pre-1.0 CLI changelog precedent for non-breaking capability additions.
GPT | 𝕏
… to dynamic getters
There was a problem hiding this comment.
Important
The latest refactor breaks bundled short flags at runtime because the expansion path references a removed flag set.
Reviewed changes — Since the prior Pullfrog review, this PR fixed bundled -e value preservation and centralized CLI flag metadata while keeping the init parser surface unchanged.
- Preserved bundled value followers — Bundles ending in
-e, such as-yqe, now carry the same next-token preservation rule as raw-e/--example. - Centralized parser flag definitions —
CLInow derives known and value-taking flags fromFLAG_CONFIGinstead of duplicating those lists in the constructor. - Converted flag state to getters —
isAgent,isYes,isQuiet,isJson,isForce,helpRequested, andexamplenow read from parsed args dynamically, with agent mode still implying yes/quiet/json. - Expanded parser coverage —
packages/cli/src/cli/cli.test.tsnow covers--agent/-apreset behavior and dash-prefixed followers after bundled value-taking flags.
GPT | 𝕏
|
INFO 2026-05-21T11:14:01 +17ms service=bus type=session.updated publishing
|
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @arkenv/cli@0.2.1 ### Patch Changes - #### Fix --help table alignment _[`#1052`](#1052) [`cf7bd02`](cf7bd02) [@yamcodes](https://github.com/yamcodes)_ - #### Support POSIX-style short-flag bundling in CLI parser _[`#1047`](#1047) [`b2e4865`](b2e4865) [@yamcodes](https://github.com/yamcodes)_ Enables combining multiple short flags (e.g. `-yq` instead of `-y -q` or `-yfq` instead of `-y -f -q`) in CLI commands. Flag values starting with `-` (e.g. `init -e -abc`) are preserved without expansion. - #### Validate valued CLI flags and reject missing values _[`#1051`](#1051) [`dec2581`](dec2581) [@yamcodes](https://github.com/yamcodes)_ Add parser-level validation to reject flags that require a value (e.g. `--example` or `-e`) when they are passed without one. A validation error message is set, and the CLI exits with status code 1. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Fixes #1032
Enables POSIX-style combined short-flags (e.g.,
-yfq->-y,-f,-q) in CLI commands, and preserves values starting with-immediately following value-taking flags (like-e/--exampleand-n/--name).