Skip to content

Command reference

Every sm subcommand, grouped by intent. For the canonical workflow see Your first stack; for multi-step recipes see Recipes.

CommandWhat it does
sm checkout (alias: co)Switch HEAD to a tracked branch (or pick interactively).
sm up / down / top / bottomWalk the stack relative to current.

Mutation

CommandWhat it does
sm createBranch off HEAD, record parent. -m / -a to commit at the same time.
sm modifyAmend (default) or commit, then restack descendants.
sm foldSquash branch into parent.
sm splitDecompose a branch into a chain of smaller ones.
sm moveReparent a branch (and its subtree) onto a new base.

Restack engine

CommandWhat it does
sm restack (alias: rs)Rebase chain onto current parent tips. Pauses on conflict.
sm continue / sm abortResume or bail out of a paused restack/sync.
sm syncPull trunk, delete merged branches, restack survivors.

PR ops

CommandWhat it does
sm submitPush + open/update PRs via gh.
sm landMerge the bottom-most PR and run sm sync to clean up.
sm getFetch a colleague's stack locally and reproduce its parent edges.

Inspection

CommandWhat it does
sm log (alias: ls)Print the stack tree with PR + restack status.
sm showDetailed branch view: parent, children, ahead/behind, PR, commits.
sm parentShow or change the parent of a branch.
sm childrenList the direct children of a branch.
sm doctor (alias: status)Sanity-check stac-man metadata vs. git state.

Recovery

CommandWhat it does
sm undoRoll back the most recent stac-man operation.
sm absorbAuto-route uncommitted hunks into the right ancestor commits.

Setup & meta

CommandWhat it does
sm trackAdopt an existing branch into the stack graph.
sm untrackRemove a branch from the stack graph.
sm completionGenerate shell completion scripts.
sm configInspect or edit the optional user config (~/.config/stac-man/config.yaml).
sm versionPrint version, build, and platform info.
sm updateInstall the latest released version.

Global flags

Every subcommand inherits these from the root:

FlagWhat it does
--no-colorDisable all color output (also respects the NO_COLOR env var).
-v, --verboseVerbose output (prints underlying git/gh commands).

Released under a license that is currently TBD.