Basic Usage Guide
Overview
This guide covers the essential operations you’ll perform with pathmaster, including PATH management, validation, and backup handling.
Managing PATH Entries
Adding Directories
# Single directory
pathmaster add ~/bin
# Multiple directories
pathmaster add ~/bin ~/scripts /usr/local/bin
Key points:
Directories are validated before adding
Duplicates are automatically prevented
Paths are normalized and expanded
Shell config is automatically updated
Removing Directories
# Single directory
pathmaster delete ~/old/bin
# Multiple directories
pathmaster delete ~/old/bin ~/deprecated/scripts
Key points:
Safe removal with automatic backups
Shell config is updated
Current session PATH is updated
Non-existent paths are ignored
Viewing PATH
pathmaster list
Output shows:
Current PATH entries
One entry per line
Full expanded paths
Invalid paths marked
Path Validation
Checking Paths
pathmaster check
Validates:
Directory existence
Read permissions
Path syntax
Duplicate entries
Cleaning Invalid Paths
pathmaster flush
Process:
Creates backup
Checks all PATH entries
Removes invalid entries
Updates shell config
Shows removal summary
Backup Management
Configuring Backups
# Default mode (both PATH and shell)
pathmaster --backup-mode default
# PATH-only backups
pathmaster --backup-mode path
# Shell-only backups
pathmaster --backup-mode shell
# Toggle between modes
pathmaster --backup-mode switch
Managing Backups
# View backup history
pathmaster history
# Restore latest backup
pathmaster restore
# Restore specific backup
pathmaster restore --timestamp 20240301120000
Best Practices
Regular Maintenance
Check PATH regularly:
pathmaster check
Clean invalid entries:
pathmaster flush
Verify changes:
pathmaster list
Safe Changes
Configure backup mode:
pathmaster --backup-mode default
Make changes
Verify results
Keep backup history
Troubleshooting
Check command output
Review error messages
Use backup history
Restore if needed
Next Steps
Explore advanced features
Review command documentation
Check backup history
Set up regular maintenance