Brocli is a TypeScript/JavaScript library for building modern command line interfaces (CLIs) with a typed API. It parses shell arguments, provides built-in validation for typed options, and supports hooks like transforming parsed parameters before running command handler logic.
Project status
- Actively maintained: The most recent evidence is an upstream push and tagged update to 0.12.0 on 2026-04-07, which is recent relative to today (2026-08-11).
- Update cadence: After 0.10.1 on 2024-08-13 and 0.11.0 on 2024-11-05, the project had a long gap before 0.12.0 on 2026-04-07, suggesting a generally slower cadence overall, with at least one update within the last few months.
AI summary generated
Recent updates
0.12.0
Version 0.12.0 extends BroCli so that global option values are available to the theme, help, and version callbacks. It also fixes how required option help renders data types. The code changes go beyond the release notes by updating several callback and event handler TypeScript signatures and event shapes.
Features0.11.0
Version 0.11.0 introduces the concept of global options (via a new `globals` config) so they can be processed and consumed in the `run` hook. The release notes are brief, but the code adds new parsing, validation, and event payload fields related to these globals.
Features0.10.1
Version 0.10.1 primarily changes how the default global help output formats command descriptions. The release notes mention a fix for using an outdated command description handler, and the code diff shows an updated description rendering logic in the help/event handler.
0.10.0
Brocli 0.10.0 focuses on improving CLI help output and standardizing event payloads and naming. It introduces a new `name` (replacing `cliName`) and adds a `description` field to `run()` config, while reworking the event system so all errors are emitted as a single `error` event type.
BreakingFeatures0.9.2
Release 0.9.2 extends the `unknownCommandEvent` payload to include the list of available commands. This change is implemented both in the event type definition and in the error/event emission path, and the corresponding test was updated.
Breaking0.9.1
Release 0.9.1 primarily contains a fix to the error message produced when a positional argument with an enum type receives an invalid value. The change updates the wording and the argument name used in the message.
0.9.0
Version 0.9.0 introduces event-based theming and help rendering, including short command descriptions, and a new `cliName` config value intended for theme output. It also renames command `metaInfo` to `metadata` and removes the previous type restriction, alongside multiple parsing and error-message fixes and expanded test coverage.
BreakingFeatures0.8.2
Release 0.8.2 changes the `command()` implementation to avoid mutating the provided command object and tweaks when option validation runs. The diff shows `command()` now clones the input command before assigning processed options and names.
0.8.1
Release 0.8.1 focuses on improving how command and subcommand cloning works, and removing some unnecessary logic. The code change mainly replaces the project’s internal deep-clone utility with the external npm package "clone" and alters when parent relationships and cloning happen in the command-building flow.
Breaking0.8.0
Release 0.8.0 renames the CLI entrypoint from `runCli()` to `run()`, adds support for parent linkage on subcommands, and introduces a new helper for converting a command collection into structured command data. It also claims a fix for clone-related crashes involving subcommands.
BreakingFeatures