Skip to content

Contributing

Brandon Shoop edited this page Jun 2, 2026 · 1 revision

Contributing

Setup

git clone https://github.com/1shooperman/cli-tools.git
cd cli-tools

No build step required — all scripts are plain bash.

Running tests

make test

Requires bats-core:

brew install bats-core

Linting

make lint

Requires shellcheck:

brew install shellcheck

Both lint and test must pass before merging.

Adding a new command

  1. Create bin/<name> — source _bootstrap then your lib file:
#!/bin/bash
# shellcheck source=bin/_bootstrap
source "${BASH_SOURCE[0]%/*}/_bootstrap"
# shellcheck source=lib/<name>cmds.sh
source "$CLI_TOOL_ROOT/lib/<name>cmds.sh"

my_function "$@"
  1. Create lib/<name>cmds.sh with the implementation. Source common.sh if you need gecho or show_progress:
#!/usr/bin/env bash
# shellcheck source=lib/common.sh
source "$CLI_TOOL_ROOT/lib/common.sh"

my_function() { ... }
  1. Add a tests/test_<name>.bats file covering the happy path and key error cases.

  2. Add a wiki page at wiki/cli-tools.wiki/<name>.md and link it from Home.

  3. Update the Structure section in the README.

Adding a shared utility

Add it to lib/common.sh and cover it in tests/test_common.bats.

Releasing

Releases are triggered manually via the Release (Manual) GitHub Actions workflow. Choose a bump type (patch, minor, or major) and the workflow tags, creates a GitHub release, and bumps the Homebrew tap formula automatically.

Clone this wiki locally