Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Add multi-environment mode and one-command setup feature - #20

Open
Tharun-DV wants to merge 2 commits into
tobi:masterfrom
Tharun-DV:master
Open

Add multi-environment mode and one-command setup feature#20
Tharun-DV wants to merge 2 commits into
tobi:masterfrom
Tharun-DV:master

Conversation

@Tharun-DV

Copy link
Copy Markdown

Add two major features to try:

  1. Multi-environment mode (--base)

    • try init --base ~/src organizes workspaces into multiple
      environments (tries, experiments, prod) under a base directory
    • Two-step TUI: first pick an environment, then pick/create a project
    • Each subdirectory of the base path becomes an environment
    • New environments can be created on-the-fly by typing a name
    • ENV mode disables delete/rename (only projects get those)
    • Fully backward compatible: single-root mode unchanged
  2. One-command setup (--install)

    • try init --base ~/src --install does everything:
      • Creates the base directory and default env subdirs
      • Auto-detects shell (zsh/bash/fish) from $SHELL
      • Appends shell function to the right config file
      • Skips if a try function is already present
    • All output goes to stderr (nothing on stdout) to prevent
      accidental eval side effects

Tharun-DVand others added 2 commits April 19, 2026 21:47
Add two major features to try:
1. Multi-environment mode (--base)
- `try init --base ~/src` organizes workspaces into multiple
environments (tries, experiments, prod) under a base directory
- Two-step TUI: first pick an environment, then pick/create a project
- Each subdirectory of the base path becomes an environment
- New environments can be created on-the-fly by typing a name
- ENV mode disables delete/rename (only projects get those)
- Fully backward compatible: single-root mode unchanged
2. One-command setup (--install)
- `try init --base ~/src --install` does everything:
- Creates the base directory and default env subdirs
- Auto-detects shell (zsh/bash/fish) from $SHELL
- Appends shell function to the right config file
- Skips if a try function is already present
- All output goes to stderr (nothing on stdout) to prevent
accidental eval side effects
Files changed:
src/tui.h - SelectorMode enum (SELECTOR_FOLDERS,
SELECTOR_ENVS)
src/tui.c - ENV mode rendering (title, footer, no
delete/rename)
src/commands.h - Updated signatures with base_path parameter
src/commands.c - --base/--install parsing, env subdir creation,
rc file detection, duplicate check, two-step
selector
src/main.c - --base flag, multi-env path resolution, updated
help
README.md - New multi-env docs, --install walkthrough,
comparison
feat: add multi-environment mode and --install flag
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Tharun-DV