rec
rec records the commands you run in a shell session, then replays them with safety controls or exports them to scripts, CI configs and docs. The deploy you just did by hand is already a runbook, as long as you were recording.
I made it after writing the same "how to deploy" doc for the third time, each copy slightly out of date. Shell hooks capture every command with its working directory, exit code and timing, and nothing runs when you're not recording. Bash, Zsh and Fish are supported natively. Storage is crash-safe NDJSON with an fsync after every command, sessions from a crashed process get recovered on the next start, and every session has a name, generated for you if you don't give one.
Install
cargo install rec-cli
# With the interactive TUI (optional)
cargo install rec-cli --features tuiPre-built binaries for Linux (x86_64, aarch64) and macOS (x86_64, Apple Silicon) are on the releases page.
A session, start to finish
# 1. Set up shell hooks (add to your .bashrc, .zshrc, or config.fish)
eval "$(rec init bash)" # or: zsh, fish
# 2. Record a session
rec start deploy-server
echo "deploying..."
git pull origin main
docker compose up -d
rec stop
# 3. Replay it
rec replay deploy-server # interactive replay
rec replay deploy-server --dry-run # preview without executing
rec replay deploy-server --step # one command at a time
# 4. Export to a reusable format
rec export deploy-server -f bash -o deploy.sh
rec export deploy-server -f github-action -o .github/workflows/deploy.yml
rec export deploy-server -f dockerfile -o DockerfileThe dry run and step mode are the safety controls. You see what would run before it runs, one command at a time if you like. It's written in Rust, MSRV 1.85, under the MIT licence. It's in maintenance mode now and not under active development, because it does what I needed.