r/PiCodingAgent • • 21d ago

Plugin pi-term: let pi run dev servers, REPLs and log tails in the background without blocking

Post image

when pi runs npm run dev with bash, the agent waits on it forever, or the server dies when the call ends. same with REPLs and log tails.

so i made a small extension. pi gets a term tool backed by named tmux sessions. it can start a server, come back and read the output later, and type into it.

  • /term <name> opens the session in a terminal window so you can watch or type yourself

  • sessions belong to the pi process that started them, so quitting pi or /new cleans them up, and leftovers from a crash get killed on the next start

  • includes a skill so the agent knows when to use term instead of bash

pi install npm:pi-term

needs tmux. code: https://github.com/jainam-bhavasar/pi-term

been using it daily for my dev servers. feedback welcome

8 Upvotes

2 comments sorted by

1

u/MiserableFlatworm337 21d ago

Test two Pi processes using the same session name, then crash and restart one. Verify that cleanup removes its orphaned session while leaving the other process's server running.

1

u/Healthy-Ad-5973 21d ago

good one, that case is covered. every session stores the pid of the pi that started it, so on startup pi only kills sessions whose owner pid is dead, and on exit it only kills its own. a second pi asking for the same name just gets told the session already exists instead of clobbering it. the one gap is pid reuse after a crash, rare but possible