CollabOps

co alias — command aliases

Bind a short name to a co subcommand and its flags

An alias binds a short name to a co subcommand with its flags. Aliases live in the aliases map inside ~/.config/collabops/config.json and are expanded before cobra parses argv, so anything you type after the alias is appended to the expansion.

co alias set bugs "issue list --label bug --state open"
co bugs                  # → co issue list --label bug --state open
co bugs -l 100           # → co issue list --label bug --state open -l 100

co alias set <name> <expansion>

Creates or updates an alias. Quote the expansion so it arrives as a single argument.

co alias set my "issue list --mine"
co alias set bugs "issue list --label bug --state open"

co alias list

Prints the defined aliases. With none defined it prints (no aliases defined).

co alias list

┌────────┬────────────────────────────────┐
 ALIAS EXPANSION
├────────┼────────────────────────────────┤
 bugs issue list --label bug
 my issue list --mine
└────────┴────────────────────────────────┘

co alias edit <name>

Opens $EDITOR on the current expansion. Saving an empty buffer deletes the alias.

co alias edit bugs

co alias rename <old> <new>

Renames an alias and keeps its expansion. Add -f to overwrite an existing target name.

co alias rename bugs bug
co alias rename bugs bug -f   # overwrite if the name is taken

co alias delete <name>

Removes an alias. Also available as remove / rm.

co alias delete bugs

co alias import <file|->

Reads a JSON object of {"name": "expansion", …} and merges it into the alias map; - reads stdin. Existing aliases keep their value unless --clobber is set.

echo '{"bugs": "issue list --label bug"}' | co alias import -
co alias import ~/.config/collabops/aliases.json --clobber
FlagDescription
--clobberOverwrite existing aliases on a name collision

Real command names (issue, cr, config …) are reserved and cannot be shadowed — import skips them silently and warns on stderr.

Table of Contents