# Tools
Some simple tools for my own productivity.
---
## pass - Password Store Replacement
Windows-compatible `pass` (password-store) replacement in Go. Manages GPG-encrypted password files in `~/.password-store/` with git integration.
### Features
- GPG-encrypted password storage
- Git integration for version control
- **New: Git status and operations** (`pass git`, `pass git push`, `pass git update`)
- Interactive fuzzy search with TUI (Bubble Tea)
- Git status displayed in TUI
- Cross-platform (Windows, Linux, macOS)
- Copy to clipboard support (xclip/xsel on X11, wl-copy on Wayland, pbcopy on macOS, clip.exe on Windows), with tmux paste-buffer integration when running inside tmux
- Edit existing passwords with your favorite editor
### Build
```bash
cd pass && ./build.sh # native build → ../shell/pass[.exe]
cd pass && ./build.sh build # same
cd pass && ./build.sh build-all # cross-compile linux amd64/arm64 + windows arm64
```
### Install
```bash
# Windows: copy pass.exe to PATH
copy shell\pass.exe C:\Windows\System32\
# Linux/macOS:
sudo cp shell/pass /usr/local/bin/
```
### Test
```bash
# Run tests
cd pass
go test ./...
# Manual test
./pass.exe ls
./pass.exe find gmail
./pass.exe insert test/password
```
### Usage
```bash
# Password management
pass ls # List passwords (files only)
pass find gmail # Search
pass email/gmail.com/user # Show password
pass -c email/... # Copy to clipboard
pass insert email/... # Add new password (fails if exists)
pass edit email/... # Edit existing password in $EDITOR
pass edit # Interactive fuzzy search to edit
pass # Interactive fuzzy search TUI
pass -c # Interactive fuzzy search with clipboard copy
pass rm # Interactive fuzzy search to remove
# Git integration (new!)
pass git # Show git status of password store
pass git -v # Show detailed git status
pass git push # Push changes to remote
pass git update # Pull changes from remote
pass git init # Initialize git repository
pass git status # Alias for 'pass git'
```
### TUI
When running `pass`, `pass -c`, `pass rm`, or `pass edit` without arguments, an interactive TUI is displayed:
- Use up/down arrows to navigate the list
- Use left/right arrows to move cursor in search input
- Use Tab to cycle through results
- Type to filter passwords using fuzzy matching (subsequence matching)
- Press Enter to select (show, copy, remove, or edit based on command)
- Press Esc, Ctrl+C, Ctrl+D, or Ctrl+Q to exit
**Git operations in TUI:**
- Git status is displayed in the header with colors (e.g., `Git: main <` in yellow)
- `Ctrl+P` - Push changes to remote
- `Ctrl+U` - Pull changes from remote
- `Ctrl+R` - Refresh git status
**Status symbols and colors:**
- `*` = uncommitted changes (yellow)
- `!` = merge conflicts (red)
- `>` = ahead of remote (yellow)
- `<` = behind remote (yellow)
- `<>` = diverged - both ahead and behind (yellow)
- `=` = up to date (green)
### Configuration
- `PASSWORD_STORE_DIR`: Custom password store location (default: `~/.password-store`)
- `EDITOR`: Editor to use for editing passwords (default: `notepad` on Windows, `vi` on Unix)
- Requires GPG to be installed and configured
### Prerequisites
- Go 1.20+
- GnuPG (GPG4Win on Windows)
- Git (optional, for version control)
- For `pass -c` clipboard support on Linux: `xclip` or `xsel` (X11), or
`wl-clipboard` (Wayland). Not required when running inside tmux, which
uses its own paste buffer as a fallback.
---
## gitprompt - Git Prompt Utility
Git prompt utility for shell integration.
### Build
```bash
cd gitprompt && ./build.sh # native build → ../shell/gitprompt[.exe]
cd gitprompt && ./build.sh build # same
cd gitprompt && ./build.sh build-all # cross-compile linux amd64/arm64 + windows arm64
```
### Install
```bash
# Windows: copy gitprompt.exe to PATH
copy shell\gitprompt.exe C:\Windows\System32\
# Linux/macOS:
sudo cp shell/gitprompt /usr/local/bin/
```
### Prerequisites
- Go 1.25+ (go-git v5.19 dependency)
---
## sleep - Windows sleep(1)
A minimal GNU-`sleep`-alike for Windows, which ships no `sleep` of its own.
Written in C, ~13 KB, no runtime dependencies.
Motivation: `timeout /t N` is integer-only and fails with "Input redirection
is not supported" whenever stdin is not a console — for example when called
from the [goal](https://codeberg.org/anaseto/goal) interpreter's `run`
builtin. See `specs/009-sleep-command/spec.md`.
### Build
```bash
cd sleep && ./build.sh # native build → ../shell/sleep[.exe]
cd sleep && ./build.sh clean
```
### Install
```bash
# Windows: copy sleep.exe to a directory on %PATH%
copy shell\sleep.exe C:\Dev\bins\
# Linux/macOS: not needed, coreutils already provides sleep
```
### Usage
```bash
sleep 2 # 2 seconds
sleep 0.25 # fractional seconds
sleep 1.5s # explicit suffix
sleep 2m # minutes; also h (hours), d (days)
sleep 1m 30 # arguments are summed → 90 seconds
```
From goal:
```k
run"sleep""0.25"
```
### Prerequisites
- A C compiler (`gcc`, `clang`); override with `CC=...`
---
## evergarden - Vim Colorscheme
A classic-Vim port of the [evergarden](https://evergarden.moe) palette. Single
file, no dependencies, Vim 8.0+ (no Neovim, by design).
### Install
```bash
cd evergarden && ./install.sh # → ~/.vim/colors on every platform
./install.sh status
./install.sh uninstall
```
### Usage
```vim
set runtimepath^=~/.vim " needed when ~/.vim is not already on runtimepath
set termguicolors
let g:evergarden_keyword = 'skye' " keyword hue; any palette name
colorscheme evergarden
```
### Preview without installing
```bash
cd evergarden && ./test/run.sh # hitest + C/Vim/Markdown samples + a live diff
./test/run.sh 256 # 256-colour cterm fallback
```
In the preview, `:Kw <hue>` retints keywords live.
---
## Building All Tools
Use the wrapper script to build all tools at once:
```bash
./shell/make.sh # build gitprompt, pass and sleep
./shell/make.sh build # same
./shell/make.sh build-all # cross-compile (sleep is native-only)
./shell/make.sh clean # clean all builds
```