You are helping the user analyze what's on their PATH and suggest additions or improvements.
Analyzes your shell PATH configuration, identifies issues, and suggests improvements for better tool management.
/plugin marketplace add danielrosehill/linux-desktop-plugin/plugin install lan-manager@danielrosehillYou are helping the user analyze what's on their PATH and suggest additions or improvements.
Display current PATH:
echo $PATH | tr ':' '\n'
Check which paths actually exist:
echo $PATH | tr ':' '\n' | while read p; do
if [ -d "$p" ]; then
echo "✓ $p"
else
echo "✗ $p (does not exist)"
fi
done
Check for duplicate PATH entries:
echo $PATH | tr ':' '\n' | sort | uniq -d
Identify where PATH is being set: Check common locations:
grep -n "PATH" ~/.bashrc ~/.bash_profile ~/.profile /etc/environment /etc/profile 2>/dev/null
Check for common development tool paths:
Programming languages:
~/.local/bin~/.cargo/bin~/go/bin or $GOPATH/bingem environmentnpm config get prefixPackage managers:
/home/linuxbrew/.linuxbrew/bin~/.sdkman/candidates/*/current/bin~/.local/binVersion managers:
~/.pyenv/bin~/.rbenv/bin~/.asdf/binSystem tools:
~/bin, ~/.local/bin/snap/bin/var/lib/flatpak/exports/binCheck what's installed in each PATH directory: For each directory in PATH:
echo "Contents of $dir:"
ls -la "$dir" | head -10
Suggest missing common paths: Check and suggest if not in PATH:
~/.local/bin (Python user packages, pipx)~/bin (User scripts)~/.cargo/bin (Rust packages)~/go/bin (Go packages)/snap/bin (Snap packages)~/.npm-global/bin (npm global packages)For each missing path that has executables, suggest adding it.
Check for security issues:
. (current directory) is in PATHecho $PATH | tr ':' '\n' | while read p; do
if [ -d "$p" ] && [ -w "$p" ]; then
ls -ld "$p"
fi
done
Check PATH order/precedence: Explain that earlier paths take precedence. Show which binary would be executed:
which -a python python3 java gcc git node npm
Check for conflicting tools:
type -a python
type -a python3
type -a java
Suggest PATH organization: Recommended order:
~/bin, ~/.local/bin)/usr/local/bin, /usr/bin, /bin)Check environment-specific paths:
Python:
python3 -m site --user-base
# Suggests adding $(python3 -m site --user-base)/bin
Node/npm:
npm config get prefix
# Suggests adding <prefix>/bin
Go:
go env GOPATH
# Suggests adding $GOPATH/bin
Rust:
echo $CARGO_HOME
# Suggests adding ~/.cargo/bin
Generate suggested PATH setup: Based on findings, create suggested additions for ~/.bashrc:
# User binaries
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
# Python
export PATH="$HOME/.local/bin:$PATH"
# Rust
export PATH="$HOME/.cargo/bin:$PATH"
# Go
export PATH="$HOME/go/bin:$PATH"
# SDKMAN
# Added by sdkman-init.sh
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# Homebrew
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
Check for broken symlinks in PATH:
echo $PATH | tr ':' '\n' | while read dir; do
if [ -d "$dir" ]; then
find "$dir" -maxdepth 1 -type l ! -exec test -e {} \; -print 2>/dev/null
fi
done
Provide recommendations:
. in PATH, world-writable dirs)Show how to temporarily modify PATH:
# Add to front (takes precedence)
export PATH="/new/path:$PATH"
# Add to end
export PATH="$PATH:/new/path"
# Remove from PATH
export PATH=$(echo $PATH | tr ':' '\n' | grep -v "/path/to/remove" | tr '\n' ':')
Show how to make PATH changes permanent:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
.) to PATHsource ~/.bashrc