cliweave 0.3.1
cliweave: ^0.3.1 copied to clipboard
A typed CLI framework: command routing, argument scanning with kebab/camel aliasing, did-you-mean suggestions, rendered help, structured exit codes, shell-completion proposals, and a terminal logger, [...]
Changelog #
0.3.1 #
- Fix shell completion for partially typed long flags. Generated bash, zsh,
fish, and PowerShell scripts now pass the raw command line through
COMP_LINEinstead of forwarding flag-like completion words as application arguments, so prefixes such as--witare completed rather than rejected as unknown flags.
0.3.0 #
- Refresh development dependencies to their latest releases. There are no API or runtime behavior changes.
0.2.3 #
- Stop proposing hidden flags during shell completion. Help already filtered
them, but completion did not, so a flag hidden precisely because naming it
invites a bad habit — passing a secret on the command line, for instance —
was still offered at the prompt under both its long name and its alias.
Hidden remains undocumented rather than disabled: a flag the user has
already typed still completes. Set
CompletionConfiguration.includeHiddenFlagsto restore the old behaviour.
0.2.2 #
- Fix shell completion on Windows PowerShell 5.1, where pressing Tab at the
start of a new argument listed the current directory instead of the
application's own candidates. PowerShell 5.1 drops empty string arguments on
their way to a native command, so the trailing token that means "the cursor
starts a new word" never reached the application; the generated script now
passes the raw command line in
COMP_LINEinstead of as arguments. - Mark directory-style completion candidates as
ProviderContainerin the PowerShell script, so the cursor stays on the trailing slash rather than jumping past a space, matching what the bash and zsh scripts already did.
0.2.1 #
- Fix spinner flicker on Windows terminals. Each animation frame now overwrites the previous frame in place (cursor-home, redraw, clear-to-end) instead of erasing the whole line before redrawing, which left a momentary blank line that read as flicker. Terminal output is otherwise unchanged.
0.2.0 #
- Replace open
Map<String, Object?>andList<Object?>command handlers with context-genericFlagSetandPositionalSetdecoders. Handlers now receive closed records or user classes inferred from their declarations. - Add typed direct and per-command context loading, context-aware parsing and completion, and type-preserving lazy command loaders.
- Port the Stricli 1.3 integration model: ordered validation and lifecycle hooks, root/global application flags, collision checks, help/version factories, integration error reporting, and completion visibility.
- Make an explicit integrations list replace the defaults; omitting it installs help, help-all, and configured version integrations.
0.1.1 #
- Patch release to verify automated pub.flutter-io.cn publishing from GitHub Actions using OIDC. There are no API or runtime behavior changes.
0.1.0 #
- Initial extraction from the dotweave CLI, where this code has been in production use.
package:cliweave/cliweave.dart: command and route-map builders, flag and positional parameters, argument scanning with kebab/camel aliasing and did-you-mean suggestions, help rendering, structured exit codes, and completion proposals.CompletionScriptsgenerates bash, zsh, fish, and PowerShell completion scripts for any executable name, and normalizes the tokens a shell hands back throughresolveCompletionInputs.package:cliweave/terminal.dart: levelled logger, TTY-aware spinner, and a colour theme honouringNO_COLOR,FORCE_COLOR, andCI.- Environment access goes through an injectable
EnvLookuprather than a global, so consumers can supply their own view of the environment.
Initial public release. The API is expected to change before 1.0.