Documentation
All documents

macOS desktop

The main window, sidebar, terminal dock and settings, plus menu bar controls, the CLI and ~/.brewping.

macOS

What the app looks like

BrewPing on macOS is a single main window: sidebar on the left, conversation in the middle, an optional terminal dock at the bottom, and a settings sheet that opens on top. A menu bar item takes over when the window is closed, keeping the service reachable from your phone.

Main window

The window opens at 1080 x 720 by default with the system title bar. From top to bottom it is: an error banner when something fails, the top bar, the conversation area, and the terminal dock when it is open.

RegionWhat is in it
SidebarBrand row with a live status dot (ONLINE / STARTING… / OFFLINE), New Chat, then the conversation list. Filter by All conversations or By directory, and archived items live in their own section. Settings & pairing sits at the bottom.
Top barSwitch agent, pick model (or Follow agent config), approval mode (safe / ask all / auto), and a terminal toggle for the dock.
ConversationMessages with the agent. The composer reads “Message {agent}, or send from your phone / watch…”; while it is working you see “{agent} is thinking…” and a Stop generating button. With nothing open: “{agent} on standby” and “Type below, or send from iPhone / Apple Watch”.
Terminal dockRaw output of the current agent, titled “{agent} terminal”, with Clear and Collapse. It is off by default.

Settings

Click Settings & pairing in the sidebar, or use the menu bar. The sheet has five sections:

SectionContents
GeneralInterface language, the setup wizard entry, and the trademark notice
This MacDevice name, LAN address, port and service status
Model configModel providers and their credentials
Environment & CLIDetected runtime and CLI agents
PairingPairing code and paired devices

First-run wizard

On first launch a wizard walks through welcome, environment check, Node, agents and models, then finishes. You can choose Skip for now — if you do, a slim banner stays at the top of the conversation area until setup is completed, and you can reopen the wizard from General settings.

The menu bar panel shows a status dot and up to four read-only rows — device name, LAN address, port and service status, where the address and port only appear once the service is up — followed by three buttons:

ItemWhat it does
Show pairing code (显示配对码)Reveals the current code, opens the main window on the Pairing section
Open main windowBrings the main window forward
Quit BrewPingTerminates the app and stops the service

Command line

The brewping binary exposes six subcommands. Anything unrecognised prints usage and exits with code 1.

CommandBehaviourTimeouts
brewping startStarts a PTY session; reuses an existing agent60s overall, 200ms poll, 90s restart request
brewping statusPrints Status / PID / Session / HTTP5s socket timeout
brewping send <text>Sends text into the running session60s Unix socket timeout
brewping stopStops the session and waits for exit30s request timeout, up to 20s waiting for exit
brewping attachAttaches your terminal to the live session10s ack timeout
brewping agentRuns the built-in agent daemon—
bash
# Start a session and check it
brewping start
brewping status          # exit code 0 = running

# Send one task
brewping send "Refactor auth middleware, add rate limiting"

# Attach to the live terminal (Ctrl+D detaches)
brewping attach

# Stop
brewping stop

Terminal attach

  • Attach sends {"cmd":"attach"} over the Unix socket and waits for an ack containing the session id.
  • On attach, the last 131072 bytes of output are replayed so you see the current screen immediately.
  • Output is polled every 20ms, giving byte-for-byte streaming.
  • Press Ctrl+D (byte 0x04) to detach — the session keeps running. "Detached." is printed and the command exits 0.
  • The header line reads: Attached to session <first 8 chars> (Ctrl+D to detach).

Inside ~/.brewping

FileContents
session.jsonSession info: id, pid, agent pid, cwd, status, createdAt, exitCode, httpPort, httpIP
agent.sockUnix socket used by start / send / stop / attach
agent.logAgent stdout and stderr, mode 0644
opencode.logOpenCode output
pairing.jsonPairing token, mode 0600
device.jsonDevice identity
approval.jsonGlobal approval mode
config.jsonDefault agent and model preferences
workdirs.jsonPer-agent working directory preferences
commands/One JSON file per command
conversations/Stored conversations

Service discovery

The Mac advertises itself on the local domain as service type _brewping._tcp. with the default name "BrewPing Agent". The TXT record carries:

KeyValue
version0.1
agentThe currently active agent id
platformmacOS
protocolVersion1
deviceId / deviceNamePresent when available

Terminal rendering

Raw PTY output is fed into a character grid of 40 rows by 120 columns. Control characters and escape sequences are interpreted so that what you see is the terminal screen as it would look in a real terminal, not an append-only log. A session that exits reports exit code 127 when the executable could not be launched.