try - Temporary Project Directory Manager
A Go implementation of the try CLI tool for managing temporary project directories, with full feature parity to the original Ruby version.
Features
- Interactive TUI: Fuzzy search and navigate your try directories with a beautiful terminal interface
- Smart Search: Fuzzy matching with intelligent scoring based on recency and naming patterns
- Date Prefixes: Automatically prefix directories with
YYYY-MM-DD- for easy organization
- Directory Operations: Create, rename, and delete try directories
- Git Integration: Clone repositories and create worktrees directly into try directories
- Shell Integration: Seamless
cd navigation through shell wrapper functions
- Cross-Platform: Works on macOS, Linux, and Windows
Installation
Using Go Install
go install github.com/bscott/try/cmd/try@latest
From Source
git clone https://github.com/bscott/try.git
cd try
go build -o try ./cmd/try
sudo mv try /usr/local/bin/
Quick Start
- Initialize shell integration:
# For bash/zsh (add to ~/.bashrc or ~/.zshrc)
eval "$(try init)"
# For fish (add to ~/.config/fish/config.fish)
try init | source
- Use the TUI:
# Launch interactive TUI
try
# The TUI opens with fuzzy search - just start typing!
Usage
Commands
try - Launch interactive TUI
try init [path] - Generate shell integration script
try exec - Execute TUI and output shell command (used by wrapper)
Keyboard Shortcuts
Navigation
↑/↓ or Ctrl+P/N - Move selection up/down
Enter - Select entry and navigate to directory
Ctrl+A - Move cursor to start
Ctrl+E - Move cursor to end
Ctrl+B - Move cursor back one character
Ctrl+F - Move cursor forward one character
Ctrl+K - Kill to end of line
Ctrl+W - Delete word backward
Backspace - Delete character backward
Actions
Ctrl+D - Toggle delete mode / mark entry for deletion
Ctrl+R - Rename selected entry
Ctrl+T - Create new try directory
Ctrl+H - Show help
Esc - Cancel current action / return to normal mode
Ctrl+C - Quit
Delete Flow
- Press
Ctrl+D to enter delete mode
- Press
Ctrl+D again to mark/unmark entries (✗ indicator appears)
- Press
Enter to show confirmation prompt
- Type
YES exactly to confirm deletion
- Press
Esc to cancel at any point
Create Flow
- Press
Ctrl+T to open create prompt
- Enter name (without date prefix)
- Press
Enter to create
- Directory is created as
YYYY-MM-DD-{name} and you're navigated to it
Rename Flow
- Select entry and press
Ctrl+R
- Edit the name (date prefix is preserved)
- Press
Enter to confirm or Esc to cancel
Configuration
Environment Variables
TRY_PATH - Base directory for try directories (default: ~/src/tries)
Example:
export TRY_PATH="$HOME/experiments"
eval "$(try init)"
Git Integration
Clone repositories directly into try directories:
try clone https://github.com/user/repo.git
Create worktrees:
try worktree feature-branch
Fuzzy Matching Algorithm
The fuzzy matcher uses intelligent scoring:
- Recency: Newer directories score higher
- Date Prefix Bonus: Entries with
YYYY-MM-DD- prefix get +10 points
- Character Matches: +1 per matched character
- Word Boundaries: +1 for matches at word start
- Proximity: Closer matches score higher
- Density: Tighter match spans score higher
- Length Penalty: Shorter names score slightly higher
Empty queries show all entries sorted by modification time (newest first).
Project Structure
try/
├── cmd/try/ # Main entry point
│ ├── main.go
│ ├── exec.go # TUI launcher
│ └── init.go # Shell integration
├── internal/
│ ├── config/ # Configuration management
│ ├── tries/ # Directory operations
│ ├── fuzzy/ # Fuzzy matching algorithm
│ ├── tui/ # Bubble Tea TUI
│ ├── git/ # Git operations
│ └── shell/ # Shell integration
└── README.md
Development
Running Tests
go test ./...
Building
go build -o try ./cmd/try
License
MIT License - see LICENSE file for details
Credits