try: one Ruby file, five ways to install, and worktrees that detach without telling you
fresh directories for every vibe
At a glance
- What is it?
- try is a single-file Ruby script with no dependencies that gives every side project its own dated directory and a fuzzy picker to find it again. It ships as a gem under a different name, as a curl, as a native binary, as a Nix flake with a Home Manager module, and as a Homebrew formula, and the parts worth reading closely are the worktree commands, which quietly create a detached HEAD, and a Makefile variable pointing at a directory name the repository does not use.
- Who is it for?
- Use this if you start small projects faster than you finish them and lose track of them, because the whole value is the dated directory plus a picker that ranks by what you touched last. Three things to know.
- 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 91 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 November 15, 2026, and from our analysis. They are not legal advice.
Star history
- tobi/try4,064 ★ · +43
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| tobi/try | 4k | 4.1k |
43 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One file, two names and five installation routes
The project is one Ruby file with no dependencies, and it is distributed five ways. The gem is named differently from the tool it installs, so `gem install try-cli` gives you a command called `try`:
gem install try-cliThe manual route fetches the script by URL into a local directory and makes it executable, then adds one line to your shell profile:
curl -sL https://raw.githubusercontent.com/tobi/try/refs/heads/main/try.rb > ~/.local/try.rb
chmod +x ~/.local/try.rbThen there is an optional native binary compiled through Spinel, a Nix flake runnable directly from GitHub with a Home Manager module for declarative configuration, and a Homebrew formula. So the same behaviour is reachable from a gem, a curl, a compiler, a package manager and a home-manager module, and every route ends with the same command name. The shell line differs by shell: bash and zsh evaluate the output of an init subcommand, while fish pipes it into source.
try . quietly adds a detached HEAD worktree
The worktree commands are the part of the interface with real consequences, and the documentation is specific about them. With a name argument the directory uses that name; without one it uses the current directory's basename. Either way it is prefixed with today's date. Then behaviour diverges based on where you are. Inside a git repository, the tool adds a git worktree to the created directory in a detached HEAD state. Outside a repository, it simply creates the directory and changes into it. So the same command that gives you a scratch directory gives you a worktree when you happen to be standing in one, and the worktree is detached rather than on a branch. A detached worktree keeps uncommitted changes in its own working tree, which means nothing warns you that the directory is not on a branch and nothing tells you later which directories were worktrees. It is a reasonable default for a throwaway experiment and a sharp edge if the experiment turns into work.
A pasted pull request URL checks out detached and is named after its parent
The clone command accepts a URL, and it accepts more shapes than you would expect. Seven formats are listed: HTTPS and SSH on GitHub, HTTPS on GitLab, SSH to any other host, SSH with a custom port, a nested SCP-style SSH address with a user and a path, and a GitHub pull request URL. There is also a shorthand where the clone keyword is dropped entirely, so a bare repository address is enough. The pull request case has its own behaviour: it clones the main repository, fetches the pull request ref, and checks it out in a detached HEAD state. The directory name is derived from the main repository URL rather than from the pull suffix, so cloning two pull requests from the same repository produces the same directory name. The suffix is also stripped when generating names, so a clone address ending in it yields a name without it. Those three details are what stop a naming collision from looking like a bug.
The native path needs an unmerged upstream pull request
The optional native build is where the README admits a dependency it does not control. Compiling a native binary requires Spinel, and that project must be built from source with a specific upstream pull request applied, so that two methods for detecting a terminal and reporting its window size work on handles that are not statically typed IO. Without that patch the native path does not build, which means the compiled binary depends on an unmerged change in another project. The Makefile target takes the path to Spinel as a variable and carries a comment about optimising for size and then stripping, and there is a separate native-test target. The reassuring part is stated immediately after: the interpreter run and the gem keep working regardless, and the two emit different init lines, with the binary reporting its own path and the script reporting an interpreter invocation. So the native route is genuinely optional and the fallback is not a degraded mode.
The Makefile points at a tests directory the repository does not have
The developer entry point is a Makefile whose default target is help, printing the available targets in colour by grepping them out of itself and passing them through awk. At the top it sets the shell, the interpreter, the script name and a variable for the test directory. That last one is set to a directory named with a plural form that does not appear in the repository: the tree contains a spec directory and a test directory, so the variable points at neither. The likely explanation is a rename at some point rather than a broken build, since the directory that exists has the singular form. It is the kind of small inconsistency that costs a contributor an afternoon the first time they run a test target and nothing finds anything. Around the Makefile the rest of the toolchain is duplicated between a Rakefile and a gemspec, and the tree carries two test locations, which together suggest the Ruby and shell halves are tested by two different runners.
Fuzzy search that ranks by recency and shows you the scores
The matching is described as fuzzy rather than substring, with two worked examples: a short abbreviation matches a longer server name, and an abbreviated pool name matches a connection pool entry. Ranking then has two rules on top of the match, recently accessed directories score higher, and shorter names win when the match quality is equal. The interface exposes the ranking rather than hiding it, highlighting matches as you type and displaying the scores so you can see why something is where it is, which is the difference between a picker you trust and one you fight. Time is shown alongside, how long ago each directory was touched, and recently accessed entries float to the top, which is the answer to the question the tool exists to ask: what was I doing yesterday. The keyboard map is complete enough to mention here: arrows or four control keys navigate, enter selects or creates, backspace deletes a character, control-d deletes a directory after a confirmation, escape cancels.
Shell output is neutral and only the wrapper differs
One design decision is called out explicitly and it is the right one. The commands the tool prints when it initialises a shell are shell-neutral, using absolute paths and quoting that is already correct, so the only thing that varies between bash, zsh and fish is a small wrapper function. That matters more than it sounds, because the alternative is a different set of emitted commands per shell, which is exactly the configuration that breaks when someone switches shells or when the generated output gets pasted somewhere unexpected. Storage location is a single environment variable with a default, so the same profile can point at a different directory without any code change. And the tool will create a directory when a search finds nothing, which is why the enter action both selects and creates, and why the documentation notes that supplying your own name skips the date prompt rather than producing a dated duplicate of it.
Editorial conclusion
Use this if you start small projects faster than you finish them and lose track of them, because the whole value is the dated directory plus a picker that ranks by what you touched last. Three things to know. The install name and the command name differ, so the gem is called try-cli and the shell command is try. The worktree commands add a detached HEAD worktree when you run them inside a repository, so commit on a branch before you treat the directory as real work. And the native binary depends on an unmerged pull request in another project, so stay on the interpreter or the gem unless you have read that dependency.
Frequently asked questions
How do I install try?
Four documented ways. The gem, with `gem install try-cli`, which installs a command called try. A manual route that curls the single script into a local directory, makes it executable and adds one line to your shell profile. An optional native binary compiled through Spinel. Or the Nix flake, runnable straight from GitHub, which also ships a Home Manager module. The command name is try in every case.
What does try . do inside a git repository?
It creates a dated directory for the current project and, inside a repository, adds a git worktree pointing at it in a detached HEAD state. Outside a repository it simply creates the directory and changes into it. With a name argument that name is used, otherwise the current directory's basename, and either is prefixed with today's date.
Can try clone a pull request URL?
Yes. Pasting a GitHub pull request URL clones the main repository, fetches the pull request ref and checks it out detached, naming the directory after the main repository rather than the pull suffix. Seven URL shapes are supported in total, including HTTPS and SSH on GitHub, HTTPS on GitLab, SSH to other hosts with or without a custom port, and nested SCP-style SSH addresses.
Where does try store experiment directories?
In a directory under your home named src/tries by default, and the TRY_PATH environment variable changes it. Directories are prefixed with today's date, and if you already supplied a name the date prompt is skipped rather than producing a dated duplicate of what you typed.
How does try decide which directory to open?
By fuzzy matching rather than substring matching, with recently accessed directories scoring higher and shorter names winning when the match quality is equal. The interface highlights matches as you type and displays the scores, so the ranking is visible rather than mysterious, and each entry shows how long ago it was last touched.
Official sources
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.
[](https://hysenlabs.com/projects/tobi-try)Star history chart for your README
[](https://hysenlabs.com/projects/tobi-try)Was this useful?