Skip to content
anandrajaram21Public

Repository files navigation

wpf

wpf

Fast local WordPress sites from the command line.
Native PHP & MySQL/MariaDB with automatic trusted HTTPS — zero containers, built for humans and AI agents.

macOS and Linux Static Go binary MCP server with 34 tools

getting started · commands · for AI agents · configuration · architecture · troubleshooting


$ wpf create shop
✓ shop ready in 1.2s

shop  ● running
────────────────────────────────
URL        https://shop.local
Admin      https://shop.local/wp-admin/
Path       ~/code/shop
Web root   ~/code/shop/app/public
WordPress  6.8.1
PHP        8.4.23
Database   mysql 8.4.13 · 127.0.0.1:10000 · local (root/root)
Mail       https://mailpit.local
Logs       ~/code/shop/logs

Log in  admin / password  ·  wpf login shop

Install

wpf is a single static binary. Install it with Go 1.27+ on any supported platform:

go install github.com/anandrajaram21/wp-fast/cmd/wpf@latest

This puts wpf in $(go env GOPATH)/bin (usually ~/go/bin); add that directory to your PATH if it isn't already.

Other install methods (Nix, from source)
# Nix
nix profile install github:anandrajaram21/wp-fast

# From source (Go 1.27+)
git clone https://github.com/anandrajaram21/wp-fast.git
cd wp-fast
CGO_ENABLED=0 go build -trimpath -o bin/wpf ./cmd/wpf   # → bin/wpf
sudo install -m 755 bin/wpf /usr/local/bin/wpf          # optional: put it on your PATH

Supported on macOS (Apple Silicon & Intel) and Linux (x86_64 & arm64). PHP, MySQL/MariaDB, Mailpit and WP-CLI are downloaded on demand; nothing else needs to be installed.

Quick start

wpf setup                    # one-time: trusted HTTPS + hosts helper (asks for password once)
wpf create blog              # ./blog → https://blog.local
cd blog && wpf login --open  # open wp-admin, no password needed

Why it's fast

  • Single static Go binary. wpf list returns in under 10 ms.
  • No containers, no nginx/Apache. One lightweight daemon routes HTTP/1.1 & HTTP/2 straight to each site's PHP-FPM over FastCGI and supervises PHP, MySQL/MariaDB, and Mailpit.
  • Copy-on-write everything. WordPress core and a pre-initialized DB template are cloned via APFS clonefile (or reflinks), skipping slow database initialization.
  • Native static runtimes. Static PHP builds (8.1–8.5 with imagick, intl, redis, opcache, …) and official MySQL/MariaDB binaries are downloaded once and shared across sites.

Typical timings on an Apple Silicon Mac (runtimes cached):

Operation Typical time
wpf create (installed & running) ~1.2 s
wpf start / wpf stop ~0.4 s / ~0.5 s
wpf clone (files + DB + URL rewrite) ~1.1 s
Warm front-page load ~25 ms
wpf wp option get blogname ~160 ms

Highlights

  • HTTPS that just works. wpf setup trusts a local CA name-constrained to reserved local TLDs (.local, .test, .localhost, .internal, .example). Every site gets a valid certificate on the fly, including *.domain for subdomain multisite, and PHP trusts the CA for loopback requests. See Getting Started.
  • Sites anywhere. A site is a plain folder with wpf.json, app/public/, conf/, and logs/. Put sites anywhere (wpf create ~/code/x) or adopt an existing repo (wpf init). See Getting Started.
  • Built for AI agents. --json (or WPF_JSON=1) on every command, structured errors with fix hints, wpf schema, read-only SQL by default, one-time wp-admin login links, captured email via Mailpit, per-site AGENTS.md/CLAUDE.md/.mcp.json, and a built-in MCP server (wpf mcp) with 34 tools. See For AI Agents.
  • WordPress VIP mode. wpf create client --vip --vip-repo ~/code/client-repo (or wpf set --vip on) runs VIP's platform mu-plugins, VIP's local wp-config and sunrise, and your VIP repository natively, without Docker. See WordPress VIP.
  • Polished CLI. TTY-aware colors, aligned tables, and status badges for humans; automatically plain when piped or when NO_COLOR is set.

Documentation

Guide What it covers
Getting Started Install, wpf setup, automatic HTTPS & CA trust, site layout, wpf init, uninstall
Commands Full CLI reference — sites, WP-CLI, PHP eval, database, mail, blueprints, daemon
For AI Agents JSON contract, exit codes, wpf schema, Claude Code plugin, and all 34 MCP tools
WordPress VIP VIP mode: platform mu-plugins, VIP wp-config, linking a VIP repo, converting sites, updating the pinned mu-plugins
Configuration Global settings, wpf.json, PHP/MySQL config overrides, system runtimes, WPF_HOME
Architecture Request flow, daemon design, security model, and Go package map
Troubleshooting wpf doctor, port conflicts, Firefox CA trust, Linux ports, macOS MariaDB
AGENTS.md Contributor & coding-agent guide for developing wpf itself

Uninstall

wpf uninstall     # stops sites, removes CA trust, hosts helper, and /etc/hosts entries
rm -rf ~/.wpf     # removes cached runtimes and CA (your site folders stay untouched)

Development

The dev toolchain is pinned in flake.nix. With Nix:

nix develop       # or `direnv allow`
just check        # fmt + lint + unit tests + build
just test-race    # full suite with Go race detector
just test-integration  # end-to-end test with real PHP, MySQL, and HTTPS

Without Nix, install Go 1.27+, just, golangci-lint, gotestsum and goimports (go install golang.org/x/tools/cmd/goimports@latest) with your package manager of choice, then run the same just recipes. just fmt also runs nixfmt; skip it with gofmt -w cmd internal && goimports -w cmd internal if you don't have it.

Releases

Packages

Contributors

Languages