Skip to content

Releases: melonamin/try

v0.2.2

07 Jan 23:19

Choose a tag to compare

Remove 'q' as quit shortcut to allow searching for words containing 'q'

v0.2.1

14 Oct 12:25
v0.2.1
f88bdf1

Choose a tag to compare

Release v0.2.1

Overview

This release fixes Issue #4 by implementing a comprehensive configuration system with environment variable overrides and proper migration support.

🎯 Key Highlights

  • Environment Variable Support: Override any config setting with TRY_PATH and TRY_SHELL
  • Enhanced Security: Path sanitization, shell validation, and restrictive file permissions
  • Seamless Migration: Automatic detection and upgrade from v0.2.0 configuration
  • Version Flag: New --version flag to display app version
  • Improved Error Handling: Better error messages and graceful degradation
  • Cross-Platform Consistency: Unified config location across all platforms

✨ New Features

Environment Variable Overrides

You can now control try entirely through environment variables without needing a config file:

export TRY_PATH=~/code/experiments
export TRY_SHELL=/bin/zsh
try

Configuration Priority System

Settings are resolved in a clear, predictable order:

  1. Environment variables (TRY_PATH, TRY_SHELL) - highest priority
  2. Config file (~/.config/try/config)
  3. Default values - fallback

Version Flag

try --version  # or -v
# Output: try version 0.2.1

🔒 Security Improvements

Path Sanitization

  • Prevents path traversal attacks (e.g., ../../etc/passwd)
  • Expands ~ to absolute paths
  • Normalizes all path separators and redundant components
  • Validates paths before use

Shell Validation

  • Verifies shell executables exist before launching
  • Requires absolute paths for shells (enforces explicit configuration)
  • Uses exec.LookPath() to validate executability

File Permissions

  • Config directory now uses 0700 (owner-only access)
  • Config file uses 0600 (owner-only read/write)
  • Previously used world-readable 0644 - now properly secured

🔧 Configuration Changes

Unified Config Location

The config file is now always located at ~/.config/try/config on all platforms.

Automatic Migration

When upgrading from v0.2.0, try will automatically:

  • Detect config at old location (~/Library/Application Support/try/config on macOS)
  • Migrate to new location (~/.config/try/config)
  • Convert plain text format to JSON if needed
  • Back up the old config file
  • Show migration messages on stderr

Config File Format

The JSON format remains the same:

{
  "path": "/Users/alex/experiments",
  "shell": "/bin/zsh"
}

🐛 Bug Fixes

Fixed: Config Loading with TRY_PATH Set

Issue: When TRY_PATH was set, config loading and migration were completely skipped, causing inconsistent behavior.

Fix: Config is now always loaded first, then environment variables are applied as overrides. This ensures:

  • Migration still works even with env vars set
  • Config file settings are available as defaults
  • Validation runs on all configuration sources

Fixed: Ignored Errors After Config Reload

Issue: After prompting users for paths, config reload errors were silently ignored, which could cause nil pointer panics.

Fix: All config reload operations now properly handle errors and exit with clear error messages.

Fixed: Home Directory Fallback

Issue: If home directory couldn't be determined, the tool would fall back to a relative path, potentially writing configs to arbitrary working directories.

Fix: Now returns empty string and uses ephemeral in-memory config with a clear warning.

🔄 Breaking Changes

Config File Location (Soft Breaking)

Old: ~/Library/Application Support/try/config (macOS), platform-specific on others
New: ~/.config/try/config (all platforms)

Impact: Automatic migration handles this transparently. You don't need to do anything.

Shell Path Validation (Potential Breaking)

Change: Shell paths in config are now validated and must be absolute paths.

Impact: If you had a relative shell path or non-existent shell in your config:

  • Old behavior: Would fail at shell launch
  • New behavior: Fails at config validation with clear error message

Fix: Update your config to use absolute paths:

{
  "shell": "/bin/zsh"  // ✅ Good
  // "shell": "zsh"    // ❌ No longer accepted
}

📦 Installation

Homebrew (macOS/Linux)

brew install melonamin/tap/try

Binary Releases

Download from GitHub Releases

Full Changelog: v0.2.0...v0.2.1

v0.2.0

28 Aug 01:01
v0.2.0
31adca8

Choose a tag to compare

v0.2.0 - Shell Integration & Configuration

✨ What's New

Shell Configuration & Detection Fix

  • Fixed issue where try would launch wrong shell (e.g., zsh instead of fish) when $SHELL doesn't reflect the actual fixes running shell. Fixes #1 by @mishamsk
  • Added optional shell override in config file - configure once during onboarding
  • Config now uses JSON format with automatic migration from old format

Select-Only Mode for Shell Integration

  • New --select-only (-s) flag outputs selected path instead of launching subprocess
  • Enables cd in current shell: cd $(try -s)
  • Full color support preserved when using command substitution
  • TUI renders to stderr, path outputs to stdout

Shell Function Examples

# Add to .bashrc/.zshrc
 trycd() {
   dir=$(try -s "$@")
   [[ -n "$dir" ]] && cd "$dir"
 }

 # Now use: trycd redis

🔧 Improvements

  • Refactored shell detection to eliminate code duplication
  • Enhanced onboarding flow with shell configuration option
  • Better color profile detection for terminal output

📚 Documentation

  • Added comprehensive shell integration guide
  • Documented rationale for subprocess vs cd approaches
  • Included examples for bash, zsh, and fish shells

💔 Breaking Changes

None - fully backward compatible. Old text configs auto-migrate to JSON.

Full Changelog: v0.1.0...v0.2.0

v0.1.0

22 Aug 00:13
v0.1.0
832f4b3

Choose a tag to compare

Release v0.1.0

🎉 Initial Release

A Go reimplementation of tobi/try - the tool for managing your experimental coding directories with style.

✨ Features

Core Functionality

  • Smart Fuzzy Search - Find your experiments instantly with intelligent matching
  • Time-Aware Sorting - Recently accessed directories bubble to the top
  • Auto-Dating - Automatically prefixes directories with dates (e.g., 2025-01-21-redis-test)
  • Beautiful TUI - Clean, minimal interface with syntax highlighting
  • Zero Config - Single binary, no dependencies required

New in This Fork

  • 📦 GitHub Repository Cloning - Clone repos directly with try --clone or through the TUI
  • 🗑️ Directory Deletion - Safe deletion with two-step confirmation (Ctrl+D)
  • ⚡ Performance Optimizations - Pre-compiled regex, faster startup, and timeout protection
  • 🍎 macOS Universal Binary - Native support for both Intel and Apple Silicon
  • 🐧 Linux Support - Pre-built binaries for amd64 and arm64

📥 Installation

Pre-built Binaries

macOS (Universal)

curl -L https://github.com/melonamin/try/releases/latest/download/try-macos-universal.zip -o try.zip
unzip try.zip
chmod +x try-macos-universal
sudo mv try-macos-universal /usr/local/bin/try

Linux (amd64)

curl -L https://github.com/melonamin/try/releases/latest/download/try-linux-amd64.tar.gz | tar xz
chmod +x try-linux-amd64
sudo mv try-linux-amd64 /usr/local/bin/try

Linux (arm64)

curl -L https://github.com/melonamin/try/releases/latest/download/try-linux-arm64.tar.gz | tar xz
chmod +x try-linux-arm64
sudo mv try-linux-arm64 /usr/local/bin/try

Using Go

go install github.com/melonamin/try@latest

🎮 Usage

try                                      # Browse all experiments
try redis                                # Jump to redis experiment or create new
try new api                              # Start with "2025-01-21-new-api"
try github.com/user/repo                 # Shows clone option in TUI
try --clone https://github.com/user/repo # Clone directly without TUI

Keyboard Shortcuts

  • ↑/↓ or Ctrl+j/k - Navigate entries
  • Enter - Select directory or create new
  • Ctrl+N - Quick create new experiment
  • Ctrl+D - Delete selected directory
  • Ctrl+U - Clear search
  • ESC/q - Exit

🔧 Configuration

Set TRY_PATH to change where experiments are stored:

export TRY_PATH=~/code/sketches

Default: ~/src/tries