Shell Integration
Integrate projax into your shell for a smoother workflow.
Quick Navigation Function
Add to ~/.zshrc or ~/.bashrc:
prxcd() {
eval "$(prx cd $@)"
}
Usage:
prxcd 1 # Change to project 1
prxcd "My Project" # Change to project by name
prxcd # Interactive selection
Background Execution Helper
prxbg() {
prx "$@" -M
}
Usage:
prxbg 1 dev # Run project 1 dev in background
prxbg 2 start # Run project 2 start in background
Combined Helper
prxgo() {
local project="$1"
shift
eval "$(prx cd $project)"
prx "$project" "$@"
}
Usage:
prxgo 1 dev # Change to project 1 and run dev
prxgo "My Project" build # Change to project and run build
Aliases
Create shorter aliases:
# Add to ~/.zshrc or ~/.bashrc
alias pa='prx add'
alias pl='prx list'
alias ps='prx scan'
alias pr='prx remove'
alias pi='prx i' # Launch TUI
alias pw='prx web' # Launch Desktop
Fish Shell
For Fish shell (~/.config/fish/config.fish):
function prxcd
eval (prx cd $argv)
end
function prxbg
prx $argv -M
end
PowerShell
For PowerShell (add to profile):
function prxcd {
$cmd = prx cd $args
Invoke-Expression $cmd
}
function prxbg {
prx $args -M
}
Auto-completion
Zsh
Add to ~/.zshrc:
_prx_completion() {
local words=("${COMP_WORDS[@]}")
local cword=$COMP_CWORD
local cur="${words[cword]}"
# Get project list
local projects=$(prx list --format=names 2>/dev/null)
COMPREPLY=($(compgen -W "$projects" -- "$cur"))
}
complete -F _prx_completion prx
Bash
Add to ~/.bashrc:
_prx_completion() {
local cur="${COMP_WORDS[COMP_CWORD]}"
local projects=$(prx list --format=names 2>/dev/null)
COMPREPLY=($(compgen -W "$projects" -- "$cur"))
}
complete -F _prx_completion prx
Example Workflow
With shell integration:
# Quick navigation
prxcd 1
# Run in background
prxbg 1 dev
prxbg 2 start
# Check what's running
prx ps
# Quick list
pl
# Quick scan
ps
Advanced Integration
Project Switcher
prxswitch() {
local project=$(prx list | fzf | awk '{print $1}')
if [ -n "$project" ]; then
eval "$(prx cd $project)"
fi
}
Requires fzf for fuzzy finding.
Quick Runner
prxrun() {
local project="$1"
shift
prx "$project" "$@" -M
}
Usage:
prxrun 1 dev
prxrun 2 build
Related Documentation
- CLI Shell Integration - Detailed integration guide
- Basic Workflow - Getting started