Compute digits of pi for deadlyblock.com/pi on every core of your computer. It shares the website's leaderboard.
| System | File |
|---|---|
| Windows | pi-windows-amd64.exe |
| Mac (Apple Silicon) | pi-macos-arm64 |
| Mac (Intel) | pi-macos-amd64 |
| Linux | pi-linux-amd64 |
Other builds are on the releases page.
You need Go 1.21 or newer. Nothing else is required: the program uses only Go's standard library.
go install github.com/DeadlyBLOCK/pi-cli@latest
This puts a binary named pi-cli in Go's bin folder (usually ~/go/bin, or %USERPROFILE%\go\bin on Windows). If your terminal can't find it, add that folder to your PATH, or check where it went with go env GOPATH.
pi-cli selftest
pi-cli
Running the same command again updates you to the newest release.
-
Get the source, either with git:
git clone https://github.com/DeadlyBLOCK/pi-cli.git cd pi-clior by downloading Code → Download ZIP on this page and unzipping it.
-
Build for your own computer:
go build -trimpath -ldflags "-s -w" -o pi .On Windows, use
-o pi.exeinstead. -
Check your build before using it:
./pi selftestOn Windows, run
pi.exe selftest. Every line should sayok. The program also runs these checks each time it starts, and it won't submit anything if they fail.
Go can build for any platform from any platform. On macOS or Linux, set GOOS and GOARCH:
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o pi.exe .
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "-s -w" -o pi-macos-arm64 .
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o pi-linux-amd64 .
or build all six release files into dist/ at once:
sh build-all.sh
On Windows in PowerShell, set the variables first:
$env:GOOS="linux"; $env:GOARCH="amd64"; go build -trimpath -ldflags "-s -w" -o pi-linux-amd64 .
The binary talks to https://deadlyblock.com/pi/ by default. To use it with your own copy of pi.php, either change DefaultServer near the top of main.go before building, or run it once with:
pi -server https://example.com/pi.php
The address you pass is remembered for later runs.
pi compute until ctrl+c
pi login CODE use your website login (your name, then "show my code") so both count as one name
pi name NAME or pick a name for this computer
pi top the leaderboard
pi help everything else
- Mac: first run
chmod +x pi-macos-arm64 && xattr -d com.apple.quarantine pi-macos-arm64, then./pi-macos-arm64. - Windows: SmartScreen may warn about an unknown app. Choose "More info", then "Run anyway".