Custom Bash Commands (CBC) is a Bash-based toolkit for Linux shells. It
provides a small set of helper commands under cbc, a few standalone
commands for opening project resources, and a curated alias catalog that
is sourced at shell startup.
- Overview
- Key Components
- Prerequisites
- Installation
- Post-Installation Behavior
- Daily Usage
- Documentation Site
- Documentation Style
- Contribution Workflow
- Troubleshooting
The core script can use Charmbracelet gum
for styled prompts and messages. The CBC_USE_GUM config key controls
whether gum is auto-detected, required, or disabled. When sourced in an
interactive shell, CBC loads config from ~/.config/cbc/cbc.config,
sources installed module entrypoints from ~/.config/cbc/modules, and
prints a version banner once per session (unless disabled). Manifest
packages are installed or repaired only when users run cbc pkg load.
It sources ~/.cbc_aliases.sh if present and warns when missing, then
optionally sources ~/.bash_aliases when enabled in config.
| Path | Purpose |
|---|---|
custom_bash_commands.sh |
Main entry point. Defines cbc subcommands, styled output helpers, update checks, and module management. |
cbc_aliases.sh |
Alias catalog loaded by the main script. |
install_cbc.sh |
Installer that validates the repository path, copies scripts into ~, appends a sourcing line to .bashrc when missing, and creates common directories under ~/Documents. |
docs/ |
Reference documentation for dependencies, SOPs, and commands. |
zensical.toml |
Zensical configuration for the documentation site. |
requirements-docs.txt |
Pinned Python package list for documentation builds. |
CHANGELOG.md & cbc_logo_00001.png |
Release history file and branding asset used in documentation. |
CBC expects the tools listed in docs/dependencies.md. Highlights include:
gumfor styled UI output (strongly recommended, optional).gitandcurlfor update checks and module management.fzf,eza, andbat/batcatfor aliases and formatted output.nvimfor editor shortcuts.wl-copyfor clipboard options inreadme,wiki,changes, andreleases.imv-x11for theimvalias andmanforfman.- Python 3.10 or newer for Zensical documentation builds.
-
Ensure the canonical repository location exists:
mkdir -p ~/Documents/github_repositories -
Clone the project into the expected folder:
git clone https://github.com/iop098321qwe/custom_bash_commands \ ~/Documents/github_repositories/custom_bash_commands -
Run the installer from inside the repository:
cd ~/Documents/github_repositories/custom_bash_commands ./install_cbc.sh
The script verifies the repository path, copies the main script and alias catalog into the home directory, appends the sourcing line to
.bashrcwhen missing, and creates common directories under~/Documents/Temporaryand~/Documents/github_repositories.
If you install manually, copy custom_bash_commands.sh and
cbc_aliases.sh to ~ (prefixed with dots), mark them executable, and
append the following to the end of ~/.bashrc:
source ~/.custom_bash_commands.shRestart the shell (or run refresh) when you finish so the new commands
load.
When the terminal sources CBC:
- Config is loaded from
~/.config/cbc/cbc.configwhen present. - A version banner prints once per interactive session when
CBC_SHOW_BANNER=true. - Installed module entrypoints in
~/.config/cbc/modulesare sourced when present. - Packages listed in
~/.config/cbc/packages.tomlare not aligned during startup. Runcbc pkg loadto install or repair manifest modules. ~/.cbc_aliases.shis sourced if it exists; missing files trigger a warning. WhenCBC_SOURCE_BASH_ALIASES=true(default),~/.bash_aliasesis sourced afterward.CBC_USE_GUM=auto(default) uses gum when installed and plain text otherwise.CBC_USE_GUM=truerequires gum and blocks command execution when gum is missing.CBC_USE_GUM=falsealways uses plain text output.- When gum is active, styled output follows Omarchy theme colors on Omarchy systems and falls back to the built-in Catppuccin-Mocha palette elsewhere.
- CBC does not check for updates automatically; use
cbc update check.
display_version(aliasdv) prints the version banner.cbc doctorruns diagnostics for dependencies, config, modules, and GitHub update access.cbc doctor startupprofiles CBC startup timing and prints hints for reducing terminal initialization delay.readme,wiki,changes,releases, anddotfilesopen project resources in the default browser. Use-cto copy URLs where supported.cbc list [-v]lists available functions and aliases; it usesbatorbatcatfor formatted output when available.
cbc update checkqueries the latest GitHub release.cbc update(aliasucbc) pulls the latest scripts via sparse checkout and reloads CBC.cbc testreloads CBC from the current custom_bash_commands repository root for development. It fails when run from another directory.
cbc config [-f]writes~/.config/cbc/cbc.configwith defaults.cbc config edit [--reset]opens the config in your editor, writing defaults when missing or when--resetis used.cbc config -e [--reset]is shorthand for the edit workflow.- Config keys include
CBC_SHOW_BANNER,CBC_BANNER_MODE,CBC_SOURCE_BASH_ALIASES,CBC_LIST_SHOW_DESCRIPTIONS, andCBC_USE_GUM.
cbc pkgstores module metadata in~/.config/cbc/packages.toml.cbc pkg install <creator/repo|git-url|path>records a module source.cbc pkg loadinstalls missing manifest modules, refreshes metadata, and sources entrypoints.cbc pkg updatefast-forwards installed module repos, refreshes the manifest, and shows the previous and new installed versions in a table.cbc pkg uninstall <creator/repo|module-name>removes the manifest entry and local module folder.cbc pkg listshows installed module versions, status, and last update dates in a table.- Subcommands support
-hfor help (for example,cbc pkg install -h).
- Editor and shell helpers:
editbash,refresh,fman,please,myip,imv. ezawrappers for directory listings such asla,ll, andlt.- Python and editor shortcuts:
py,python,vim,v. - Single-letter aliases are limited to
c,s,v,x, andz. - On Ubuntu-like systems,
batis aliased tobatcat. - Use
cbc list -vto see the full alias catalog.
The documentation site uses Zensical with source files in docs/ and output in
site/. Install the docs dependencies in a virtual environment before serving
or building the site locally:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-docs.txtPreview the site locally:
zensical serveBuild the static site:
zensical build --cleanGitHub Pages deployment is handled by .github/workflows/docs.yml when changes
are pushed to main or when the workflow is run manually.
Most Markdown in this project is wrapped at 80 characters. The following cases may exceed that limit when readability would otherwise suffer:
- Tables that depend on single-line rows.
- URLs that become ambiguous or unusable when broken across lines.
- Code fences where formatting depends on preserving longer lines.
- Follow
docs/operations/standard_operating_procedures.mdwhen adding functions or aliases. - Keep
cbc listarrays in sync (function_names,function_descs,alias_names,alias_descs). - Update documentation whenever behavior or dependencies change.
- Run
zensical build --cleanafter changing documentation site files.
- Provisioning fails with a path error:
install_cbc.shverifies the repository lives at~/Documents/github_repositories/custom_bash_commandsand aborts if it does not. Move the clone into the expected location and rerun the script. - Dependencies missing or failing silently: Compare your environment
against
docs/dependencies.mdand confirm helpers such asgum,fzf,wl-copy,eza,nvim, andimv-x11are installed. - Gum required but missing: If
CBC_USE_GUM=true, installgumor setCBC_USE_GUM=autoorCBC_USE_GUM=falsein~/.config/cbc/cbc.config. - Manifest modules missing after startup: run
cbc pkg loadto install packages listed in~/.config/cbc/packages.tomland source their entrypoints in the current shell. - Terminal startup feels slow: run
cbc doctor startupto measure CBC source time, module loading, banner rendering, and related settings. - Zensical command missing: activate
.venvor run.venv/bin/zensical build --cleanafter installingrequirements-docs.txt.