{"slug": "show-hn-promptctl-git-for-your-ai-prompts", "title": "Show HN: Promptctl – Git for your AI prompts", "summary": "Promptctl, a new open-source tool from Naya AI, brings Git-like version control to AI prompts, enabling developers to track, diff, and rollback prompt changes. The tool addresses the common problem of prompts being scattered across files, documents, and chats, making it difficult to debug performance regressions. Written in Go, it stores prompt history locally and supports commands such as commit, log, diff, show, rollback, and search.", "body_md": "Git for your AI prompts.\n\nTrack, version, diff, and rollback your LLM prompts — just like you version your code.\n\n``` bash\n$ promptctl commit system --file prompts/system.txt -m \"initial\"\n✓ Committed prompt \"system\" as v1\n\n$ promptctl commit system --file prompts/system.txt -m \"added citation rule\"\n✓ Committed prompt \"system\" as v2\n\n$ promptctl diff system\n--- system v1 (2026-06-01 09:12)\n+++ system v2 (2026-06-03 14:47)\n\n- You are a helpful assistant.\n+ You are a helpful assistant. Always cite your sources.\n\n$ promptctl rollback system 1 -m \"reverting — citation hurt recall\"\n✓ Rolled back \"system\" to v1 → saved as v3\n```\n\nYour prompts live in random places — hardcoded in files, buried in Notion docs, copy-pasted in Slack. When something breaks or stops working well, you have no idea:\n\n- What the prompt looked like last week when it\n*was*working - What changed between versions\n- Which version performed best\n- How to get back to a specific point\n\npromptctl solves this. It's `git`\n\nfor prompts.\n\nRequires [Go 1.22+](https://go.dev/dl/).\n\n```\ngo install github.com/naya-ai/promptctl/cmd/promptctl@latest\n```\n\nOr build from source:\n\n```\ngit clone https://github.com/naya-ai/promptctl.git\ncd promptctl\nmake build    # binary at bin/promptctl\n# or: go build -o bin/promptctl ./cmd/promptctl/\n# 1. Initialize in your project (creates .promptctl/store.json)\npromptctl init\n\n# 2. Save your first prompt version\necho \"You are a helpful assistant.\" | promptctl commit system -m \"initial\"\n\n# 3. Make a change and save it\necho \"You are a helpful assistant. Always cite sources.\" | promptctl commit system -m \"added citation rule\" --model claude-3\n\n# 4. See the history\npromptctl log system --preview\n\n# 5. Compare latest vs. previous\npromptctl diff system\n\n# 6. Roll back\npromptctl rollback system 1 -m \"reverting\"\n```\n\nInitialize promptctl in the current directory. Creates `.promptctl/store.json`\n\n.\n\n```\npromptctl init\n```\n\nSave a new version of a prompt.\n\n```\n# From stdin\necho \"You are a helpful assistant.\" | promptctl commit system -m \"initial\"\n\n# From a file (recommended for longer prompts)\npromptctl commit system --file prompts/system.txt -m \"from file\"\n\n# With metadata\npromptctl commit classifier -m \"optimized for speed\" --model gpt-4o-mini --tag prod\n\n# Interactive — type END on its own line to finish\npromptctl commit system -m \"manual entry\"\n```\n\nFlags:\n\n`-m`\n\n/`--message`\n\n— commit message (default:`\"add version N\"`\n\n)`--model`\n\n— tag with the model this prompt targets`--tag`\n\n— add a label to this version`-f`\n\n/`--file`\n\n— read content from a file instead of stdin\n\nShow version history.\n\n```\npromptctl log                          # all prompts\npromptctl log system                   # one prompt\npromptctl log system --preview         # show content snippets\npromptctl log system --tag prod        # filter by tag\npromptctl log system --json            # machine-readable output\n```\n\nCompare versions side by side with color highlighting.\n\n```\npromptctl diff system            # latest vs. previous\npromptctl diff system 2          # v2 vs. latest\npromptctl diff system 1 3        # v1 vs. v3\n```\n\nShow a prompt version.\n\n```\npromptctl show system            # latest version\npromptctl show system 2          # specific version\npromptctl show system --raw      # content only (good for piping)\npromptctl show system --json     # full JSON\npromptctl show system --copy     # copy to clipboard (macOS/Linux)\npromptctl show system --version-at 2026-06-01   # version that was latest on that date\n```\n\nRestore a previous version. Creates a new version (non-destructive).\n\n```\npromptctl rollback system 1\npromptctl rollback system 1 -m \"reverting — citation hurt recall\"\n```\n\nList all tracked prompts.\n\n```\npromptctl list\npromptctl list --json       # JSON array with version counts\npromptctl list --names      # one name per line (used by shell completions)\n```\n\nSearch across content, commit messages, and tags.\n\n```\npromptctl search \"helpful assistant\"\npromptctl search prod              # matches tag \"prod\"\n```\n\nExport all versions of a prompt to Markdown.\n\n```\npromptctl export system\npromptctl export system > system-history.md\n```\n\nFork a prompt with its full version history under a new name.\n\n```\npromptctl copy system system-experimental\n```\n\nRename a prompt. All history moves with it.\n\n```\npromptctl rename system assistant\n```\n\nDelete a prompt and all its versions.\n\n```\npromptctl delete system\n```\n\nAuto-commit a file whenever it changes on disk. Great for editing prompts in your usual editor and automatically versioning every save.\n\n```\npromptctl watch prompts/system.txt --as system\npromptctl watch prompts/system.txt --as system --model claude-3 --interval 2\n```\n\nFlags:\n\n`--as <name>`\n\n— the prompt name to commit under (required)`--model`\n\n— tag new versions with this model`--interval <seconds>`\n\n— polling interval (default: 1)\n\nCommit timestamps match the file's modification time, not when promptctl ran.\n\nKeep only the N most recent versions and discard the rest.\n\n```\npromptctl prune system --keep 10\n```\n\nShow a store-wide overview.\n\n```\npromptctl stats\nStats:\n──────────────────────────────────────────────────\n  Prompts:         4\n  Total versions:  23\n  Total content:   8432 chars\n  First commit:    2026-06-01 09:12:00\n  Last commit:     2026-06-24 15:30:44\n  Most iterated:   system (12 versions)\n```\n\nPrint a shell completion script.\n\n```\n# Bash — add to ~/.bashrc\nsource <(promptctl completion bash)\n\n# Zsh — add to ~/.zshrc\nsource <(promptctl completion zsh)\n\n# Fish — save to completions directory\npromptctl completion fish > ~/.config/fish/completions/promptctl.fish\n```\n\nCompletions dynamically suggest prompt names for commands that take a `<name>`\n\nargument.\n\npromptctl stores everything in `.promptctl/store.json`\n\n— similar to how `.git/`\n\nworks. The store is discovered from your current directory or any parent, so commands work from any subdirectory.\n\n```\nyour-project/\n├── .promptctl/\n│   └── store.json     ← all prompt versions live here\n├── src/\n└── ...\n```\n\nAdd `.promptctl/`\n\nto your project's `.gitignore`\n\nto keep prompt history local. If your team wants to share versions in git, track only the store file:\n\n```\n.promptctl/*\n!.promptctl/store.json\n```\n\nSeveral commands support `--json`\n\nor `--raw`\n\nfor scripting:\n\n```\n# Read the latest version of a prompt\npromptctl show system --raw\n\n# Pipe the latest content into another tool\npromptctl show system --raw | pbcopy\n\n# List prompts as JSON\npromptctl list --json\n\n# Ingest output from a script\n./generate-prompt.sh | promptctl commit system -m \"generated\"\n# Tag a version for filtering\npromptctl commit system -m \"production\" --tag prod --model claude-opus-4-8\n\n# View only tagged versions\npromptctl log system --tag prod\n\n# Find all prompts referencing a tag\npromptctl search prod\n```\n\npromptctl uses only Go's standard library — no external packages, no version conflicts, no `go mod tidy`\n\nsurprises. One binary, no runtime.\n\n- Remote sync (S3, GitHub Gist)\n- Side-by-side terminal diff view\n- VS Code extension\n\nSee [CONTRIBUTING.md](/naya-ai/promptctl/blob/main/CONTRIBUTING.md). PRs welcome — open an issue first for major changes.\n\n```\ngit clone https://github.com/naya-ai/promptctl.git\ncd promptctl\nmake test\nmake build\n```\n\nMIT © [Shawnaya Williams](https://shawnayawilliams.com)", "url": "https://wpnews.pro/news/show-hn-promptctl-git-for-your-ai-prompts", "canonical_source": "https://github.com/naya-ai/promptctl", "published_at": "2026-06-25 01:09:05+00:00", "updated_at": "2026-06-25 01:14:04.624444+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models", "ai-products"], "entities": ["Promptctl", "Naya AI", "Go", "Git", "Claude-3", "GPT-4o-mini"], "alternates": {"html": "https://wpnews.pro/news/show-hn-promptctl-git-for-your-ai-prompts", "markdown": "https://wpnews.pro/news/show-hn-promptctl-git-for-your-ai-prompts.md", "text": "https://wpnews.pro/news/show-hn-promptctl-git-for-your-ai-prompts.txt", "jsonld": "https://wpnews.pro/news/show-hn-promptctl-git-for-your-ai-prompts.jsonld"}}