Troubleshooting
This guide helps you resolve common issues with PUPT.
Common Issues
No prompts found
If PUPT can't find any prompts:
Check your configuration
bash# View current configuration cat .pt-config.json
Verify prompt directories exist
bash# Check if prompt directory exists ls -la .prompts/
Ensure proper file permissions
bash# Check file permissions ls -la .prompts/*.md
Run initialization again
bashpt init
Command not found after installation
If the pt
command isn't recognized:
Verify npm global bin directory is in PATH
bash# Check npm bin location npm config get prefix # Add to PATH (example for bash) export PATH="$PATH:$(npm config get prefix)/bin"
Try using npx
bashnpx pt
Reinstall globally
bashnpm uninstall -g pupt npm install -g pupt
File input not working properly
Issues with file selection:
File paths support
~
expansionbash# Works ~/my-file.txt # Also works ./relative/path.txt
Use Tab key for autocompletion
- Press Tab to see available files
- Continue typing to filter results
Check base path configuration
yamlvariables: - name: sourceFile type: file basePath: "./src" # Ensure this exists
History not being saved
If history entries aren't being created:
Check history configuration
json{ "historyDir": "~/.pt/history" }
Verify directory permissions
bash# Check if directory exists and is writable ls -la ~/.pt/history
Check available disk space
bashdf -h
Enable history in configuration
bash# Edit configuration pt init # Select "Yes" for history tracking
Debugging Tips
Enable Debug Logging
Set log level to debug for more information:
{
"logLevel": "debug"
}
Or use environment variable:
PT_LOG_LEVEL=debug pt
Check Configuration Loading
See which configuration files are being loaded:
PT_LOG_LEVEL=trace pt help
Validate Prompt Files
Check if a prompt file is valid:
# Try to parse the frontmatter
head -20 your-prompt.md
# Check for syntax errors
pt run --dry-run
Common Template Errors
Unclosed Handlebars Tags
Invalid Variable Names
Missing Required Fields
variables:
- name: language
type: select
# Missing: choices array
Performance Issues
Slow Prompt Loading
Reduce prompt directories
- Only include necessary directories
- Avoid deep directory hierarchies
Exclude large directories
json{ "promptDirs": ["./prompts"], "exclude": ["node_modules", ".git"] }
Large History Files
Archive old history
bash# Move old entries mv ~/.pt/history/2023-* ~/.pt/history-archive/
Set retention policy
json{ "outputCapture": { "retentionDays": 30 } }
Getting Help
If you're still experiencing issues:
Check existing issues
- Visit GitHub Issues
Create a new issue
- Include PUPT version:
pt --version
- Include configuration (remove sensitive data)
- Include error messages
- Describe steps to reproduce
- Include PUPT version:
Community support
- Join discussions on GitHub
- Share your use cases and get tips
Reporting Bugs
When reporting bugs, please include:
System information
bashpt --version node --version npm --version echo $SHELL
Configuration file (sanitized)
bashcat .pt-config.json | grep -v password
Error output
bashPT_LOG_LEVEL=debug pt [command] 2>&1 | tee error.log
Steps to reproduce
- Exact commands run
- Expected behavior
- Actual behavior