prompt2bin
Turn English into executables. No code. Just the binary.
$ p2b "a CLI that converts CSV to JSON with column filtering"
prompt2bin
"The AI will just create the binary directly."
Prompt : a CLI that converts CSV to JSON with column filtering
Output : ./csv2json
Target : native/native
■ Generating... done (24.6s, 4981 chars)
■ Compiling... done (0.5s)
■ Smoke testing... PASS
■ Testing... PASS (10.1s)
BUILD COMPLETE
Binary : ./csv2json
Size : 2.0MB
SHA256 : bdf53d481398
Run: ./csv2json -h
$ echo "name,age,city\nalice,30,NYC" | ./csv2json -columns name,city
{"city":"NYC","name":"alice"}
What it does
You describe a tool in plain English. prompt2bin generates a self-contained compiled binary. No source code. No dependencies. No runtime. Just a binary that works.
- Generates Go binaries (static, zero dependencies, 2-5MB)
- Auto-fixes compilation errors (up to 5 attempts)
- Smoke tests every binary before delivery
- Cross-compiles for linux/mac/windows
- Caches binaries by prompt hash (instant on repeat)
Requirements
- Go (1.13+) — for compiling generated code
- One of:
ANTHROPIC_API_KEYenv var (preferred, uses API directly)claudeCLI installed (fallback)
Install
pip install promptcompile
Or from source:
git clone https://github.com/ShipItAndPray/prompt2bin.git
cd prompt2bin
pip install .
Usage
Generate a binary
# Basic usage
p2b "a tool that finds duplicate files by content hash"
# Name the output
p2b "an HTTP static file server" --name serve
# Cross-compile
p2b "a JSON pretty-printer" --name jpp --os linux --arch amd64
# Force regeneration (ignore cache)
p2b "a word counter with JSON output" --force
Manage cache
# List cached binaries
p2b --list
# Clear all cached binaries
p2b --clear-cache
MCP Server
prompt2bin also works as an MCP server, so AI agents can generate binaries on the fly:
{
"mcpServers": {
"prompt2bin": {
"command": "python3",
"args": ["-m", "prompt2bin.mcp_server"]
}
}
}
Tools: generate_binary, list_binaries, run_binary, delete_binary
Examples
Binaries generated during testing:
| Prompt | Binary | Size |
|---|---|---|
| "word counter with --json flag" | jwc |
1.9MB |
| "find duplicate files by content hash" | dedup |
1.8MB |
| "CSV to JSON with column filtering" | csv2json |
2.0MB |
| "regex grep with --count and --invert" | rxgrep |
2.0MB |
| "HTTP static file server with CORS" | serve |
5.8MB |
All generated in 20-90 seconds. All compile. All work.
How it works
- Your prompt goes to Claude (API or CLI)
- Claude generates a single-file Go program
- Go compiles it to a static binary (
CGO_ENABLED=0 -ldflags "-s -w") - If compilation fails, Claude fixes the errors (up to 5 rounds)
- Binary is smoke-tested (
-hflag, basic I/O) - Binary is cached by prompt hash for instant reuse
Why Go?
- Static binaries with zero runtime dependencies
- Cross-compilation built in (
GOOS=linux GOARCH=amd64) - Fast compilation (<1s for most tools)
- Small binaries (2-5MB stripped)
- Rich stdlib (HTTP, JSON, crypto, compression — no third-party imports needed)
License
MIT
Metadata
Release files for promptcompile 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| promptcompile-0.1.0.tar.gz | 13.5 kB | Without provenance | Details for promptcompile-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| promptcompile-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for promptcompile-0.1.0-py3-none-any.whl |
Total release size: 27.1 kB
Release files / promptcompile-0.1.0.tar.gz
| Download URL | promptcompile-0.1.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b396e5f708ae1ccea97bd3aaddd72b35482e2aa472c9e2db73b7f9bd331b42e
|
|
BLAKE2b-256 checksum How to use checksums |
d73319b72d48395d9cc76461ba101eba9fd8249961f92666f6299a1616434292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.10
|
Release files / promptcompile-0.1.0-py3-none-any.whl
| Download URL | promptcompile-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31e3d884ff794300485df47529394d9a4b00d591f3fcaa07208cc04dc7e9dd96
|
|
BLAKE2b-256 checksum How to use checksums |
44fc4c1e09f939aa8f476df37d7994d078827fdf9cf1d8676c6d0103ce52727f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.10
|
Security for promptcompile 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.