Skip to main content

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_KEY env var (preferred, uses API directly)
    • claude CLI 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

  1. Your prompt goes to Claude (API or CLI)
  2. Claude generates a single-file Go program
  3. Go compiles it to a static binary (CGO_ENABLED=0 -ldflags "-s -w")
  4. If compilation fails, Claude fixes the errors (up to 5 rounds)
  5. Binary is smoke-tested (-h flag, basic I/O)
  6. 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

promptcompile-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promptcompile-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

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

Hashes for promptcompile-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b396e5f708ae1ccea97bd3aaddd72b35482e2aa472c9e2db73b7f9bd331b42e
MD5 33fcd4ceb7b2db481c2e42db7c68f905
BLAKE2b-256 d73319b72d48395d9cc76461ba101eba9fd8249961f92666f6299a1616434292

See more details on using hashes here.

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

Hashes for promptcompile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31e3d884ff794300485df47529394d9a4b00d591f3fcaa07208cc04dc7e9dd96
MD5 205f38c10286f954b774437b499a60c7
BLAKE2b-256 44fc4c1e09f939aa8f476df37d7994d078827fdf9cf1d8676c6d0103ce52727f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page