Skip to content
pi-c Artifact [e22b434f53]
Login

Artifact [e22b434f53]

Artifact e22b434f53fe184c06478663a36fa9f9e7917424cbde2365eaf866069c4866de:


Remote control

There are two ways to reach a conversation from another place: ssh (stage 1, below) and a paired phone through a relay (see From a phone, through the relay).

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.

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, even if the pic running it dies before it has stopped. 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.

Both at once: pic attach -i

pic attach -i follows the conversation and acts on each line you type:

It says when each message is sent and delivered. With its input closed it waits for what it sent to be delivered and for a request it started to end, then exits.

Starting a request here is you acting from another terminal, the same as typing pic ask; it is not one conversation waking another, which pic does not do.

From a phone over ssh

pic attach works over ssh, with nothing more to install. In the terminal interface, /remote-control (or /rc) shows how for the conversation you are in; pic remote-control (or pic rc) prints the same in a shell:

To set it up:

  1. On the Mac, turn on Remote Login (System Settings, General, Sharing).
  2. Put the Mac and the phone on one Tailscale network (or any network that can reach the Mac).
  3. Open the address (or run the command) from the phone.

The command names pic by its full path when a login over ssh might not find it on its path.

Watch the run, type a line to steer it, and close the connection when done; the run carries on.

From a phone, through the relay

A phone can also reach pic without ssh or a shared network. The phone opens a web page; pic and the page talk through a relay, which only passes sealed messages along. pic dials out to the relay and never listens on a port. The relay, at https://remote.zeitforge.app (remote.relay changes it), makes mailboxes by invitation: if pic says so, run pic settings remote.invite INVITE with the invitation you were given.

Pairing

Run /rc in the terminal interface, or pic remote pair in a shell. Either shows a QR code and an address, good once and for ten minutes. Scan it with the phone's camera. When the phone answers, pic shows its name and six digits:

Pair Dan's phone? It should show 333 054. [y/N]

The phone shows six digits too. Say y only if they match; the default is no. In /rc, p starts pairing (it asks for the credential store's passphrase first if it is locked) and Esc cancels.

On an iPhone or iPad, open the address in Safari, add the page to the Home Screen, and pair from the Home Screen page. Notifications only reach an installed page, and its storage is separate from Safari's, so a phone paired in Safari would have to pair again.

A relay keeps up to 8 phones for one computer. pic remote devices lists the paired phones with their ids, names, when they were paired and last seen, and says whether pic remote is running (--json for scripts). /rc shows the same, numbered.

Running pic remote

A paired phone reaches pic only while pic remote runs. It stays in the foreground until Ctrl-C, and says goodbye to each phone when stopped. It asks for the credential store's passphrase on the terminal every time it starts, because the keys it needs are sealed with it; with no terminal it exits with a message. One pic remote runs per user: a second says one is running. With no phone paired it says so and waits for one.

What a phone can do

A paired phone can do what you can at the terminal. It can see every conversation of every workspace, and a prompt from it runs the model's tools as you, without any approval step a prompt typed here would not have: it can run shell commands. Pair only a phone you would hand the keyboard to, and unpair it if it is lost. Hooks run as they do locally and see where a prompt came from. A phone cannot sign in or out of a provider, change settings, or pair or unpair devices.

Text is shown when a reply is complete, not as it streams, and there are no notifications, images or other commands yet; they come later.

Unpairing

pic remote unpair ID takes the first four or more hex characters of the id from pic remote devices. It needs no passphrase, and a running pic remote drops that phone within a second. In /rc, press 1 to 8 for the phone, then y. pic remote reset (in /rc, R then y) unpairs every phone and deletes pic's remote keys and the mailbox at the relay.

What the relay can and cannot see

Messages are encrypted between pic and the phone; the relay holds only ciphertext. It does see that a mailbox exists, how many phones it has, when each is connected, from which address, and the size and timing of each message, which shows when a reply is being sent and about how long it is. It does not see which conversation or workspace you use, any command, text or event, or the phone's name. The weak point is the page itself: whoever serves the web page could serve one that leaks what you type into it, which is why the page's host matters more than the relay.

Stopping and crashes

Stopping pic remote, or killing it at any moment, loses nothing that was acknowledged to the phone: a command is saved before it is answered. Start it again and it picks up where it was; that is the whole repair. A request the phone started keeps running.

What it cannot do yet