A Go implementation of the Ruby try utility for quickly creating and navigating to temporary project folders.
Note: A child process cannot change the parent shell's directory, so shell integration is required. This is the same approach used by tools like zoxide, autojump, and z.
- Create dated folders:
try some namecreates~/try/2025-10-09-some-name - Fuzzy search: Automatically finds and navigates to existing folders based on name (using sahilm/fuzzy)
- Interactive selector: When multiple matches are found, shows an interactive menu with top 3 matches and "create new" option
- Informative output: Displays folder name, creation date, and usage count when navigating
- Tracks usage: SQLite database tracks folder creation dates, open count, and last opened time
- Smart sorting: Results sorted by fuzzy match score, usage frequency, and last opened time
Install using Go:
go install github.com/ACPixel/try@latestOr clone and build locally:
git clone https://github.com/ACPixel/try.git
cd try
go installAfter installing, run:
try initThis will output shell integration code. Add it to your ~/.bashrc or ~/.zshrc:
try init >> ~/.bashrc
source ~/.bashrcOr manually add:
try() {
local output
# Only capture stdout for cd command, let stderr through for interactive prompts
output=$(command try "$@" 2>/dev/tty)
if [ $? -eq 0 ]; then
eval "$output"
else
return 1
fi
}After adding the alias, simply run:
# Create a new folder and cd into it
try my-project
# Creates: ~/try/2024-01-15-my-project and changes directory
# Later, fuzzy search will find it and cd into it
try my-proj
# Navigates to: ~/try/2024-01-15-my-project
# Output: ✓ my-project (2024-01-15, opened 2 times)
# If multiple matches are found, an interactive selector appears
try project
# Shows interactive menu with top 3 matches:
# > project-a (2024-01-10, opened 5 times)
# project-b (2024-01-12, opened 3 times)
# project-c (2024-01-14, opened 1 times)
# Create new: project- The Go binary searches the database for existing folders matching your query using fuzzy search
- If a single match is found, it displays folder info, updates usage stats, and outputs
cd "path" - If multiple matches are found, it shows an interactive selector with the top 3 matches and a "create new" option
- If no match is found, it creates a new dated folder and outputs
cd "path" - The shell function wraps the binary and
evals the output to change directory - Folder information (name, date, usage count) is displayed in gray with a checkmark for easy identification
# Clone the repository
git clone https://github.com/ACPixel/try.git
cd try
# Install to $GOPATH/bin (or $HOME/go/bin if GOPATH is not set)
go install
# Or build locally
go build -o try main.goThe SQLite database is stored at ~/try/try.db and tracks:
- Folder paths
- Names
- Creation dates
- Times opened
- Last opened timestamp