stash is a small local store for pipeline output and ad hoc file snapshots.
It stores each entry as raw bytes under ~/.stash/data, stores attributes
under ~/.stash/attr, assigns it a stable ULID, and lets you retrieve entries
by recency or ID later. Everything is flat files and directories.
Without a subcommand, stash uses smart mode:
- in the middle of a pipeline, it behaves like
stash tee - otherwise, it behaves like
stash push
Tip
stash fits nicely in any workflow that would involve temporary files, or expensive output that needs to be processed in more than one ways.
Note
What is ~{@??? An ASCII art acorn.
Save output and reuse it:
curl -s https://api.example.com/data | stash
stash cat | jq .
stash cat | jq '.items[]'Keep the pipeline flowing while saving the same bytes:
curl -s https://api.example.com/data | stash tee | jq .
curl -s https://api.example.com/data | stash | jq .By default, stash, stash push, and stash tee do not print the generated
entry ID. Use --print=stdout, --print=stderr, or --print=null to control
where the ID is emitted.
Use with diff:
find . -type f | sort | stash -a label=before
# ... later ...
find . -type f | sort | stash -a label=after
diff -u <(stash cat @2) <(stash cat @1)File-oriented view:
stash ls
stash log
stash attr @1Build the Rust binary and copy it to a location in your PATH:
cargo build --release
cp target/release/stash /usr/local/bin/stashcargo install stash-cliAvailable under releases.
brew install vrypan/tap/stashFor auto-completion and other shell-specific features, check:
By default, stash stores data under ~/.stash.
You can override the stash root with STASH_DIR:
STASH_DIR=/tmp/job-a stash log
STASH_DIR=/tmp/job-a stash Makefile
STASH_DIR=/tmp/job-b stash logThis is useful when you want separate independent stashes for different jobs, projects, or CI runs.
- Usage guide: docs/usage.md
- Command/reference guide: docs/reference.md
- Example workflows: docs/examples.md
- Shell completion setup: docs/bash.md, docs/fish.md, docs/zsh.md
- Demos: demos/
- Helper scripts: scripts/