A terminal UI for managing shell snippets. Save, search, and execute your frequently used commands.
- Browse and search snippets with fuzzy filtering
- Copy commands to clipboard or execute directly
- Usage tracking (sorts by most used)
- Hand-editable YAML storage
- Minimal, keyboard-driven interface
go install github.com/user/stash@latestOr build from source:
git clone https://github.com/user/stash
cd stash
go build -o stash .Launch the TUI:
stashAdd a snippet from the command line:
stash add "docker exec -it container bash"This opens the TUI with the command pre-filled so you can add a description and tags.
| Key | Action |
|---|---|
j / k / ↑ / ↓ |
Navigate list |
Enter |
Copy snippet to clipboard |
x |
Execute snippet |
a |
Add new snippet |
e |
Edit selected snippet |
d |
Delete (with confirmation) |
/ |
Search / filter |
Esc |
Clear filter / cancel |
? |
Toggle help |
q |
Quit |
Snippets are stored in ~/.config/stash/snippets.yaml. The file is human-readable and can be edited directly:
snippets:
- command: "docker ps -a"
description: "List all containers"
tags:
- dockerOnly command is required. All other fields are optional and will be auto-populated:
snippets:
- command: "git status"
- command: "docker ps"
description: "List running containers"See snippets.example.yaml for more examples.
Run all tests:
go test ./... -vRun tests with race detection:
go test ./... -v -raceRun tests for a specific package:
go test ./internal/storage/... -v| Package | What's tested |
|---|---|
internal/model |
Snippet creation, defaults, usage tracking, YAML serialization |
internal/storage |
Load/save, add/update/delete, bounds checks, round-trips, edge cases |
internal/config |
XDG path resolution, directory creation, idempotency |
internal/tui |
Mode transitions, list filtering & navigation, form input & submission, detail/confirm/help rendering, key bindings, styles |
cmd |
Shell execution, CLI argument validation, subcommand registration |
A GitHub Actions workflow runs on every push and pull request:
- Test — builds the project and runs all tests with
-race - Lint — checks
gofmtformatting andgo vet
- Bubble Tea - TUI framework
- Bubbles - TUI components
- Lip Gloss - Styling
- Cobra - CLI framework
