The promptc command turns natural-language requests into structured prompts, plans, and exportable artifacts. Install from PyPI (pip install prcompiler or pipx install prcompiler), or run from a dev checkout with python -m cli.main (examples below use promptc; substitute python -m cli.main when working from source).
promptc --help
promptc --versionPrint the installed package version.
promptc versionCompile prompt text into structured IR and rendered prompts (offline heuristics by default).
promptc compile "write a haiku about the sea" --quietCompile a prompt offline and write executable Markdown plus structured JSON to a directory.
promptc compile-export "build a login flow for a FastAPI app" --out-dir ./exportsBatch-compile every .txt file in a directory to JSON, Markdown, or YAML outputs.
promptc batch ./prompts --out-dir ./compiled --format jsonValidate one or more IR JSON files against the Prompt Compiler schema.
promptc validate compiled/output.jsonSuggest or apply automatic fixes for prompt validation issues.
promptc fix "teach me gradient descent" --diffCompare two prompts side by side and show IR differences.
promptc compare "summarize this article" "write a one-paragraph summary of this article" --label-a Draft --label-b RevisionExport a single-file prompt pack (System / User / Plan / Expanded) for copy-paste.
promptc pack "debug flaky CI tests in a Python monorepo" --format md --out review-pack.mdRead a value from a JSON file using dot-path syntax (supports list indexes).
promptc json-path compiled/output.json metadata.domainCompare two JSON files with a unified diff (useful in CI or review workflows).
promptc diff before.json after.json --sort-keysAnalyze a pull request for merge safety using offline heuristics (no GitHub API).
promptc pr-safety --title "Add auth middleware" --description "Adds session validation." app/auth.py tests/test_auth.pyLightweight on-machine retrieval over your own files.
| Subcommand | Description |
|---|---|
index |
Index files or folders into the local RAG database |
query |
Search the index (FTS, embeddings, or hybrid) |
pack |
Pack top matching chunks into a context window |
stats |
Show index statistics |
prune |
Remove stale or orphaned index entries |
promptc rag index ./docs --ext .md
promptc rag query "how does conservative mode work" --k 3
promptc rag pack "deployment runbook" --max-chars 2000
promptc rag stats --json
promptc rag prune| Subcommand | Description |
|---|---|
list |
List available built-in and user templates |
show |
Show full details for a template ID |
promptc template list --tag code
promptc template show code-review| Subcommand | Description |
|---|---|
record |
Record a prompt compilation in the analytics database |
summary |
Summarize metrics for a time window |
trends |
Show score trends over time |
domains |
Break down usage by domain |
list |
List recent prompt records |
stats |
Show overall database statistics |
clean |
Delete analytics records older than N days |
promptc analytics record prompts/onboarding.txt --task-type teaching
promptc analytics summary --days 7
promptc analytics trends --days 30 --json
promptc analytics domains --persona teacher
promptc analytics list --limit 5 --min-score 70
promptc analytics stats
promptc analytics clean --days 90 --force| Subcommand | Description |
|---|---|
list |
List recent prompt history entries |
search |
Full-text search across history |
show |
Show one history entry by ID |
stats |
Show history database statistics |
promptc history list --limit 10
promptc history search "gradient descent"
promptc history show abc123
promptc history stats| Subcommand | Description |
|---|---|
run |
Run a YAML test suite against a prompt |
promptc test run tests/fixtures/demo_suite.yaml| Subcommand | Description |
|---|---|
run |
Optimize a prompt using test feedback (mock provider by default) |
resume |
Resume a previous optimization run |
history list |
List past optimization runs |
history show |
Show details for one run |
promptc optimize run prompts/draft.txt tests/fixtures/demo_suite.yaml --provider mock --generations 2
promptc optimize resume run-abc --suite tests/fixtures/demo_suite.yaml
promptc optimize history list --limit 5
promptc optimize history show run-abc| Subcommand | Description |
|---|---|
render |
Render GitHub-friendly Markdown from natural-language intent |
Artifact types: issue-brief, implementation-checklist, pr-review-brief.
promptc github render --type pr-review-brief --from-file .github/PULL_REQUEST_TEMPLATE.md| Subcommand | Description |
|---|---|
list |
List installed Prompt Compiler plugins |
promptc plugins list --jsonProfiles are shared with the desktop UI (conservative mode, API base URL, etc.).
| Subcommand | Description |
|---|---|
list |
List saved profiles |
show |
Print a profile payload as JSON |
save |
Save a new profile (snapshots current UI settings by default) |
activate |
Set the active profile for the UI |
clear |
Clear the active profile |
delete |
Delete a profile by name |
rename |
Rename a profile |
export |
Export a profile to a portable JSON file |
import |
Import a profile from JSON |
promptc profile list
promptc profile show work
promptc profile save work
promptc profile activate work
promptc profile clear
promptc profile delete old-draft
promptc profile rename work work-laptop
promptc profile export work --output work-profile.json
promptc profile import work-profile.json