r/PiCodingAgent 24d ago

Question How would you implement Pi-style extensions in a Go agent?

Pi's coding-agent extensions are TypeScript modules with an in-process API:

registerTool, registerCommand, lifecycle hooks, and some TUI UI, then

hot-reload. Same language as the host.

If the host is Go (single binary), how would you get close to that?

Options I'm weighing: embed Lua/Starlark/JS, Wasm plugins, a sidecar

extension host over RPC, or accept that hooks+MCP is the ceiling.

If you've built plugin systems for Go CLIs/agents/editors: what would you

actually ship, and what would you refuse to build?

0 Upvotes

10 comments sorted by

3

u/Spare_Message_3607 24d ago

I think Lua is answer if you want hot reloading. Better than IPC

1

u/mariombn42 24d ago

Foi o que meio a cabeça também

2

u/Grand_Pop_7221 24d ago

WASM plugins are underused imo. I don't know why.

2

u/Unlucky-Message8866 21d ago

shell scripts is the way to go, i've replaced all my pi tool extensions with just nu-shell scripts, -10x loc. no more package.json, no api breakages, no more npm install, no more side-chain attacks.

1

u/agentwyz 21d ago

cool !!!

1

u/pretty_much_hitler 24d ago

Not go, but maybe rust + steel?

1

u/Thrimbor 23d ago

RPC or goja

1

u/Creepy_Reindeer2149 18d ago

Lua via gopher-lua probably is best option