A conversation another pic is running can be watched and steered from a second process: another
terminal, a script, an editor, or a phone over ssh. pic attach shows it and pic send messages
it. Neither takes the conversation over: the pic running it keeps running it, and nothing listens
on a port.
Watching: pic attach
pic attach follows the latest conversation of the workspace (--session ID for another; -c
says latest explicitly). It prints what has happened since the start of the conversation's latest
request, then each message, tool call and result as it is saved, and keeps going until stopped.
- The default output is Pi's JSON events, one per line, as
pic --mode jsonprints them, each with theseqof the entry it came from.--from SEQstarts after that entry (0: from the beginning), so a client that reconnects with the lastseqit saw misses nothing and sees nothing twice. --format textprints short lines instead: what you sent, the reply, each tool call and the first line of its result, and how each request ended.--no-followprints what is saved and exits.
Text the model is still streaming is not shown: a reply appears when it is complete.
Steering: pic send
pic send steer TEXT sends a steer to the conversation (--session ID, else the latest):
delivered after the running tool calls finish, as a steer typed into that pic would be. pic send
follow_up TEXT runs after the request ends, and pic send abort cancels it. A whole Pi RPC
command works too: pic send '{"type":"steer","message":"look at the tests"}'.
pic send prints the message's state and its key, and returns as soon as the message is saved;
--wait waits for it to be delivered and prints the response the running pic gave. The pic running
a request in the conversation delivers it within moments, whichever way it was started: the
terminal, pic ask, --mode json or --mode rpc.
- A message is delivered once. Sending the same
--keyand message again (after a lost connection, say) changes nothing; the same key with a different message is refused. - A message to a conversation with nothing running waits until a request runs there. It expires
if it waits too long: 10 minutes for a steer or abort, a day for a follow-up (
--expires SECONDSsets it, up to a week). An abort sent when nothing runs is refused at once. - At most 100 messages (or 64 MB) can wait in a conversation.
Both at once: pic attach -i
pic attach -i follows the conversation and sends each line you type: a steer while a request is
running, a follow-up when none is. /abort aborts the running request. It says when each message
is sent and when it is delivered. With its input closed it waits for what it sent to be delivered,
then exits.
From a phone
pic attach works over ssh, with nothing more to install:
- On the Mac, turn on Remote Login (System Settings, General, Sharing).
- Put the Mac and the phone on one Tailscale network (or any network that can reach the Mac).
- From an ssh app on the phone, in the project's directory:
ssh mac -t 'cd ~/project && pic attach -i -c --format text'
(A login over ssh may not have pic on its path: name it, as ~/.local/bin/pic.)
Watch the run, type a line to steer it, and close the connection when done; the run carries on.
What it cannot do yet
- Start a request: a prompt to an idle conversation waits as a follow-up until a request runs.
- Reach a conversation in another workspace, or on another machine without ssh.
- Show text as it streams.