Skip to content

CLI Reference

Every command Ponos exposes, its flags, defaults and behaviour. The developer helpers are Python/Click commands surfaced through .zshrc aliases; the orchestrator and Git aliases round out the surface.

The orchestrator

sync_mac.sh

bash
./sync_mac.sh

Runs the full bootstrap sequence (see Architecture). No positional arguments. Behaviour is tuned by environment variables:

VariableEffect
PONOS_CONTAINERdocker-desktop or colima — skips the container prompt.
PONOS_BROWSERgoogle-chrome or brave-browser — skips the browser prompt.
GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_EDITOR, GIT_DEFAULT_BRANCH, GIT_BRANCH_PREFIXRequired by the Git step; missing any skips it.
CHEZMOI_SOURCE_DIROverrides where chezmoi apply reads from.

Exit codes: 1 on a non-macOS host or a missing Brewfile; otherwise 0 (with a warning line if brew bundle failed).

Git extensions — git_ext.py

Aliased in .zshrc as bclean, rfrom, rhooks. All accept --debug to re-raise the underlying error.

bclean

bash
bclean [BRANCH] [-b/--branches BRANCH]... [--debug]

Delete stale local branches. Switches to the default branch, then deletes every local branch that is not excluded and is not the current branch.

Argument / optionDefaultMeaning
BRANCH (positional)$GIT_DEFAULT_BRANCHThe default branch to switch to; also added to the exclusion set.
-b, --branches (repeatable)develop, main, masterBranches to exclude from deletion.

Reports the deleted branches, or logs that the repository is already clean.

rfrom

bash
rfrom [TARGET] [-b/--branch BRANCH] [--debug]

Rebase a branch onto the target. Pulls TARGET, switches back to the working branch, and runs git rebase TARGET. If the working branch equals the target, it only pulls.

Argument / optionDefaultMeaning
TARGET (positional)$GIT_DEFAULT_BRANCHThe branch to rebase onto.
-b, --branchcurrent branchThe branch to rebase (checked out first if given).

rhooks

bash
rhooks [-f/--force] [-r/--repository PATH] [-d/--directory PATH] [--debug]

Copy the template hooks into every repository under a directory tree. Finds every .git/hooks path under --directory and copies git/git-templates/hooks from --repository into each.

OptionDefaultMeaning
-f, --forceoffOverwrite existing hook directories (removes and re-copies). Without it, repos whose hooks already exist are skipped.
-r, --repository$GIT_PATH_CONFIGThe Ponos configuration repository (source of the hooks). Must exist.
-d, --directory$GIT_PATHThe directory tree to scan for repositories. Must exist.

--directory defaults to $GIT_PATH, which is not set by the tracked .zshrc; pass -d explicitly or export GIT_PATH to point at your repositories root.

System extensions — sys_ext.py

Aliased in .zshrc as uport, kport. Both accept -d/--debug.

uport

bash
uport PORT [-d/--debug]

Scan a TCP port for listeners with lsof -i :PORT -sTCP:LISTEN, print the raw lsof output, and report the listening PID(s) — or that the port is free.

kport

bash
kport PORT [-d/--debug]

Resolve the listeners as uport does, then send each PID a SIGTERM (kill -15). Reports when there is no process to kill.

Port validation note. Both commands pass PORT through a check_port guard whose bounds check (0 >= port and port <= 65535) only rejects 0 and negative values; out-of-range high ports are not rejected. lsof simply finds nothing for a non-listening port.

Git aliases

setup_git installs these global aliases (git <alias>). ${GIT_DEFAULT_BRANCH} and ${GIT_BRANCH_PREFIX} are expanded at configuration time.

AliasExpands toPurpose
defc ${GIT_DEFAULT_BRANCH}Checkout the default branch.
ststatus -sShort status.
ctcommitCommit.
brbranchList/manage branches.
cbcheckout -bCreate and switch to a branch.
ccheckoutSwitch branches.
cmbcheckout -b ${GIT_BRANCH_PREFIX}/$1New prefixed branch (e.g. git cmb loginjdoe/login).
cmcheckout ${GIT_BRANCH_PREFIX}/$1Switch to a prefixed branch.
dfdiffDiff.
delbranch -DForce-delete a branch.
rbreset --hardHard reset.
histlog -pHistory with patches.
treelog --graph --pretty=…Decorated commit graph.

Shell aliases & shortcuts (.zshrc)

AliasCommand
sync_macRun the orchestrator.
llls -l
.., ...cd .., cd ../..
g, kgit, kubectl
sshkssh-add -L
perso, pro, assocd into the dev directories and ll.
uport, kport, bclean, rfrom, rhooksThe Python CLI extensions.

Word-wise navigation is bound for Option/Alt + Arrow (backward-word / forward-word) across the common terminal escape sequences.