Skip to content

Export TRY_PATH env var from init output#100

Open
xaptronic wants to merge 1 commit intotobi:mainfrom
xaptronic:export-try-path
Open

Export TRY_PATH env var from init output#100
xaptronic wants to merge 1 commit intotobi:mainfrom
xaptronic:export-try-path

Conversation

@xaptronic
Copy link

@xaptronic xaptronic commented Feb 18, 2026

Summary

  • try init now exports TRY_PATH as an environment variable alongside the shell function
  • Bash/zsh gets export TRY_PATH='...', fish gets set -gx TRY_PATH '...'
  • Allows other tools to discover the tries directory via $TRY_PATH without hardcoding paths

Motivation

Other CLI tools want to place output into the tries directory when available. The path is already baked into the --path arg inside the function body, but isn't accessible to external tools. Exporting it as an env var makes it a public interface.

The variable is already read by try itself as input (TRY_PATH=/foo try init), so this just closes the loop by also setting it as output.

Test plan

  • All existing tests pass
  • try init ~/src/tries outputs export TRY_PATH='...' before the function
  • SHELL=/usr/bin/fish try init outputs set -gx TRY_PATH '...' before the function

Allow other tools to discover the tries directory by reading
$TRY_PATH from the environment. The init command now emits an
export (bash/zsh) or set -gx (fish) before the function definition.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments