Skip to content

Add pv env command for shell PATH configuration#20

Merged
munezaclovis merged 3 commits intomainfrom
feat/pv-env
Mar 5, 2026
Merged

Add pv env command for shell PATH configuration#20
munezaclovis merged 3 commits intomainfrom
feat/pv-env

Conversation

@munezaclovis
Copy link
Copy Markdown
Contributor

Summary

  • Adds pv env command that outputs shell-specific PATH configuration
  • Users add one line to their shell config instead of hardcoded export statements:
    eval "$(pv env)"
    
  • Updates pv install PATH instructions to reference pv env

How it works

pv env detects the shell via $SHELL and outputs the appropriate syntax:

zsh/bash:

$ pv env
export PATH="/Users/you/.pv/bin":"/Users/you/.pv/composer/vendor/bin":"$PATH";

fish:

$ pv env
fish_add_path -g "/Users/you/.pv/bin" "/Users/you/.pv/composer/vendor/bin";

Why

Future-proof PATH management. If pv adds more directories to PATH later (new tools, new shim locations), pv env picks them up automatically -- users don't need to re-edit their shell config.

Changes

  • cmd/env.go — new command
  • cmd/env_test.go — tests for zsh, bash, fish, and empty SHELL fallback
  • internal/setup/shell.goPrintPathInstructions now references eval "$(pv env)" instead of hardcoded export lines

Outputs shell-specific PATH export so users can add a single line
to their shell config:

  eval "$(pv env)"

Detects zsh/bash (export PATH=...) vs fish (fish_add_path).
Future-proof: if pv adds more PATH entries, pv env picks them up
automatically without users re-editing their shell config.

Updates PrintPathInstructions to reference pv env instead of
hardcoded export lines.
@munezaclovis munezaclovis merged commit 0ace031 into main Mar 5, 2026
1 of 2 checks passed
@munezaclovis munezaclovis deleted the feat/pv-env branch March 5, 2026 05:25
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