r/PiCodingAgent • u/Educational-Yak8793 • Sep 26 '26
Resource Meet PiG: The Pi coding harness that is yours but in Go
Reposted from r/PiGCodingAgent, figured if any sub should see this project it's here. I've been building this out at work for work for quite some time and am excited to open and start a community around the project. I truly appreciate any criticisms, suggestions, and especially contributions, thank you to anyone who does check it out I hope you like it as much as I have been :)
---
PiG is a direct port of the amazing Pi agent harness as one Go binary for macOS, Linux and Windows (Windows in preview). Node.js only comes in if you run TypeScript extensions. Pi's extensions run unchanged; write new ones in Go, Rust or Python and /reload them live. It is a direct port of Pi's its agent loop, terminal UI, sessions, providers, and extension system, shipped as one static Go binary with no libc dependency.
Some Go-specific bits that might interest this sub:
- Extensions in Go can be fused into a single binary and talk to the host over in-memory pipes instead of sockets; other languages run as supervised subprocesses over local sockets.
- The TUI renders differentially; width handling was ported from Pi's own algorithm and checked with a differential test against Pi's code over ~1.5M cases: tui/widthx/pi_width_diff_test.go.
- Behavior is checked against Pi in real terminals (tmux-driven scenarios that compare screens).
go installgithub.com/MichaelKinsy/PiG/cmd/pig@latestworks; so do a curl installer andnpm i -gu/pi-in-go/pig(it installs the prebuilt native binary for your platform).
Measured startup is about 21 ms vs about 300 ms median, and about a quarter of the peak memory (method in the blog).
Disclosure: agents wrote much of the port. Tests, side-by-side comparisons against Pi, and a person reading the diff decide what ships.
Repo: https://github.com/MichaelKinsy/PiG
Blog: https://developer.hpe.com/blog/meet-pig-pi-in-go-a-port-that-plans-on-keeping-up/
Upstream Pi: https://github.com/earendil-works/pi
Happy to answer questions about the port, the extension host, or keeping up with upstream. Feedback on this is appreciated and contributions are welcome.
Thank you to r/HPE for covering writing the blog and contributing PiG to Open Source and special thank you to the Pi team of course at https://earendil.com
38
u/Acceptable_Stress154 Sep 26 '26
Hmm used less memory you say..
32
u/saltyourhash Sep 26 '26
Duuuuuude, I almost did this myself. I ended up just using pi with no extensions. But this is awesome. Go is such a better choice from a supply chain security stand point. That was my whole concern!
18
u/Front_Ad6281 Sep 26 '26
9
u/RelationshipLong9092 Sep 26 '26
no pig emoji?? zero stars
6
u/rokrdev Sep 26 '26
Nice work. I tried using it. It is fast.
I tried using few extensions but they don’t seem to work with PiG.
mcp-adapter, pi-web-access, pi-rtk-optimizer
9
u/FBIFreezeNow Sep 26 '26
This is actually pretty cool…
6
u/Careful-Speaker-8225 Sep 26 '26
Cool! How do you plan to keep up with upstream?
3
u/Momsbestboy Sep 26 '26
I will migrate, because I hate JS. I installed hermes because it is Python, but Go also is good.
3
u/StardockEngineer Sep 26 '26
Pi moves super fast. I have my doubts you could keep up.
5
u/FastHotEmu Sep 26 '26
This is great! So much faster and cleaner than all that Typescript/JS garbage that is so commonly accepted nowadays.
2
u/vshturman Sep 26 '26
Nice, thanks for that! Do you plan to add ACP support?
2
u/Necessary-Musician10 Sep 26 '26
I'm a bit rusty but I am loving the interface
2
u/Historical_Public751 Sep 26 '26
Would be nice if it worked.
Reality is that it doesn't
Tried it with stock settings
Coloring is bugged out, stock `read` tool is failing with jsonschema validation
So it's just yet another sloppily coded port from one language to another with no real effort put into the maintenance apart from tons of tokens from the company leeched
2
u/Impossible_Hour5036 Sep 27 '26
I'll file some issues, maybe even PRs. Happy to contribute.
2
u/Human_Parsnip6811 Oct 02 '26
Just out of my own curiosity, why did you go with Go instead of Rust?
3
u/jatapuk Sep 26 '26
Great job, thanks so much!!
A pure
herdrintegration could be nice 😉30
u/JohnnyLovesData Sep 26 '26 •
2
u/identity-morphism Sep 26 '26
cool, but omp is being ported to rust currently so i doubt you'll have a lot of usage
1
u/nxy7 Sep 26 '26
Waiting for oh-my-pig to test it out :P
Seriously though, right now I'm using DSH but this seems cool (DSH is a bit slow).
1
u/LMN_Tee Sep 26 '26
interesting, i will look into the codebase and the blog, nice tool pal!
1
u/fredagainbutagain Sep 26 '26
Bro i’ve made this side project on every major release but never shared it. Yours is great!
1
u/PythonPoet Sep 29 '26
Sounds interesting! I like Go, reduces risk of supplychain attacks.
Beside keeping synced with upstresm, another major concern is all my cool extensions, which I of course could translate into Go 🤓
1
u/Ordinary-Tackle1643 Oct 13 '26
Could someone confirm that piG is not a hog? (memory hog, that is.)
1
u/angsila Sep 26 '26
Why did you pick Go and not Rust?
1
u/McBobrow Sep 26 '26
what is go’s advantage over node/bun runtime with typescript’s (superior) type system when your bottleneck is network IO?
1
u/gbrennon Sep 26 '26
RemindMe! 12 hours
1
u/Impressive_Rip9417 Sep 26 '26
Every time I turn on my Mac and see so many Node processes, it’s really terrible. I think I‘ll try.
1
u/o_sht_hi Sep 26 '26
This looks really cool. Excited to try to out 💖
1
u/Cold_Tree190 Sep 26 '26
Will absolutely check this out—I love Go
1
u/IsmaelTech Sep 28 '26
when rust for less less memory
1
u/Ill_Fisherman8352 Sep 29 '26
I always wondered why there is not a rust or go port yet. now here it is.
0
u/gbrennon Sep 26 '26
a 3 commits repo? wtf....
0
u/Diru14 Sep 26 '26
that's cool, I'm using pi over bun rn for better performance, I think imma try it
0
u/Several_Bumblebee153 Sep 26 '26
Awesome. I was just thinking the other day why isn’t Pi written in Go :)
0
u/sir_bok Sep 26 '26
Developed in HPE? That’s cool…
0
u/[deleted] Sep 26 '26
[deleted] — view deleted comment
1
u/[deleted] Sep 26 '26
[removed] — view removed comment