Replies: 1 comment
-
|
implemented by #50 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal: A Redesigned, Streamlined CLI for
b1. Introduction
This proposal outlines a plan to refactor and streamline the command-line interface (CLI) for
b. The current flag-driven system is functional but can be confusing for new users and is less scalable for future development.The goal is to evolve the CLI to a more intuitive, powerful, and predictable interface by adopting modern CLI design patterns. This includes introducing verb-based subcommands, making the tool context-aware, and providing short aliases for power users.
2. Core Principles
The new design is guided by three core principles:
b install). This makes user intent explicit and the tool easier to learn.b.yamlfile in the current directory tree. This removes the need for the--allflag and simplifies the most common use cases.b iforb install) will be available for frequent, interactive use.3. Proposed Command Structure
Main Commands & Aliases
installib.yaml.--addflag adds it to b.yaml.add@, e.g.[email protected]orjq@latest(default).--fixadds the given version to b.yaml.-ior--installwill directly install it.updateub.yaml.listls,lb.yamland their installation status.searchsinit.bin/b.yamlconfiguration file in the current directory (ENV Variables have precedence).versionv--localit will only show the local version, no lookup for new version.-qor--quitewill lookup versions and fail (exit code) if not all, or the specified binary, is not up to date. Note, if a version is pinned (fixed), it will not fail if a newer version is available.Global Flags
--config <path>,-c <path>b.yamldiscovery.--force--output <format>json) for commands likelistandsearch.--help,-h--quite,-q4. Comparison: Old vs. New
b -iu <binary>b install <binary>b i <binary>b -fi <binary>b install --force <binary>b i --force <binary>b -a --installb installb ib -aiub update[binary]b ub --allb listb lsb --listb searchb s5. Example User Workflow
Here’s how a user might interact with the new CLI:
Initialise a project:
Add tools to the project's config file and install everything:
User manually adds
jqandshfmttob.yaml.b i # -> Reads b.yaml and installs jq and shfmtList the project's managed binaries:
b ls # -> Shows that jq and shfmt are installed for this projectDiscover a new tool and install it without adding to
b.yaml:Update all project dependencies:
b u # -> Checks for new versions of jq and shfmt6. Recommendation for Documentation and Scripts
To ensure clarity for all users, a clear guideline should be established:
Official documentation and shared scripts should always use the full command names (e.g.,
b install).Aliases are an enhancement intended for personal, interactive use at the command line. This practice ensures that scripts and tutorials remain readable and easy to understand for everyone, regardless of their familiarity with the aliases.
Beta Was this translation helpful? Give feedback.
All reactions