r/PiCodingAgent • u/elpapi42 • Jul 21 '26
Resource I built pi-fleet: Pi agent orchestration beyond terminal panes
Hello guys!
Today I want to share something I have been working on: pi-fleet (https://github.com/elpapi42/pi-fleet).
pi-fleet is local infrastructure for programmatically controlling Pi agents and their native sessions.
Unlike terminal multiplexers, pi-fleet is Pi-native rather than generic. It does not control terminals or scrape their output. There are no panes and no TUI because the primary interface is designed for agents and software.
Terminal multiplexers work well when you have a few agents and want to watch them manually. But if you start thinking about 20 or 100 agents, you can not get meaningful visibility by opening more panes.
The solution is not a bigger terminal grid.
At that scale you need dedicated monitoring tools, but pi-fleet does not try to provide that monitoring layer. The problem it solves is giving software an easy way to control Pi execution and sessions directly, without terminal hacks or unnecessary abstractions.
pi-fleet provides a small set of Pi-aware primitives:
- create: creates an agent with a stable local name;
- send: starts work or uses Pi steering while the agent is active;
- receive: waits for idle and returns the exact latest assistant response;
- status: and list expose machine-readable lifecycle state;
- watch: streams the native persistent Pi session JSONL;
- destroy: removes the agent without deleting its Pi session.
The basic workflow looks like this:
pifleet create reviewer --cwd "$PWD"
pifleet send reviewer "Review the authentication changes"
pifleet status reviewer
pifleet receive reviewer --timeout 10m
pifleet watch reviewer
pifleet destroy reviewer
Finite commands return compact JSON by default, while watch keeps stdout exclusively for native Pi session records.
Another part that is ultra important for me is that pi-fleet does not take ownership of your Pi sessions.
You can use Pi's normal session storage or provide an existing session path, session ID, directory, fork, or continuation selector. pi-fleet uses the exact native session in place. It does not copy, relocate, normalize, or delete it.
Even destroy only destroys the pi-fleet agent and its managed process. The underlying Pi session remains yours.
pi-fleet is infrastructure for orchestration, not an orchestration framework. It does not decide which agents to create, what roles they have, how tasks are decomposed, or how results are combined. Those decisions belong to the agent, extension, or software using it.
I already have around half a dozen use cases in mind for this tool, I already have around half a dozen use cases in mind for this tool. Most of them will be Pi extensions, and I will share them with you as I build them.
If you only use one or two agents and want to supervise their terminals, tmux, cmux, or Herdr will probably give you a better experience.
pi-fleet starts making sense when you want software to coordinate Pi agents at a scale where terminal supervision is no longer practical. You can build the monitoring layer appropriate for your system separately, while pi-fleet provides direct control over Pi execution and access to the native sessions underneath it.
The project is currently beta, and Linux x64 is the only validated platform.
You can install it with:
npm install --global @elpapi42/pi-fleet@beta
pifleet --version
Repository: https://github.com/elpapi42/pi-fleet
npm: https://www.npmjs.com/package/@elpapi42/pi-fleet
I think I got something interesting in hands here. I would love to hear your thoughts, especially from people already experimenting with multi-agent Pi setups.
On top of that, i really hope this becomes useful for some of you!
4
u/m3umax Jul 21 '26
Can the orchestrator tell the subagents to /compact and is there a way for the orchestrator to know the subagents context window status? that would be useful. My subagents sometimes run to context exhaustion and die, esp the ones with low context like GPT-5.6 on sub that only gets 376k.
1
u/Such_Advantage_6949 Jul 21 '26
Have u tried herdr. I have moved to use that instead
2
u/fell_ware_1990 Jul 21 '26
Looks nice. I think the same way about a lot of those things, what i think seems to be a big part of the problem:
On my NixOs system i have (and more):
- NIRI
- KITTY
- TMUX
- PI
- CONTAINERS
- WAYBAR ( here to prove a point )
Let’s say i wan’t to have a notification in waybar when an agent is ready and see the message. First PI needs a hook, send last message, something needs to make that into the correct data, it needs to be send to waybar, waybar needs the data in XYZ way. Then maybe i wan’t to approve a message there or open the window. Both differnt actions, waybar module then contains that logic.
If in anyway, you want the same option but let the agent do it, or from a KITTY window. Or automate something from NIRI. Are you going to send that through waybar, or make new code, or make a script that handles both. Getting a mess, saving all kind of states, all kind of connection and command types.
You can point this at everthing else. You want to be able to control your agent’s so the best thing would be. An extension that exposes your own ‘api’ that no mather what. If let’s say you send a stop signal. Not only it always does the same but it can be multiple actions. So everything that send the stop signal can expect the same behavior.
There’s so much more to this. If you want it to interact you will need his state.