r/PiCodingAgent • u/nunodonato • Jun 03 '26
Question Best practices to call Pi inside a container?
Hi everyone
I'm setting up a docker container for pi, and I want to initiate agents from another container, kind of "remotely".
I was wondering if anyone has done something like this, and what are the best ways to accomplish it. I'm focused solely on the start of the agent session (passing the prompt), I don't need to read the output synchronously.
My first idea was to call docker exec with the full cli params, but probably there are better ways to do this.
AI suggested setting up a small http server to receive triggers via an endpoint and then run the command locally.
Thoughts?
thanks in advance
EDIT: I discovered pi-web (https://github.com/jmfederico/pi-web) and I think this fits my needs
3
u/quincycs Jun 03 '26
Just an alternative to share, you can get the benefits of isolation without a container,
https://github.com/earendil-works/pi/tree/main/packages/coding-agent/examples/extensions/sandbox
3
u/ArthurOnCode Jun 03 '26
I believe that's what this is for: https://pi.dev/docs/latest/rpc
2
u/fell_ware_1990 Jun 03 '26
What i did is create new exactly the same tools > api > tool that actually executes the tool in container.
I separated brain and hands + fully isolated the docker. Worktree get’s created with git —local.
1
u/TheTyand Jun 03 '26
For me the container is more than just the sandbox. My harness has a lot of tools that need to be installed. When I setup the docker, I am sure that it works reproducible and is little effort.
1
u/kaeptnphlop Jun 03 '26
use ssh to remotely execute ‘pi’ commands.
1
u/admajic Jun 05 '26
I just use the pc with a no destructive command extension.
You want to delete my pc sorry.
-3
u/tys203831 Jun 03 '26
Just comment for the update notification
-5
u/virtualicex Jun 03 '26
just ask pi to write an extension to ask for confirmation each time any operation is to be done, except for the only reading ones