Usage Reference
Basic Commands
Write clipboard to file (creates backup if exists):
pt myfile.txt
Write with comment:
pt myfile.txt -m "Fixed bug in authentication logic"
Write with check mode (skip if unchanged):
pt myfile.txt -c
Combine check mode with comment:
pt myfile.txt -c -m "Updated configuration"
Append clipboard to file (no backup):
pt + myfile.txt
Append with comment:
pt + myfile.txt -m "Added new log entry"
List all backups with sizes, timestamps, and comments:
pt -l myfile.txt
Restore backup (interactive selection):
pt -r myfile.txt
Restore with comment:
pt -r myfile.txt -m "Rolled back to stable version"
Restore last backup directly:
pt -r myfile.txt --last
Restore last backup with comment:
pt -r myfile.txt --last -m "Emergency rollback"
Show help:
pt --help
Show version:
pt --version
Git-Like Workflow Commands
Check file status (like git status):
pt check
Check single file status:
pt check myfile.txt
Commit all changes (backup all modified files):
pt commit -m "Your commit message"
Advanced Commands
Recursive file search:
pt config.json # Searches up to 10 levels deep
pt -l utils.go # List backups (searches recursively)
pt -r main.py # Restore (searches recursively)
Diff operations:
pt -d myfile.txt # Interactive: choose which backup to compare
pt -d myfile.txt --last # Quick: compare with most recent backup
pt --diff script.py # Alternative syntax
pt -d <file> -z # Diff clipboard with file (no backup)
Directory tree:
pt -t # Show tree of current directory
pt -t /path/to/dir # Show tree of specific directory
pt -t -e node_modules,.git # Tree with exceptions (exclude folders)
Safe delete:
pt -rm old_file.txt # Backup, delete, create empty placeholder
pt -rm old_file.txt -m "Deprecated old implementation"
Configuration:
pt config init # Creates pt.yml in current directory
pt config init ~/.pt.yml # Create in custom location
pt config show # Show current configuration
pt config path # Show config file location
View clipboard content:
pt -z # Show clipboard in less
pt -z --lexer python # Show with syntax highlighting
Command Reference Table
Command |
Description |
Example |
|---|---|---|
|
Save clipboard to file |
|
|
Save with comment |
|
|
Save only if changed |
|
|
Append to file |
|
|
List backups |
|
|
Restore backup |
|
|
Diff with backup |
|
|
Show directory tree |
|
|
Safe delete file |
|
|
Show all file statuses |
|
|
Backup all changes |
|
|
Show configuration |
|
|
View clipboard |
|