Zut is a fast, simple, and effective CLI tool for storing, retrieving, and executing frequently used or complex shell commands. Never forget that complicated command again!
- Save Commands: Store commands with unique aliases and descriptive tags
- Quick Retrieval: Instantly find and execute saved commands
- Smart Search: Search commands by alias, tag, or command content
- Easy Management: Edit and delete commands with simple commands
- Fast & Lightweight: Built in Go for maximum performance
- Persistent Storage: All commands saved in a simple JSON file
git clone <your-repo-url>
cd zut
go build -o zut .
sudo mv zut /usr/local/bin/ # Optional: Install globallyDownload the latest release from the releases page and add it to your PATH.
zut add -a "git-push-f" -c "git push --force-with-lease origin main" -t "Safe force push"zut listzut find git
# or
zut list -s dockerzut run git-push-f
# Output: git push --force-with-lease origin mainzut edit git-push-f -c "git push --force" -t "Updated description"zut delete git-push-fzut add -a <alias> -c <command> -t <tag>Flags:
-a, --alias: Unique alias for the command (required)-c, --command: The command to save (required)-t, --tag: Optional tag/description
Example:
zut add -a "docker-clean" -c "docker system prune -af" -t "Clean up Docker"zut list [flags]Flags:
-s, --search: Filter commands by search term
Example:
zut list
zut list -s "git"zut find <search-term>Example:
zut find docker
zut find "force push"zut run <alias>Example:
zut run git-push-fzut edit <alias> [flags]Flags:
-c, --command: New command string-t, --tag: New tag/description
Example:
zut edit git-push-f -c "git push --force"
zut edit git-push-f -t "New description"
zut edit git-push-f -c "new command" -t "new tag"zut delete <alias>Example:
zut delete git-push-fTo execute commands directly in your shell, add this function to your shell configuration file:
zut-exec() {
eval "$(zut run "$1")"
}zut-exec() {
eval "$(zut run "$1")"
}After adding the function and reloading your shell (source ~/.zshrc), you can execute commands directly:
zut-exec git-push-f
# This will execute: git push --force-with-lease origin mainCommands are stored in a JSON file at:
- Linux/macOS:
~/.config/zut/commands.json - Windows:
%APPDATA%/zut/commands.json
You can customize the storage location by setting the ZUT_CONFIG_DIR environment variable:
export ZUT_CONFIG_DIR="/path/to/custom/config"zut add -a "git-undo" -c "git reset --soft HEAD~1" -t "Undo last commit"
zut add -a "git-clean-branches" -c "git branch | grep -v 'main' | xargs git branch -D" -t "Delete all local branches except main"zut add -a "docker-stop-all" -c "docker stop \$(docker ps -aq)" -t "Stop all containers"
zut add -a "docker-rm-all" -c "docker rm \$(docker ps -aq)" -t "Remove all containers"zut add -a "disk-usage" -c "du -sh * | sort -h" -t "Show disk usage sorted"
zut add -a "port-check" -c "netstat -tuln | grep" -t "Check which ports are listening"zut add -a "npm-fresh" -c "rm -rf node_modules package-lock.json && npm install" -t "Clean npm install"
zut add -a "go-test-v" -c "go test -v ./..." -t "Run all Go tests verbosely"zut/
βββ cmd/ # CLI commands
β βββ root.go # Root command
β βββ add.go # Add command
β βββ list.go # List command
β βββ delete.go # Delete command
β βββ edit.go # Edit command
β βββ run.go # Run command
β βββ find.go # Find/search command
βββ internal/core/ # Core business logic
β βββ core.go # Command management
βββ pkg/storage/ # Data persistence
β βββ storage.go # File I/O operations
βββ main.go # Entry point
βββ go.mod # Go module file
βββ README.md # This file
Run the test suite:
go test ./...Run tests with coverage:
go test -cover ./...Contributions are welcome! Please feel free to submit a Pull Request.
Built with:
- Cobra - CLI framework
- Go standard library