promptdiff
v1.0.1
Published
Compare prompt versions. See what broke your AI. glitch the diff.
Downloads
19
Maintainers
Readme
promptdiff
Compare prompt versions. See what broke your AI.
Documentation · Report Bug · All Tools
Install
npm install -g promptdiffUsage
# compare two prompt files
promptdiff v1.txt v2.txt
# inline diff (shows changes within text)
promptdiff v1.txt v2.txt --format inline
# side by side view
promptdiff v1.txt v2.txt --format side
# compare text directly
promptdiff -t "You are a helpful assistant" "You are a coding expert"
# stats only
promptdiff v1.txt v2.txt --stats
# prompt diff stats:
# before: 15 words, 89 chars
# after: 18 words, 102 chars
# added: 5
# removed: 2
# unchanged: 13
# similarity: 72%Output Formats
Unified (default)
--- prompt-v1.txt
+++ prompt-v2.txt
You are a
- helpful assistant.
+ coding expert.
Be concise
+ and precise.
// 72% similar | +5 -2Inline
You are a [-helpful assistant.][+coding expert.] Be concise[+ and precise.]Side by Side
┌──────────────────────┬──────────────────────┐
│ BEFORE │ AFTER │
├──────────────────────┼──────────────────────┤
│ You are a helpful │ You are a coding │
│ assistant. │ expert. │
│ Be concise. │ Be concise and │
│ │ precise. │
└──────────────────────┴──────────────────────┘Options
| Flag | Description | Default |
|------|-------------|---------|
| -f, --format | Output format: inline, unified, side | unified |
| -t, --text | Compare text strings directly | false |
| -s, --stats | Show statistics only | false |
| --no-color | Disable colored output | false |
| -w, --width | Width for side-by-side view | 40 |
| -o, --output | Save diff to file | - |
Pro Tips
Version control your prompts
# see what changed since last commit
promptdiff <(git show HEAD~1:prompt.txt) prompt.txt
# compare branches
promptdiff <(git show main:prompt.txt) <(git show feature:prompt.txt)Track prompt evolution
# save diffs for documentation
promptdiff v1.txt v2.txt -o changelog/v1-v2.diffMore tools from pnkd.dev
- ctxstuff — pack context for LLMs
- llmcache — cache LLM responses
- tokcount — count tokens for all models
License
MIT © pnkd.dev
pnkd.dev — glitch the system. break the prompt.
