Version control for your AI prompts. Like git, but for the prompts you use with AI coding assistants.
npm install -g promptlog# Copy a prompt to your clipboard, then save it
promptlog save code-review --note "initial version"
# List all saved prompts
promptlog list
# View prompt history
promptlog history code-review
# Show a specific version
promptlog show code-review@1
# Compare versions
promptlog diff code-review
# Copy a prompt back to clipboard
promptlog show code-review --copySave clipboard contents as a new prompt version.
promptlog save code-review # Save with confirmation
promptlog save code-review --note "v2 notes" # Add a note
promptlog save code-review --yes # Skip confirmationFlags:
-n, --note <note>- Add a note describing this version-y, --yes- Skip confirmation prompt
List all saved prompts.
promptlog listNAME VERSIONS LAST UPDATED
code-review 3 2 hours ago
sql-generator 7 Dec 4
commit-msg 2 Nov 28, 2024
Show version history for a prompt.
promptlog history code-reviewv3 2 hours ago "added naming convention rules"
v2 3 days ago "stricter about error handling"
v1 Dec 4 (no note)
Display a prompt. Use @N for a specific version.
promptlog show code-review # Latest version
promptlog show code-review@2 # Specific version
promptlog show code-review -c # Copy to clipboardShow diff between versions.
promptlog diff code-review # Latest vs previous
promptlog diff code-review 2 # v2 vs latest
promptlog diff code-review 1 3 # v1 vs v3Delete a prompt and all its versions.
promptlog delete code-review # With confirmation
promptlog delete code-review --yes # Skip confirmationA backup is automatically created before deletion at ~/.promptlog/.backup/.
Export prompt to stdout.
promptlog export code-review # Plain text
promptlog export code-review@2 # Specific version
promptlog export code-review --json # JSON formatRename a prompt.
promptlog rename code-review strict-reviewerPrompts are stored at ~/.promptlog/prompts/ as JSON files:
~/.promptlog/
├── config.json # Settings (optional)
├── prompts/
│ ├── code-review.json
│ └── sql-generator.json
└── .backup/ # Backups before deletion
Edit ~/.promptlog/config.json (created automatically):
{
"preview_length": 200,
"auto_confirm": false,
"backup_enabled": true
}- Sensitive content detection: Warns if clipboard contains API keys, tokens, or private keys
- Local only: No network requests, all data stays on your machine
- Restrictive permissions: Files created with
0600(owner read/write only)
Prompt names must:
- Start with a lowercase letter
- Contain only
a-z,0-9,- - Be 1-50 characters
MIT
