Turn English into executables. Prompt -> Binary. No code.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptcompile-0.1.0.tar.gz.
File metadata
- Download URL: promptcompile-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b396e5f708ae1ccea97bd3aaddd72b35482e2aa472c9e2db73b7f9bd331b42e
|
|
| MD5 |
33fcd4ceb7b2db481c2e42db7c68f905
|
|
| BLAKE2b-256 |
d73319b72d48395d9cc76461ba101eba9fd8249961f92666f6299a1616434292
|
File details
Details for the file promptcompile-0.1.0-py3-none-any.whl.
File metadata
- Download URL: promptcompile-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e3d884ff794300485df47529394d9a4b00d591f3fcaa07208cc04dc7e9dd96
|
|
| MD5 |
205f38c10286f954b774437b499a60c7
|
|
| BLAKE2b-256 |
44fc4c1e09f939aa8f476df37d7994d078827fdf9cf1d8676c6d0103ce52727f
|