{"_id":"@bobfromarcher/promptforge","name":"@bobfromarcher/promptforge","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bobfromarcher/promptforge","publishConfig":{"access":"public"},"version":"1.0.0","description":"A compiler for your reusable prompts and text: variables with defaults, file injection, and recursive composition. Render to stdout or the clipboard. Zero dependencies.","bin":{"pf":"bin/promptforge.js","promptforge":"bin/promptforge.js"},"main":"bin/promptforge.js","scripts":{"test":"node test/test.js","start":"node bin/promptforge.js"},"keywords":["prompt","prompts","template","snippets","clipboard","compose","context","productivity","cli","zero-dependency","devtools"],"author":{"name":"bobfromarcher"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bobfromarcher/promptforge.git"},"bugs":{"url":"https://github.com/bobfromarcher/promptforge/issues"},"homepage":"https://github.com/bobfromarcher/promptforge#readme","engines":{"node":">=16"},"gitHead":"090279608c563f1eb6024e51f4e09106859916b3","_id":"@bobfromarcher/promptforge@1.0.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-CTw7+9xSuxMd9lV4vpRv23ybbtC+LIO7FFvjWCMWBw57gZTyZYOqwkpW5ktnuTdfTCwgLO7L+rTuy9TrozBCHA==","shasum":"2a151d3fe2b3258e9052d9d5e4c524842def614a","tarball":"https://registry.npmjs.org/@bobfromarcher/promptforge/-/promptforge-1.0.0.tgz","fileCount":4,"unpackedSize":17951,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICacONmhK7om38sTqpWbrUeswNODTnXZeTRaA95GlCKZAiEAnvQeBZy/o0imvhflb8Tbbze3Vl+V1Krd8ds+ptxEGVs="}]},"_npmUser":{"name":"bobfromarcher","email":"chrisbellth@gmail.com"},"directories":{},"maintainers":[{"name":"bobfromarcher","email":"chrisbellth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promptforge_1.0.0_1781973134713_0.44148688909538625"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-20T16:32:14.501Z","1.0.0":"2026-06-20T16:32:14.877Z","modified":"2026-06-20T16:32:15.085Z"},"maintainers":[{"name":"bobfromarcher","email":"chrisbellth@gmail.com"}],"description":"A compiler for your reusable prompts and text: variables with defaults, file injection, and recursive composition. Render to stdout or the clipboard. Zero dependencies.","homepage":"https://github.com/bobfromarcher/promptforge#readme","keywords":["prompt","prompts","template","snippets","clipboard","compose","context","productivity","cli","zero-dependency","devtools"],"repository":{"type":"git","url":"git+https://github.com/bobfromarcher/promptforge.git"},"author":{"name":"bobfromarcher"},"bugs":{"url":"https://github.com/bobfromarcher/promptforge/issues"},"license":"MIT","readme":"# promptforge\n\n[![npm](https://img.shields.io/npm/v/@bobfromarcher/promptforge?color=cb3837&logo=npm)](https://www.npmjs.com/package/@bobfromarcher/promptforge)\n[![CI](https://github.com/bobfromarcher/promptforge/actions/workflows/ci.yml/badge.svg)](https://github.com/bobfromarcher/promptforge/actions/workflows/ci.yml)\n[![license](https://img.shields.io/npm/l/@bobfromarcher/promptforge?color=blue)](LICENSE)\n[![zero deps](https://img.shields.io/badge/dependencies-0-success)](package.json)\n\nA compiler for the text you reuse. Your prompts and snippets live as plain markdown files. promptforge gives them variables with defaults, file injection, and composition, then renders the finished text to your clipboard. You stop re-typing the same context for every agent or task, and you stop paying tokens to rebuild it. No dependencies, no AI.\n\nIt is closer to a small build system for prompts than a snippet box. One prompt can include another, pull in the contents of a file, and fill in variables at the moment you use it.\n\n<p align=\"center\"><img src=\"demo.svg\" alt=\"promptforge compiling a prompt\" width=\"540\"></p>\n\n## Install\n\n```bash\nnpm install -g @bobfromarcher/promptforge\n# the command is pf (promptforge also works)\n```\n\n## A two-minute tour\n\n```bash\n# create a reusable header, reading the body from stdin\necho \"You are reviewing for {{project|de Montfort LLC}}.\" | pf add preamble\n\n# create a prompt that composes the header and injects a file\npf add code-review --tag dev,review\n# body:\n#   {{include preamble}}\n#\n#   Review this {{lang|JS}} file for bugs and simplifications:\n#\n#   {{file {{path}}}}\n\n# compile it and copy the result to the clipboard\npf use code-review --var path=src/auth.js --var lang=TypeScript\n```\n\nThe clipboard now holds the header, the instruction with `TypeScript` filled in, and the full contents of `src/auth.js`. Paste it wherever you work.\n\n## Template syntax\n\n| Token | Meaning |\n| --- | --- |\n| `{{name}}` | A variable, supplied with `--var name=value` |\n| `{{name\\|default}}` | A variable with a fallback if you do not pass one |\n| `{{include other}}` | Compose another stored prompt, recursively |\n| `{{file ./path}}` | Inject a file's contents. The path may itself use `{{vars}}` |\n| `{{date}}`, `{{date iso}}`, `{{date time}}` | The current date or time |\n\nCycles between includes are detected, and any variable you forget is reported so nothing renders silently wrong.\n\n## Commands\n\n| Command | What it does |\n| --- | --- |\n| `pf ls [--tag t]` | List prompts |\n| `pf find <query>` | Fuzzy search by name, tag and description |\n| `pf show <name>` | Print a prompt with its frontmatter |\n| `pf add <name> [--tag a,b] [--desc \"...\"]` | Create from stdin or `$EDITOR` |\n| `pf edit <name>` | Open in `$EDITOR` |\n| `pf rm <name>` | Delete |\n| `pf vars <name>` | List the variables a prompt needs |\n| `pf use <name> [--var k=v ...] [--print]` | Compile and copy to the clipboard |\n| `pf stats` | Your most-used prompts |\n| `pf where` | Print the store directory |\n\n## Where it lives\n\nPrompts are markdown files in `~/.promptforge` (override with `PROMPTFORGE_DIR`). Because they are plain files, you can keep the directory in a git repo or a synced folder and carry your whole library between machines.\n\nClipboard support uses `clip` on Windows, `pbcopy` on macOS, and `wl-copy`, `xclip` or `xsel` on Linux. With `--print` it writes to stdout instead, so it pipes anywhere.\n\n## Development\n\n```bash\ngit clone https://github.com/bobfromarcher/promptforge\ncd promptforge\nnode test/test.js\n```\n\nThe frontmatter parser, the template engine and the argument parser are all pure functions with the resolvers injected, so the compiler is fully tested without touching the filesystem. CI runs on Node 18, 20 and 22 across Linux, macOS and Windows.\n\n## License\n\nMIT, bobfromarcher.\n","readmeFilename":"README.md","_rev":"1-946a25ac5f3cb78212aac876b87efe44"}