A tiny dispatcher for your personal scripts. Drop any standalone executable into your scripts directory and run it as a subcommand.
love greet formal --loud Ada # runs scripts/greet/formal --loud Ada
love greet # lists commands under scripts/greet
love # lists top-level commandsshotor-cli looks up a scripts directory (in order):
$SHOTOR_SCRIPTS_DIRif set${XDG_DATA_HOME:-$HOME/.local/share}/shotor-cli/scripts- a
scriptsdirectory next to the executable
Then it walks your arguments to find the deepest matching executable and runs it, forwarding the rest of the arguments.
Nested directories become nested subcommands. Because commands live under a single named prefix, they never collide with other tools on your PATH.
Any path segment starting with _ is private and hidden.
Shell completions are installed automatically for Oh My Zsh, Zsh and Bash.
Grab the prebuilt standalone script from the latest release, drop it somewhere on your PATH under any name you like, and make it executable:
curl -fsSL -o "$HOME/.local/bin/love" https://github.com/shotor/shotor-cli/releases/latest/download/shotor-cli
chmod +x "$HOME/.local/bin/love"Then install shell completions:
love --install-completionsClone the repo and run the installer with the name you want:
git clone https://github.com/shotor/shotor-cli
cd shotor-cli
./install.sh love --install-dir "$HOME/.local/bin"This bundles a standalone executable into ${XDG_DATA_HOME:-$HOME/.local/share}/shotor-cli/ and symlinks the chosen name onto your PATH. It also installs shell completions.
Options:
<name> Name of the PATH command (required)
--install-dir <path> Directory on PATH for the symlink (default: ~/.local/bin)
--skip-completions Do not install shell completionsEither way, add your scripts to ${XDG_DATA_HOME:-$HOME/.local/share}/shotor-cli/scripts.
Each script is a normal executable. Nest directories for subcommands:
scripts/
βββ backup # love backup
βββ qemu/
βββ list # love qemu list
βββ create # love qemu create debian-13
βββ snapshot/ # nest as deep as you like
βββ restore # love qemu snapshot restore debian-13Anything after the matched command is forwarded to your script unchanged, so read arguments as usual ($1, $@, flags, and so on).
See examples/scripts for working samples.
Add special comments near the top of a script to drive shell completions and help text. They are optional, but recommended:
#!/usr/bin/env bash
# @description Create a new QEMU virtual machine.
# @usage love qemu create <name>
# @option --disk <size> Disk size, e.g. 20G
# @option --ram <mb> Memory in megabytes
set -euo pipefail
# ...@descriptionβ one-line summary shown when completing command names.@usageβ the invocation form.@optionβ one per flag; text before two-or-more spaces is the flag(s) (comma-separated is fine, e.g.-l, --loud), the rest is its description. Flags are offered when completing that command.
Completions are dynamic: they scan the scripts directory and read this metadata at completion time. Adding a new script (or editing its metadata) just works β no regeneration needed. Re-run the installer only to install under a different name.
make build # bundle a standalone executable into build/shotor-cli
make test # unit tests (src/**/*.bats)
make test-watch # unit tests in watch mode
make e2e # end-to-end tests (e2e/)
make lint # shellcheck
make format # shfmt with automatic fixing
make format-check # shfmt without automatic fixing
make check # lint + test + e2e
make bootstrap # fetch bats, shellcheck and shfmt into .vendor/
make clean # remove .vendor/ and build/