What Optional Standard Library Functions Does Bashly Provide?

Updated

Bashly's optional standard library adds framework-style helpers to the bash script it generates, so you don't have to write common utilities yourself. According to the Bashly documentation, these optional functions include color output, config file management (INI format), YAML parsing, Bash completions, "and more." They are separate from Bashly's core job of parsing arguments, validating input, and generating help screens — you opt into them when your tool needs that extra behavior.

The documented optional functions

Function What it gives you When it's worth adding
Color output Helpers for printing colored terminal output Your tool prints status, warnings, or errors that benefit from visual distinction
Config file management (INI format) Framework-style handling of INI config files Your tool needs persistent settings stored in a simple, human-editable file
YAML parsing YAML parsing inside your generated script Your tool reads or writes structured YAML data
Bash completions Completion support for your command line tool You want tab-completion for commands, subcommands, and flags
"and more" Additional helpers listed on Bashly's site Check the site's feature list for the current set

The documentation describes these as "additional (optional) framework-style, standard library functions," which means they are not part of the minimal generated script — they're available when your tool's requirements call for them.

How they fit into the Bashly workflow

Bashly works from a YAML configuration file that describes your commands, subcommands, arguments, and flags. bashly init creates a sample configuration, and bashly generate produces a single standalone bash script that parses and validates user input, shows help, and runs your code for each command. Your per-command code lives in separate files and is merged into the final script.

The optional standard library functions sit on top of that generated script. They're the kind of utility code you'd otherwise write by hand in every tool — color codes, INI parsing, YAML handling, completion registration — packaged so the generated script stays consistent and shellcheck- and shfmt-compliant.

Deciding whether to use them

  • Use color output if your tool's output is read by humans at a terminal and you want consistent formatting without maintaining escape-code helpers.
  • Use INI config management if your settings are simple key-value pairs and you want users to edit a plain file. If your configuration is more complex or nested, the YAML parsing function may fit better.
  • Use YAML parsing when your tool consumes or produces YAML — for example, reading a manifest or writing structured results.
  • Add Bash completions once your command and flag surface is stable enough that users would benefit from tab-completion.

Because the documentation lists these as optional and points to "and more" on the site, treat the table above as the documented starting set rather than a fixed inventory. Check Bashly's feature list for the current functions before committing to a design that depends on a specific helper.