sm checkout
Switch HEAD to a tracked branch. Without an argument and on a TTY, opens an interactive picker.
Alias: sm co.
Synopsis
sm checkout [branch]Examples
Direct switch:
bash
sm checkout feat/auth-handlersInteractive picker (TTY only) — arrow keys, Enter to choose, Esc to cancel:
bash
sm checkoutPipe-friendly fallback — when stdin or stdout is not a TTY, the same tree is printed instead of launching the picker:
bash
sm checkout | grep featWhat it does
- With an argument: validates the branch is tracked (or is trunk) and runs
git switch. - Without an argument: builds the same tree
sm logwould render and either:- Launches a Bubble Tea picker on a TTY, or
- Prints the tree statically when stdin/stdout isn't a TTY.
Tab completion
After running sm completion <shell> (see sm completion), sm checkout <TAB> completes against tracked branches plus trunk.
See also
sm up/down/top/bottom— directional navigation that reads naturally for stack walks.sm log— see the tree without switching.
