CLI tool
tobi/try avatar
tobi/try

tobi/try: a one-file Ruby script that gives every experiment its own dated directory

fresh directories for every vibe

4,035 stars160 forksShellMIT

At a glance

What is it?
try is a single Ruby file that keeps throwaway projects in one folder, names them with the date, and jumps you there through a fuzzy-search TUI. It is for people whose filesystem is full of directories called test2.
Who is it for?
Adopt try if you already scatter throwaway projects across /tmp and Desktop and want them in one dated folder with a fuzzy-search jump. Skip it if you need per-project environment management, task running or language version switching; try only creates and navigates directories.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 44 days ago.
What is it written in?
Mainly Shell, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem try solves, and who actually has it

The README opens with the exact failure mode: fifty directories named test, test2, new-test, actually-working-test, or worse, code living in /tmp until the machine reboots. The stated audience is anyone who constantly creates new projects for little experiments. That is a narrower group than it sounds. If your work happens inside a handful of long-lived repositories, try adds a layer you do not need. It pays off when the unit of work is a scratch directory you will abandon in a week and want to find again in a month. The README frames the payoff as a single place for all experiments with instant fuzzy search, and the demo shows an interactive list with a create-new row at the bottom.

How the fuzzy search and the dated directory naming work

try keeps everything under one root, ~/src/tries by default, configurable through TRY_PATH. New directories get a date prefix, so an idea typed as pool becomes 2025-08-17-pool. The README notes that if you already typed a name, the date prompt is skipped. Search is not plain substring matching. The README gives two examples: rds matches redis-server, and connpool matches connection-pool. Ranking is time-aware. Recently accessed directories float to the top, and shorter names win on equal matches. The TUI prints a score next to each result, which is unusual and useful: when the ranking surprises you, the number tells you why.

A second path exists for repositories you did not start from scratch. try clone takes a git URL, derives a directory name from it, strips the .git suffix, and creates a date-prefixed directory. A GitHub pull request URL is handled differently: it clones the main repository, fetches the PR ref, and checks it out in detached HEAD state, with the directory named after the main repository rather than the /pull/<number> suffix. The README lists supported URI forms including HTTPS GitHub, SSH GitHub, GitLab, generic SSH hosts, SSH with a custom port, nested SCP-style URLs, and GitHub pull requests.

There is also a worktree mode. try . creates a dated directory for the current repository; inside a Git repo it adds a detached HEAD git worktree there, and outside a repo it just creates the directory and changes into it. The name defaults to the current directory's basename unless you pass one.

Installing try-cli and running your first experiment

The recommended route is RubyGems. The README gives gem install try-cli, then a shell hook. The init subcommand prints shell code; you evaluate it rather than storing a static function. For Bash and Zsh that is eval "$(try init)", and the README shows the same pattern with an explicit path, eval "$(try init ~/src/tries)".

bash
gem install try-cli

For Fish the syntax differs because Fish does not have eval in the same form. The README pipes init into source instead.

bash
try init | source

If you would rather not install a gem, the manual route downloads the single script and marks it executable. Note that this path uses ~/.local/try.rb, not the gem's executable name.

bash
curl -sL https://raw.githubusercontent.com/tobi/try/refs/heads/main/try.rb > ~/.local/try.rb
chmod +x ~/.local/try.rb
echo 'eval "$(ruby ~/.local/try.rb init ~/src/tries)"' >> ~/.zshrc

Once the hook is loaded, browsing and creating are the same gesture. Typing try with no argument opens the full list; typing a word filters it and offers a create row when nothing matches.

bash
try
try pool
try new api

The README says try new api starts you with 2025-08-17-new-api, and that the first command opens the browser over all experiments. To see everything the script accepts, the README points at try --help. Keyboard handling is documented too: arrows or Ctrl-P/N/J/K to move, Enter to select or create, Ctrl-D to delete a directory after confirmation, ESC to cancel. Ctrl-D deleting a directory is the one binding worth reading twice before you press it.

The native binary path is real but not ready for most users

The README documents an optional native build using Spinel, Matz's Ruby implementation. It is explicit that building Spinel from source is required and that PR 3906 must be present so IO#tty? and #winsize work on handles that are not statically typed IO. Without that patch the TUI has no terminal geometry to draw against. The build target is make native SPINEL=/path/to/spinel, which the Makefile comments describe as -O s followed by strip, and a separate make native-test SPINEL=/path/to/spinel target exists for tests. The README states that MRI ruby try.rb and the gem keep working, and that the two init forms emit different wrappers: dist/try init emits the binary path while ruby try.rb init still emits /usr/bin/env ruby with the script path.

Read that as an experiment inside an experiment. You need a patched compiler toolchain before you get a faster try. Nothing in the README claims a speedup figure, and none should be assumed.

Where try is the wrong tool

try creates and navigates directories. It does not manage them. There is no documented way to pin a Ruby version, install dependencies per experiment, or run tasks inside one; the Makefile's test, lint, install and demo targets operate on try's own source, not on your experiments. If your scratch directories need isolated language runtimes or container definitions, try will hold the folder and nothing else.

Deletion is the sharpest edge. Ctrl-D removes a directory from inside the TUI. The README mentions a confirmation step and nothing more: no trash, no undo, no dry run. If TRY_PATH points at a directory containing anything you care about, the browsing interface is one keystroke away from removing it. That is a design choice, and it is worth deciding deliberately rather than discovering.

The interface also assumes an interactive terminal. Fuzzy search, arrow keys and match highlighting are all TUI behaviour, so try is not something you script in a pipeline to resolve a path. The README does not document a non-interactive query mode.

Finally, the shell hook is generated, not installed. You are appending an eval line to .zshrc, .bashrc or config.fish. If you move the script, change TRY_PATH, or switch between the gem and the manual copy, the hook still points at the old target until you regenerate it.

How try differs from zoxide and from a plain projects folder

The closest comparison is zoxide, which also ranks directories by how often and how recently you visit them. The difference is where the state lives and what gets created. zoxide learns from cd calls anywhere on your filesystem; you keep your own layout, and it only remembers it. try owns a root directory, creates dated children inside it, and can clone or check out a repository into a new one. zoxide never makes a directory. If your problem is finding a folder you already have, zoxide fits. If your problem is that you have nowhere consistent to put the folder in the first place, try's create-and-jump model addresses that, at the cost of a fixed root and a date prefix on every name.

A plain projects folder with your shell's built-in completion is the other option. It costs nothing and imposes no naming scheme. What it does not do is rank by recency, run fuzzy matching across word boundaries the way the README describes for rds and connpool, or offer to create the directory you were searching for when the search comes up empty.

Maintenance, distribution and licence

The repository is not archived. Its last push was on 2026-08-16, and the most recent release listed is v1.9.0 on 2026-03-07. The project ships through several channels at once, which is the main thing to weigh when planning an upgrade: RubyGems under the name try-cli, a raw try.rb file fetched by URL, a Nix flake with nix run github:tobi/try and Home Manager instructions, a Homebrew Formula directory in the repository, and the optional Spinel binary. That breadth means an upgrade is not one action. A gem update and a stale ~/.local/try.rb can coexist on the same machine, and the shell hook decides which one runs. Pinning to the gem and regenerating the hook after each update is the only path with a version number attached.

The licence is MIT, which permits use, modification and redistribution with the licence and copyright notice retained. That is a permissive arrangement, and it says nothing about whether the project will keep receiving changes; treat the release cadence as the signal for that. This is a description of the licence text, not legal advice.

Editorial conclusion

Adopt try if you already scatter throwaway projects across /tmp and Desktop and want them in one dated folder with a fuzzy-search jump. Skip it if you need per-project environment management, task running or language version switching; try only creates and navigates directories. Before trusting it, run try --help and try init in a scratch shell to see the wrapper function it emits, then check whether TRY_PATH points somewhere you are willing to have deleted from inside the TUI.

Frequently asked questions

How do I install tobi/try?

The README recommends gem install try-cli, followed by adding eval "$(try init)" to .zshrc or .bashrc, or try init | source for Fish. A manual route downloads try.rb with curl, makes it executable, and appends an eval line pointing at the Ruby script.

Where does tobi/try store my experiment directories?

Everything lives under ~/src/tries by default, and the README says this is configurable by setting the TRY_PATH environment variable, for example export TRY_PATH=~/code/sketches.

Does tobi/try create git worktrees or clone repositories?

Both are documented. try . creates a dated directory for the current repository and, inside a Git repo, adds a detached HEAD git worktree there; outside a repo it only creates the directory. try clone <url> clones into a date-prefixed directory, and a GitHub pull request URL clones the main repository, fetches the PR ref, and checks it out in detached HEAD state.

What happens if I press Ctrl-D in tobi/try?

The README lists Ctrl-D as delete directory with confirmation. It does not document a trash, undo or dry-run mode, so the directory is removed from inside the TUI once you confirm.

Can I build tobi/try as a native binary without Ruby?

The README documents an optional native build with Spinel, but it requires building Spinel from source with PR 3906 applied so IO#tty? and #winsize work on non-statically-typed IO handles. MRI ruby try.rb and the gem keep working either way.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. tobi/try on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tobi-try.svg)](https://hysenlabs.com/projects/tobi-try)