| Crates.io | try-cli |
| lib.rs | try-cli |
| version | 0.1.3 |
| created_at | 2025-11-07 07:30:43.468362+00 |
| updated_at | 2025-11-17 06:20:41.166049+00 |
| description | Lightweight, time-sensitive directory navigation for experiments — a fast way to jump between temporary project folders |
| homepage | https://github.com/dariuszparys/try-rs |
| repository | https://github.com/dariuszparys/try-rs |
| max_upload_size | |
| id | 1921280 |
| size | 99,898 |
Lightweight, time‑sensitive directory navigation for experiments — a fast way to jump between temporary project folders.
Inspired by and adapted from Tobias Lütke's original Ruby tool: https://github.com/tobi/try
One-line install (Linux/macOS):
curl -sSf https://raw.githubusercontent.com/dariuszparys/try-rs/main/install.sh | sh
Then restart your shell and run try to get started!
try?When experimenting you often create throwaway directories (e.g.,
2025-08-21-test-feature-x, tmp-viz-poc). Finding and jumping back to them
slows you down. try gives you an interactive, fuzzy selector that favors what
you touched most recently, and creates a new directory when your query doesn’t
exist — all wired to actually cd your shell.
try clone <url> or pass a git URL to try to clone
into a date‑prefixed dir.cd commands your shell evaluates.curl -sSf https://raw.githubusercontent.com/dariuszparys/try-rs/main/install.sh | sh
This script will:
~/.local/bin~/.local/bin is in your PATH (warns if not)After installation, restart your shell or source your rc file to start using try.
To skip automatic shell integration:
curl -sSf https://raw.githubusercontent.com/dariuszparys/try-rs/main/install.sh | sh -s -- --no-shell-integration
For help:
curl -sSf https://raw.githubusercontent.com/dariuszparys/try-rs/main/install.sh | sh -s -- --help
Download the latest release for your platform from the releases page, extract it, and place the binary in your PATH.
If you have Rust installed:
cargo install try-cli
Prerequisites: a working Rust toolchain from https://rustup.rs
git clone https://github.com/dariuszparys/try-rs.git
cd try-rs
cargo install --path .
Or build a release binary: cargo build --release → target/release/try
If you used the install script, shell integration is already configured! Just restart your shell.
If you installed via another method, add the following to your shell configuration:
bash/zsh:
# add to ~/.bashrc or ~/.zshrc
eval "$(try init)"
fish:
# add to ~/.config/fish/config.fish
eval "$(try init | string collect)"
Then reload your shell:
source ~/.bashrc # or: source ~/.zshrc
Customize the storage location (default: ~/src/tries) either by passing an
absolute path to init or by setting TRY_PATH. You can also override
per‑invocation with the global --path option:
eval "$(try init /absolute/path/to/tries)"
# or
export TRY_PATH=/absolute/path/to/tries
eval "$(try init)"
# or override at call time
try --path /absolute/path/to/tries
Basic:
# Open the selector (with shell function installed)
try # Open the selector
try my-experiment # Seed the query (shell function calls `try cd ...`)
try cd my-experiment # Same as above without the shell function
# Clone a git repo into a date-prefixed directory and cd into it
try clone https://github.com/user/repo.git
try clone git@github.com:user/repo my-fork # custom name
# Shorthand: passing a git URL to `try` behaves like `try clone`
try https://github.com/user/repo
Inside the selector:
YYYY-MM-DD-<query> and cdYES to confirm)Notes:
YYYY-MM-DD-) and jumps into it.-- so they aren’t
parsed as flags, for example: try cd -- --foo --bar. With the shell function
installed, use: try -- --foo.YES to permanently delete the selected
directory.try (with no args): open the selector.try --help: show top‑level help (lists subcommands and global options).try init [--path PATH] [PATH]: print the shell function; add it to your rc
file.try cd [QUERY...] [--path PATH]: launch selector and print the
cd/mkdir/touch commands (used by the shell function).try clone <git-uri> [name] [--path PATH]: print a clone pipeline (mkdir -p,
git clone, touch, cd) into the tries directory.try <git-uri> behaves like try clone <git-uri>.try cd --help, try init --help, try clone --help.~/src/triesTRY_PATH env var or an absolute path argument to try initcommand not found: try: ensure ~/.cargo/bin is on your PATH or reference
the binary directly, e.g. eval "$(~/.cargo/bin/try init)".cd happens: confirm your rc file sources the init
function and that you restarted/reloaded the shell.echo $TRY_PATH or the path passed to init.cargo build (or cargo build --release)cargo run -- [args] (e.g., cargo run -- cd foo)cargo test --all --lockedcargo clippy --all-targets -- -D warningscargo fmt --allArchitecture: single‑binary CLI using crossterm for TUI, dirs for home
paths, and unicode-width for display width.
clap uses its built‑in color logic (color: auto)
and respects standard environment conventions.try’s own warnings and errors are styled on stderr when appropriate and
degrade to plain text when not:
NO_COLOR disables colors.CLICOLOR=0 disables; CLICOLOR_FORCE!=0 forces enable.thiserror) at high‑level
boundaries and returns plain io::Error for low‑level file operations.try writes only under the configured tries directory (default
~/src/tries).MIT — see LICENSE.
See CONTRIBUTING.md for workflow and PR expectations, and AGENTS.md for structure, commands, style, and testing guidelines.