# Pixling docs
> Get Pixling, put pixel-art residents on your Mac's desktop, make your own, and let your agent speak through one.
**Pixling** gives your agent a face on your Mac's desktop.
Claude Code, Codex, and other agents speak, ask questions, and report progress through a pixel-art resident in front of your windows. With a [coding agent plugin](/docs/plugins/), answers and permission prompts arrive on your desk automatically, and you can write back.
You can also pick residents up, throw them across the screen, and make your own.
## Why Pixling
When an agent works in the background, you only find out that it finished, or stopped to ask a question, by switching back to the terminal. System notifications disappear in seconds, and when several agents are running at once, it is hard to tell who sent what.
| Without Pixling | With Pixling |
| --- | --- |
| Switch back to the terminal to check progress | Each agent gets **its own resident** on your desk |
| System notifications vanish in seconds | Speech bubbles **stay up until you read them** |
| Jump between windows to approve or answer | **Click an answer on the bubble** and the agent continues |
Checking in with your agent becomes a quick glance at the corner of your screen instead of a trip to another window. Development is long hours of text on a screen. Having a resident you made react as your agent works brings life and character to your desk.
## How Pixling is built
> A resident is not an AI. To your agent, Pixling is a thin client between it and you.
Your agent decides what to say and when to ask; Pixling puts it on your desk as is and returns your answer.
```text
You (speech bubbles on your desk)
▲ │ click an answer / write back
│ status, ask ▼
┌────────────────────────┐
│ Pixling │ Local to this Mac (App Sandbox)
└────────────────────────┘
▲ │ replies and permissions
│ Plugin / MCP / CLI
Claude Code, Codex, scripts
```
### Yours to shape
Create residents from words or import your own art, and choose how they move, how they show status, and which agent each one speaks for.
### Built for agents too
An agent can inspect its resident's state and motions, and every message call reports whether the bubble is on screen or queued. Every page in these docs is also served as Markdown and listed in `/docs/llms.txt`.
### Minimal permissions
Pixling runs in the Mac App Store **App Sandbox**. It never asks for Screen Recording or Accessibility, never reads your screen or keys, listens only on this Mac, and opens only files you pick.
### Plugin, MCP, and CLI together
Use a coding agent plugin so answers and permission prompts arrive automatically, or add MCP and CLI calls on the same resident whenever you want custom speech or scripts.
### Three ways to connect
| What you are connecting | Recommended path | What it uses in Pixling |
| --- | --- | --- |
| **Supported coding agent** (Claude Code, Codex, OpenCode, pi, DeepSeek Harness, Antigravity CLI) | **[Plugins](/docs/plugins/)** for automatic replies, permission prompts, wake on reply, and reactions | **CLI connection** and the linked `pixling` command on `PATH` |
| **Any MCP-capable agent** (Claude Code, Codex, Cursor, or custom hosts) | **[MCP](/docs/connect/)** for direct tool calls (custom speech, states, glows, sequences) | **MCP connection** |
| **Shell script or custom watcher** | **[CLI](/docs/connect/agent-setup/#scripts-and-hooks-the-cli)** (`pixling`) for one-shot commands and streaming | **CLI connection** and `pixling` on `PATH` |
> [!NOTE]
> **Why plugin setup asks for the CLI**
> Coding agent plugins talk to Pixling through **CLI connection** and the linked `pixling` binary on your `PATH`. Leave **MCP connection** off unless you also want the agent itself to call Pixling's MCP tools on the same resident.
## What do you want to do?
- [Coding agent plugins](/docs/plugins/): Install the plugin for Claude Code, Codex, OpenCode, pi, DeepSeek Harness, or Antigravity CLI so answers and questions arrive on a resident and your replies go back.
- [Put residents on your desk](/docs/use/): Start with First launch, then move, throw, hide, and configure residents.
- [Make your own resident](/docs/use/create/): Describe a resident in words in Create, or bring in a picture, GIF, or video with Import.
- [Connect an agent over MCP](/docs/connect/): Turn on the MCP connection and let your agent speak in its own words.
- [Build an integration](/docs/reference/): Every MCP tool, CLI command, limit, and refusal in the Reference.
- [Install Pixling](/docs/use/install/): System requirements, getting Pixling from the Mac App Store, and linking the CLI.
## Get Pixling
| Item | Details |
| --- | --- |
| **Download** | Free on the [Mac App Store](https://apps.apple.com/app/id6819527813) |
| **Requirements** | macOS 15 or later on a Mac with Apple silicon |
| **Pricing** | Free for the app, agent connections, and [importing your own art](/docs/use/import/). Only making a resident from words in [Create](/docs/use/create/) uses credits. |
> [!TIP]
> **Start here**
> New to Pixling? [Install the app](/docs/use/install/) first, then walk through [First launch](/docs/use/) or jump straight to [Plugins](/docs/plugins/).
---
# Install Pixling
> System requirements, getting Pixling from the Mac App Store, and choosing how to connect your agent or scripts.
Pixling is a free Mac app distributed on the [Mac App Store](https://apps.apple.com/app/id6819527813).
## Requirements
| Item | Requirement |
| --- | --- |
| **Mac** | Mac with Apple silicon |
| **macOS** | macOS 15 or later |
| **Disk space** | About 70 MB installed |
| **Permissions** | App Sandbox only; never requests Screen Recording, Accessibility, Input Monitoring, Full Disk Access, camera, or location |
| **Price** | Free to download, connect agents, and import your own art. Only making a resident from words in [Create](/docs/use/create/) uses credits |
## Get the app
1. Download Pixling from the [Mac App Store](https://apps.apple.com/app/id6819527813).
2. Open Pixling from `/Applications` or Launchpad.
The first time you open Pixling, **Welcome to Pixling** appears and three residents arrive on your desk. Follow the short tutorial or press **Skip** to go straight to Studio; see [First launch](/docs/use/).
## Choose your setup
Both agent connections start off in Studio. Enable only what matches your goal:
| Goal | What to enable in **Settings** › **Connect** | Next step |
| --- | --- | --- |
| Use Pixling visually on your desk | Nothing needed (keep both off) | [Residents on your desk](/docs/use/desk/) |
| Connect a coding agent with a **plugin** (auto-summon, permission prompts, wake on reply, reactions) | **CLI connection** (and link `pixling` below); add **MCP connection** only if the agent will also call MCP tools | [Plugins](/docs/plugins/) |
| Connect via **MCP** for direct tool calls, or automate with **shell scripts** | **MCP connection** and/or **CLI connection** | [Connect an agent](/docs/connect/) |
Coding agent plugins and MCP work together on the same resident whenever you turn both on.
## Link the CLI
The `pixling` command-line tool is bundled inside `Pixling.app`. Both **coding agent plugins** and shell scripts rely on the linked `pixling` binary on your `PATH`.
1. In Studio, open **Settings** (`⌘,`) › **Connect** and turn on **CLI connection**.
2. Press **Copy** next to the `PATH` link command and run it in Terminal. For an app in `/Applications`:
```sh title="Terminal"
mkdir -p ~/.local/bin && ln -sf '/Applications/Pixling.app/Contents/Helpers/PixlingCLI.app/Contents/MacOS/pixling' ~/.local/bin/pixling
```
3. Check the setup:
```sh title="Terminal"
pixling doctor
```
## Next steps
- [First launch](/docs/use/): Explore the welcome tutorial, Studio, and how your desk fits together.
- [Plugins](/docs/plugins/): Bring your coding agent's answers and permission prompts onto your desk.
---
# First launch
> What happens the first time you open Pixling, how Studio and your desk fit together, and how to quit.
Pixling puts pixel-art residents on your Mac's desktop. They stand in front of your windows, and you can pick them up, throw them, and give them motions. **Studio** is the window where you find, make, and adjust them.
## Getting started
The first time you open Pixling, a small window called **Welcome to Pixling** opens instead of Studio. Three residents (**Moku**, **Piko**, and **Ruru**) appear in a row under it and introduce themselves. A guide angel sits on the window's top edge and explains each step.
1. **Welcome to Pixling**
The residents arrive and introduce themselves. Choose **Desktop companion** for the 4-step default walkthrough, or **With a coding agent** to add step 5.
2. **This is Pixling**
Drag a resident, then throw one by letting go while it moves. Each row shows **Done** when you have done it. Right-click any resident to hide it, put it away, or quit Pixling.
3. **It can do this too**
A resident speaks, the angel paints, and a picture becomes a resident. Click any row to replay its demonstration.
4. **On this Mac**
Choose Studio's look (**Auto**, **Light**, or **Dark**) and whether residents come out at login. While that is on, residents stay on your desk after you quit Studio with `⌘Q`. If you chose **Desktop companion**, press **Open Studio** here, or choose **Connect an agent** › to continue to step 5.
5. **For developers** *(when opted in)*
**CLI connection** starts on and **MCP connection** starts off, since coding agent plugins use only the CLI. Copy the setup command shown above **Copy** and run it once in Terminal, press **Turn on and open Studio**, and then start a new agent session.
macOS asks whether Pixling may send notifications. If you also turn on **MCP connection**, Studio opens directly to **Settings** › **Connect** so you can copy your MCP configuration.
When the tutorial ends, the residents return to their usual size and any you did not move line up at the bottom of the screen. Studio opens on the **Field Guide** on first launch (and on **Desk** on later opens), or directly to **Settings** › **Connect** if you turned on **MCP connection**.
> [!TIP]
> **Skip or replay anytime**
> Press **Skip** or close the window at any step to go straight to Studio; that turns no connection on. If you quit Pixling before the end, the tutorial opens again next time.
>
> To see it again later, choose **Help** › **Show the Tutorial Again**, or press **Show the tutorial again** › at the bottom of **Settings**. It introduces the residents on your desk as they are and does not move them.
## Studio and your desk
Pixling runs as two parts. One stays in the background, showing the residents and keeping them on your desk. [Studio](/docs/use/studio/) is the window with the Dock icon and the menu bar.
```text title="How Pixling's parts fit together"
┌─────────────────── Studio (app window) ───────────────────┐
│ Field Guide (library) ── Put on the desk ──▶ Desk tab │
│ Create / Import / Sets / Settings │
└───────────────────────────────────────┬───────────────────┘
▼ manages
Your desk (residents currently out) on macOS Desktops / Spaces
```
| Action | Studio | Residents on your desk | Open Studio again |
| --- | --- | --- | --- |
| Close Studio's window (`⌘W`) | Closes | **Stay** | Click the Dock icon or press `⌘0` |
| **Quit Pixling** (`⌘Q`, or **Quit Pixling** in the Pixling menu) | Closes | Closes (see note below) | Open Pixling |
| Right-click a resident › **Quit Pixling** | Closes | **Close** | Open Pixling |
> [!NOTE]
> **When Show residents at login is on**
> With **Show residents at login** on in [Settings](/docs/use/settings/), `⌘Q` closes only Studio and the residents stay. To close everything, right-click a resident and choose **Quit Pixling**.
What returns after a restart is in [What stays and what goes](/docs/use/what-stays/#when-pixling-or-your-mac-restarts).
## What stays on your Mac
Your residents, sets, and settings stay on your Mac. **Pixling does not go online when it starts**, with one exception: checking for results still on their way for a resident you left unfinished in [Create](/docs/use/create/).
| Area | Goes online? | Details |
| --- | --- | --- |
| Desk, Studio, and Field Guide | **No** | Everything stays local on your Mac |
| [Importing](/docs/use/import/) a picture | **No** | Pictures, GIFs, and videos never leave your Mac |
| [Connection for agents](/docs/connect/) | **No** | Listens only inside your Mac |
| Keyboard and pointer | **No** | Pixling does not watch your keyboard or follow your pointer around the screen |
| [Create](/docs/use/create/), [Shop](/docs/use/studio/#shop), and **This Mac's wallet** | **Only when opened** | Reads pricing or balance and runs generation or purchases |
**Pixling Help** and the links to the docs, the terms, and the privacy policy open in your browser, as do a link you press in a speech bubble and a web page set as a resident's **Click to open**. **Open App Store** opens the App Store.
Exact network requests and how This Mac's wallet works
- **Unfinished resident at startup**: If you left a resident unfinished in [Create](/docs/use/create/), Pixling asks its server for pending results until they arrive. That sends nothing new: no description, picture, or video.
- **In [Create](/docs/use/create/)**: Opening Create reads only the price guide and your balance. After you agree, each step sends what it needs; see [Before the first message](/docs/use/create/#before-the-first-message).
- **Resuming a draft in Create**: Opening a resident in progress after you agree requests its prices, name ideas (sending its description), and a free check for any unchecked picture or motion with its description. Any motion started before quitting waits until you press it again, so nothing more is uploaded or spent on its own.
- **In the [Shop](/docs/use/studio/#shop) and This Mac's wallet ([Settings](/docs/use/settings/))**: Opening either reads your balance and App Store prices, and sends the server any incomplete App Store purchase so it reaches your balance. The buttons there buy, check, or delete.
- **This Mac's wallet**: The first time one of those places opens, Pixling creates a random key in your Keychain and registers it with Pixling's server (before you agree to anything in Create). Every server request carries this key, the app version, and the App Store environment. There is no account and no login.
## Next steps
- [Residents on your desk](/docs/use/desk/): Move and throw residents, use their menu, hide or put them away, and tune settings.
- [Pixling Studio](/docs/use/studio/): Browse the Field Guide, adjust residents on the Desk shelf, and save Sets.
- [Plugins for coding agents](/docs/plugins/): Have Claude Code, Codex, and other agents report directly on your desk.
- [Create a resident](/docs/use/create/): Describe a resident in words and generate pixel art with motions.
- [What stays and what goes](/docs/use/what-stays/): See what survives hiding, putting away, restarts, and ended sessions.
---
# Residents on your desk
> Move and throw residents, use their menu, hide them or put them away, and set how each one behaves.
Residents stand on your desktop in front of other windows. Only their drawn pixels catch the pointer: clicks on the empty space around them go straight to the window behind.
## Move and throw
Drag a resident to move it; it stays where you let go. While you drag, it snaps to the edges of other residents within 6 points; hold `Option` to place it freely.
Let go while it is still moving and it flies, bounces off the screen edges, and slows down. With **Gravity** set in its settings, it falls to that edge and lands there. A resident does not fly when Reduce motion is on in macOS accessibility settings, or when its **Can be thrown** setting is off.
## The resident's menu
Right-click a resident. The top lines show its name and what it is doing. Then:
| Item | What it does |
| --- | --- |
| **This resident's settings…** | Opens its settings next to it |
| **Position and size…** | Opens a frame to resize, rotate, and flip it. Arrow keys nudge, `Esc` undoes |
| **Past conversation** | Reads earlier bubbles. Appears once it has spoken |
| **Stop** / **Play** | Stops or starts its motion |
| **Order among residents** › | Front, forward, backward, back. The names below reach a resident that is covered |
| **Take to another desktop** | Follows you as you switch desktops (for **This desktop only** residents); click to set down |
| **Duplicate** | Puts a copy next to it |
| **Hide** | Makes it invisible while keeping its place and settings |
| **On this desktop** › | Hides or shows residents only on the current desktop (details below) |
| **Show hidden residents** | Appears while a resident is hidden, by **Hide** or on this desktop, and shows them all again |
| **Put away** | Takes it off the desk and deletes its conversation. It stays in the Field Guide |
| **Quit Pixling** | Closes the residents and Studio |
**On this desktop** has four items:
- **Hide this resident** / **Hide all residents**: hidden only on the desktop you are looking at, until Pixling quits.
- **Show only this resident here** / **Show all residents only here**: sets **This desktop only** and puts them on the desktop you are looking at.
See [Resident settings](#resident-settings) and [Desktops and displays](/docs/use/desktops-and-displays/#on-which-desktops) for how **This desktop only** works with **Take to another desktop**.
## Hide or put away
| Action | On the desk | Conversation | How to bring it back |
| --- | --- | --- | --- |
| **Hide** | Stays on your desk, invisible; keeps its place and settings | Kept | Select it on Studio's [Desk page](/docs/use/studio/#desk) and press **Show**, or choose **Show hidden residents** in another resident's menu |
| **Put away** | Leaves the desk; stays in the Field Guide | **Deleted** | Select it in the [Field Guide](/docs/use/studio/#field-guide) and press **Put on the desk** |
Putting a resident back out from the Field Guide creates a fresh copy in a new spot. See [What stays and what goes](/docs/use/what-stays/) for how settings carry over and what survives a restart.
> [!CAUTION]
> **Putting away an agent's resident**
> **Put away** is one press for every resident. For a resident that belongs to an agent (connected via [Plugins](/docs/plugins/) or [MCP / CLI](/docs/connect/)), the menu item notes that the conversation with it ends too, and the agent can no longer speak through it afterwards.
## Resident settings
**This resident's settings…** opens one sheet with seven sections: **Motion**, **Look**, **Decoration**, **Speech**, **Touch**, **Place**, and **Notes**. Press `Esc` to close it. The same sheet is on Studio's Desk page.
Key settings ([Desktops and displays](/docs/use/desktops-and-displays/) covers **Place** in full):
- **Layering**: **With windows** puts the resident behind the window you are using. **On the wallpaper** puts it under every window and the desktop icons; there it does not speak, ask, or react.
- **Desktop pinning**: **This desktop only** keeps the resident on the desktop where you placed it. With one display, drag it to the left or right edge of the screen to take it to the next desktop. After a restart, it appears on the desktop you are on when Pixling starts.
- **Click-through and fade**: **Clicks pass through** sends clicks on the resident's picture to the window behind (it still pauses while you edit its position). **Fade when near** turns the resident see-through while the pointer is on it, so you can read what is behind; you can still grab it.
- **Conditional rows**: The **Motion** rows other than **Pose** and **Drift** appear while the resident is moving. Rows a resident cannot use (for example **Solid** on large or full-color art) do not appear.
### Pointer reactions
Picking any reaction plays it once so you can preview it.
| Trigger | When it runs |
| --- | --- |
| **On hover** | Once when the pointer rests on the resident |
| **On click** | Once on a plain click |
| **On grab** | When you pick the resident up |
| **On release** | When you drop or throw the resident |
- **Default click (`Automatic`)**: Opens the speech bubble, unless **Click to open** is set (in which case the shortcut opens instead).
- **Speech bubble actions**: Setting **On click** to **Open speech bubble** opens a folded or shrunk bubble; **Open speech bubble and write** also opens the reply box for an agent's resident. Either option keeps **Click to open** shut.
All rows, their choices and where they start
| Row | Section | Choices | Starts at |
| --- | --- | --- | --- |
| **Usual motion** | Motion | **Automatic**, one of its motions, or a saved sequence | Automatic |
| **Rest length** | Motion | Shortest rest (1.0–120.0 s; longest is 3×), or **Always** for no rest. Drag or press the number to type | 2.4–7.2 s |
| **Motion speed** | Motion | 0.25–2.00× of normal. Drag or press the number to type | 1.00× |
| **Frame step** / **Frame offset** | Motion | Frames per cycle (4 up to full count) for a choppier look; offset shifts which frames are picked when thinned | **As drawn** (right end) |
| **Pose** | Motion | **Usual** or one frame, which holds it still | Usual |
| **Drift** | Motion | **None** / **On**. Needs visible **Shadow** and active motion; hidden on still art | None |
| **Color** | Look | Color set, tone, and palette colors | **Original** |
| **Grain** | Look | Cell shape, size, and transparency | Square, 100%, 0% |
| **Solid** | Look | Block, thickness with light and shading, relief, and light color (details in **Solid sub-controls** below) | None |
| **Dots** | Look | Dot count (down to 8 on the long side), color rule, thicken thin lines, and source comparison | The dots it comes with |
| **Shadow** | Decoration | **Visible** / **Hidden**, color (**Picture's colors** or **Own color**), and **Shadow details** | Hidden |
| **Sticker** | Decoration | **None** / **White** / **Clear**, **Sticker color**, **Gloss** (**Still** / **Moving**), and **Sticker details**; off on a 3D block | None |
| **Reflection** | Decoration | **None** / **On**, and **Reflection details** | None |
| **Outline** | Decoration | **Visible** / **Hidden**, color, and width (pixel art only) | Hidden |
| **Speech bubble** › | Speech | Opens the speech paper for this resident | Like the others |
| **When speaking** | Speech | **Automatic**, **None**, a gesture, one of its motions, or a saved sequence without lines | Automatic (Poke) |
| **Name label** / **Name label color** | Speech | When it shows, and speech paper or own color (reset rows listed below) | Hover |
| **On click** / **On hover** | Touch | **Automatic**, **None**, gesture, motion, or saved sequence. **On click** adds **Open speech bubble** and **Open speech bubble and write** | Click: **Open speech bubble** (or **None** with **Click to open**); Hover: **None** |
| **Click to open** | Touch | A web page or an app, or none | None |
| **On grab** / **On release** | Touch | **Automatic**, **None**, a gesture, one of its motions, or a saved sequence | None |
| **Can be thrown** | Touch | On, off | On |
| **Fade when near** | Touch | 0–80% (**None** at 0). Drag or press the number to type | None |
| **Clicks pass through** | Touch | On, off | Off |
| **In front of windows** | Place | **Always in front**, **With windows**, **On the wallpaper** | Always in front |
| **Desktops** | Place | **All desktops**, **This desktop only** | Depends on [how it came out](/docs/use/desktops-and-displays/#on-which-desktops) |
| **Gravity** | Place | **None**, down, left, right, up | None |
| **Menu bar** / **Camera area** | Place | **Keep clear**, **Ignore** | Keep clear |
| **Across displays** | Place | **Show on both**, **Only one** | Show on both |
- **Solid sub-controls**: Block adjusts height, viewpoint, offset, field of view, and depth spacing. Light color offers White, Morning, Sunset, Moon, Pink, or your own, and appears while block or thickness is on.
- **Decoration detail sheets**: **Shadow details** covers opacity, blur, offsets, squash, and length. **Sticker color** uses **Picture's colors** or **Own color**, and **Sticker details** covers margin, thickness, and opacity. **Reflection details** covers opacity, length, and gap.
- **Name label reset rows**: After you drag the name label or folded mark, **Name label position** or **Folded mark position** appears so you can reset either back to **Auto**.
## Speech bubbles
When an agent or script writes to a resident, its words appear in a bubble above it. Bubbles have no close button and do not time out. Scroll the bubbles, or use **Past conversation**, to read earlier ones.
```text title="Speech bubble controls"
┌──────────────────────────┬───┐ ◀── drag frame edges to move or resize
│ Scrollable message cards │ ▾ │ ◀── fold into a compact mark
├──────────────────────────┴───┤
│ [Write] Reply box (Return) │ ◀── type back to an agent-bound resident
└──────────────┬───────────────┘
(o_o)
```
A question stays until you answer it. Press **Write** on the bubbles to type back to an agent. To change how bubbles look, right-click one, or open the resident's settings. To set up an agent, install a [coding agent plugin](/docs/plugins/) or see [Connect an agent](/docs/connect/).
## Next steps
- [Studio and the Field Guide](/docs/use/studio/): Find every resident you have, adjust the ones on your desk, and save sets.
- [Desktops and displays](/docs/use/desktops-and-displays/): Control which Spaces and displays each resident appears on.
---
# Studio and the Field Guide
> Find every resident you have, adjust the ones on your desk, and save arrangements as sets.
Studio is Pixling's window. It opens on **Desk**. Press `⌘0` to bring it back (**Window** › **Show Studio**), and `⌃⌘S` to show or hide the sidebar.
> [!NOTE]
> **Three terms on this page**
> **Your desk** is the residents floating on your Mac screen, Studio's **Desk** tab is the shelf listing placed residents inside this window, and a **macOS desktop** is a Mission Control Space.
## The sidebar
| Place | What it is for |
| --- | --- |
| **Search** (`⌘F`) | Find residents, sets, and Shop items |
| **Field Guide** | Every resident you have welcomed |
| **Desk** | Adjust a resident that is on your desktop |
| **Sets** | Saved arrangements of residents |
| **Create** | [Make a new resident from words](/docs/use/create/) |
| **Import** | [Bring in your own picture](/docs/use/import/) |
| **Shop** | Buy credits for Create |
| **Settings** (`⌘,`) | [App settings](/docs/use/settings/) |
**News**, above Settings, lists what changed after an update and notes from Pixling; a pink dot means something is unread. Entries marked **For you** are about your own balance, such as a refund that was applied; they appear when Studio reads your wallet on opening the **Shop** or **Settings** › **This Mac's wallet**. When Studio comes to the front it asks for new ones, at most every few minutes; turn off **Receive news** in Settings to stop that.
## Field Guide
The **Field Guide** shows every resident you have welcomed, grouped as **On this desk**, **On another desktop**, and **Put away**. Another desktop means another of your Mac's desktops (Spaces), not another Mac. Sort them with the menu above the grid: newest first, oldest first, or by name.
Select a resident and the bar at the bottom offers what fits where it is:
| Where it is | Buttons |
| --- | --- |
| On this desk | **Put away**, **Open** |
| Put away | **Open**, **Put on the desk** |
| On another desktop | **Open** |
In the grid, arrow keys move, `Space` plays the selected motion once, and `Return`, a double-click, or `⌘↓` opens the resident's page. Press `Esc` to go back.
The resident's page has its picture, its motions (click one to play it), and where it is on your desk. From there:
- **Rename**: Next to the name.
- **Download…**: Saves the original picture.
- **One more**: Puts another copy on the desk using the last-changed look and motion settings for this picture, placed by the checkboxes in the bar. Copies are numbered (such as "Name 2") without reusing numbers, so they can skip.
- **Delete from the Field Guide**: At the end of the page, removes a resident you made or imported. It leaves your desk, and saved sets show it as **Unavailable**. This cannot be undone.
> [!NOTE]
> **Copies and Field Guide numbers**
> - **Shared across copies**: Picture, motions, name, and saved sequences.
> - **Per copy**: Place, settings, conversation, and groups, plus a session name for an agent's resident.
> - **Duplicate** on the Desk page copies one resident with its settings and groups; the copy is visible and starts a new conversation.
> - **Field Guide numbers** (such as `No.7`) are never reused. Agents and the CLI use them to name a resident.
## Desk
**Desk** shows the residents on your desktop on a shelf. Select one to see it large, with its buttons and settings beside it. The settings are the same as **This resident's settings…** on the [resident's menu](/docs/use/desk/).
| Button | What it does |
| --- | --- |
| **Stop** / **Play** | Stops or starts this resident's motion |
| **Position and size** | Opens a frame on the desktop to move, resize, and rotate it |
| **Order** › | Front, forward, backward, back |
| **Duplicate** | Puts a copy on the desk |
| **Hide** / **Show** | Hides it or brings a hidden one back |
| **Bring here** | Moves it to the middle of Studio's screen |
| **Move to screen** › | Moves it to another display |
| **Put away** | Takes it off the desk. It stays in the Field Guide |
A hidden resident stays on the shelf, faded, with a closed-eye mark.
**Edit layout** at the top of the window lets you move, resize, and rotate every resident on the desktop at once. Press **Done editing** to finish.
## Sets
A set saves which residents are out, where they stand, and how each is set up.
1. In **Sets**, press **+ Save this desk as a set**.
2. Name it and press **Keep**.
To use a set, select it. The page lists who will come, who will be put away, and who will move. Then press:
- **Use this set** to make your desk match it. Only this desktop changes. **Undo** appears right after.
- **Add to desk** to bring the set's residents without touching the ones already out.
> [!NOTE]
> **Desktop-only residents and agent residents**
> If the set has residents shown on **This desktop only**, they come along as you switch desktops; click one of them to put them all down.
>
> Residents that belong to an agent are never put away or moved by a set.
## Shop
The **Shop** sells credits for [Create](/docs/use/create/). Choose an amount and press the button with its price. The balance is shown in US dollars, whatever currency the App Store charges you in, and it does not expire.
When Apple approves a refund, Pixling updates your balance on the server right away. Studio does not check in the background, so the updated balance appears the next time you open the **Shop**, **Create**, or **Settings** › **This Mac's wallet**. A **For you** entry appears in **News** the next time you open the **Shop** or **Settings** › **This Mac's wallet**, and you do not need to press **Check purchases again**.
## Next steps
- [Create a resident](/docs/use/create/): Describe a resident in words and generate pixel art with motions.
- [Import your own picture](/docs/use/import/): Bring in a local picture, GIF, or video without leaving your Mac.
- [App settings](/docs/use/settings/): Configure login behavior, speech bubbles, agent connections, and your wallet.
- [What stays and what goes](/docs/use/what-stays/): Compare hiding, putting away, restarts, and ended agent sessions.
---
# Create a resident
> Describe a resident in words, draw its picture, give it motions, and put it on your desk.
In **Create**, you describe a resident in a conversation, and Pixling draws a model picture and builds motions from it. Drawing, motions, and chat replies use credits from your balance; drawing and motion buttons show their price before you press them.
**Pipeline:** 1. Describe your idea → 2. Draw the model picture → 3. Generate motions → 4. Name it and put it on your desk.
## Before the first message
The first time you send anything, Pixling shows **Before you start creating**:
| Row | What it covers |
| --- | --- |
| **Generative AI** | AI writes replies and makes pictures and motions; created residents are marked as AI-made in their files. |
| **What is sent** | Your text, attached images and videos, and the pictures and motions made so far. |
| **Sent to** | External AI services in the US and other countries over an encrypted connection through Pixling's server. |
| **Money** | Paid steps and chat replies draw from your balance; drawing and motions show their price before you press. |
External image and motion services include Google, fal, MachGen, Runware, and the companies whose AI models they run (listed in the Privacy Policy). Pixling uses them only to make your resident. Name ideas come from an AI model on Cloudflare, where Pixling's server runs.
Check **I am 18 or older** and **I agree to sending this outside my country**, then press **Agree and start** (it stays disabled until both are checked). If you cancel, nothing is sent and your draft stays. Pixling asks again only if its terms or privacy policy change what is sent, where it goes, or how it is used.
Until you agree, nothing you write leaves your Mac. Opening Create only reads the price guide and your balance.
> [!NOTE]
> **What is sent on later steps**
> After you agree, each step sends what it needs from earlier steps: the conversation so far, the pictures made, and the language Pixling is in. Opening Create with a resident in progress also asks for its prices and name ideas, which sends its description to Pixling's server.
>
> Videos added with **Copy a video I have** are sent when you press to make that motion. Before storing or sending a video, Pixling strips its sound and file metadata about where, when, and on what it was taken. The frames themselves are sent as-is, including anything a camera burned into them.
## Four steps from idea to desk
The strip at the top of the window shows three tabs — **Draw**, **Motion**, and **Welcome** — marking finished tabs with a ✓. Steps 1 and 2 (describing the idea and drawing the model picture) both happen inside **Draw**, before you move to **Motion** (step 3) and **Welcome** (step 4). **Start a new one** on the right asks before clearing the draft.
1. **Describe it** *(in Draw)*
The first screen asks **Say who you want to meet, in one line**. Pick a style under **What style?**, then type an idea, such as "a sleepy white fox".
The left column holds the conversation while the right column previews the resident taking shape. Pixling replies with questions and 2 to 4 choices, plus **Your call** and **Write my own**. You never have to answer; you can draw at any point.
To show a visual reference, press **Image**, or paste or drop a picture. Each message takes up to 3 images of up to 32 MB each.
2. **Draw the model picture** *(in Draw)*
Press **Draw the model picture**. The button shows the price and usual wait, such as `About $0.19 · 30 sec`. Drawing takes about 30 seconds.
Each drawing stays listed as **Model picture 1**, **Model picture 2**, and so on. **Redraw** generates another without discarding earlier attempts. When one feels right, press **Use this picture**. Choosing is free and sends nothing.
3. **Give it motions** *(in Motion)*
The first motion is what the resident plays on your desk all the time (**Usual · Always on the desk**). It starts as breathing. Describe it in the conversation and press **Make the motion**: one press generates the video, checks it, cuts the resident out of the background, and finishes it.
Under **How it's made**, pick **Low cost** for a lower price (1 to 6 minutes when busy) or **Quick** for 1 to 2 minutes. Pick a resolution under **Quality**. Each tile shows its price, and your choice is remembered for your next resident. When only one option is offered, these controls stay hidden.
Press **+ Add a motion** to add up to 6 motions per resident. Extra motions play now and then on the desk (**Other · Now and then on the desk**). To base a motion on your own footage, use **Copy a video I have**: 2 to 5 seconds per clip, up to 5 seconds and 12 MB combined (two clips at most).
To rename or remove a motion, open its `…` menu. You cannot remove the first motion or one currently being made.
4. **Welcome it** *(in Welcome)*
Type a name in **Name** and press **Put on the desk** (free). The name and motions are saved, the resident joins the [Field Guide](/docs/use/studio/), and it appears on your desk. If placement fails, the button stays so you can try again.
To add motions later, open the resident's page in the Field Guide and press **+ Add a motion**. When you finish, press **Apply** to update the resident in the Field Guide and on your desk in place without adding a duplicate.
## While you wait
The bottom of the right column shows what is running and how long it has been going, such as `Drawing · 12 sec`. You can close the window or switch screens at any time; unfinished work keeps running and appears when you come back.
While Studio is in front, the guide angel drops to the bottom of the screen and paints at an easel with the elapsed time on a small board, then cheers and flies back to its seat when finished. With Reduce motion on, it stays in its seat.
## Credits
Credits are a prepaid balance bought in the [Shop](/docs/use/studio/#shop). The right column displays **Spent on this one** (chat replies included) and your current **Balance**.
| Action | Cost |
| --- | --- |
| **Draw the model picture**, **Redraw**, **Make the motion** | Runs only after you press a button showing the price. Counted in **Spent on this one**. |
| Chat replies | Charged from your balance with no price on the send button; included in **Spent on this one** and its breakdown. |
| **Use this picture**, **Put on the desk** | Free. |
When your balance is too low, the button reads **Not enough credits** and offers **Add credits**.
> [!TIP]
> **Refusals and dropped connections**
> If Pixling refuses a request before it starts, it tells you **No charge was made.** If a connection drops, Pixling never resends the request on its own; press the button to fetch the reply again, which is free.
## Next steps
- [Import your own picture](/docs/use/import/): Turn a local image, GIF, or video into a resident for free; nothing leaves your Mac.
- [Studio and the Field Guide](/docs/use/studio/): Browse the Field Guide, manage the Desk shelf, save Sets, and top up credits in the Shop.
---
# Import your own picture
> Turn a picture, GIF or video from your Mac into a resident. Nothing leaves your Mac.
In **Import**, any picture, GIF, or video on your Mac can become a resident. Pixling converts everything locally on your Mac, sends nothing over the network, and costs nothing.
1. **Pick a file**
Press **Choose a picture**, drop a file onto the page, or press `⌘V` to paste one.
2. **Review the preview**
Check the name, dot grid, and motions before saving.
3. **Add it to your Field Guide**
Press **Welcome to the Field Guide**.
4. **Place it on your desk**
Press **Put on the desk**.
## What you can bring
Import accepts still pictures (PNG, JPEG, WebP, and other image formats), animated GIF, APNG, and WebP, and common video files. Videos are read frame by frame. Pasting accepts a file copied in Finder or raw image data; web addresses are not fetched.
| Limit | Value | What happens over the limit |
| --- | --- | --- |
| Colors | 255 | Colors are reduced, and the page reports the before-and-after count. |
| Longest side | 1280 dots | The picture is shrunk, and the page reports its original size. |
| One motion | 5 seconds | You choose which 5 seconds to keep. |
| Frames | 132 per resident, across all motions | Frames are thinned evenly. |
| Motions | 8 per resident | **Add a motion** becomes unavailable. |
| File size | 32 MB per picture file or pasted image (not videos) | The picture is refused. |
> [!NOTE]
> **Backgrounds are kept as-is**
> One pixel becomes one dot. Pixling does not remove backgrounds during import, so an image without transparency comes in as a rectangle.
## Check before you welcome it
While Pixling reads your file, it shows **Reading** with progress; **Cancel** discards it. Once loaded, you see a large preview alongside these controls:
- **Name**: The resident's name.
- **Dots**: Shown only when the image looks like enlarged pixel art. **By grid** folds it back to its original pixel grid; **As is** keeps one pixel as one dot.
- **Motion**: Lists each motion's name, duration, and frame count, starting with **Usual** (the motion the desk plays all the time). Select an animated row to pick a span of up to 5 seconds on a 12-frame strip; **Remove** appears when there is more than one row.
- **Add a motion**: Pick another file for the same resident. Dropping or pasting a file while editing does the same.
- **What will happen to this picture**: Summarizes every conversion adjustment: shrinking, color reduction, or frame thinning. Check it before welcoming the resident.
Press **Use another picture** to start over. If saving fails, Pixling explains why and changes the button to **Save again**.
## After you welcome it
The page confirms **Welcomed into the Field Guide** with the resident's number and name. Import does not place the resident on your desk automatically. Choose what to do next:
- **Put on the desk**
- **View in the Field Guide**
- **Import another**
> [!TIP]
> **Importing from an agent**
> Agents can import pictures too using `pixling_import_prepare` and `pixling_import_adopt`. See the [import reference](/docs/reference/import/).
## Next steps
- [Create a resident](/docs/use/create/): Describe a new resident in words and generate its artwork and motions.
- [Import reference](/docs/reference/import/): Use pixling_import_prepare and pixling_import_adopt from an agent or script.
---
# Settings
> Every row in Studio's settings, what it does and where it starts.
Open **Settings** with `⌘,` or from the bottom of Studio's sidebar. Every change takes effect once saved; if saving fails, the previous value returns.
## General
| Row | Choices | Starts at |
| --- | --- | --- |
| **Show residents at login** | On, off | Off |
| **Show menu bar icon** | On, off | On |
| **Language** | **Open System Settings** | macOS setting |
| **Receive news** | On, off | On |
- **Show residents at login**: Brings your residents out when you log in, without opening Studio. When on, `⌘Q` closes Studio while leaving residents on the desk; press `⌥⌘Q` to quit Pixling completely. If macOS asks for approval, press **Open System Settings** and allow Pixling there.
- **Show menu bar icon**: Shows a Pixling icon in the top-right macOS menu bar for opening Studio, hiding or showing all residents, pausing all motion, editing layout, switching sets, or quitting Pixling.
- **Language**: Opens macOS **System Settings › General › Language & Region**, where you can choose Pixling's language per app.
## Residents
| Row | Choices | Starts at |
| --- | --- | --- |
| **Animate residents** | On, off | On |
| **Motion playback** | **Smooth**, **Energy saver** | Smooth |
| **Press and hold to move** | On, off | Off |
- **Animate residents**: Turns idle motion on or off for every resident on the desk at once.
- **Motion playback (Energy saver)**: Rests longer between motions and uses fewer frames, saving power and memory. To pause a single resident instead, use **Stop** on the [Desk page](/docs/use/studio/#desk).
- **Press and hold to move**: Press and hold a resident before dragging to move it; letting go opens its position and size frame.
## Speech bubbles
| Row | Choices | Starts at |
| --- | --- | --- |
| **Fold again after answering** | On, off | On |
| **Avoid overlapping bubbles** | On, off | On |
| **Shrink after** | A slider from 1 to 60 min, or **Never** | 5 min |
| **Speech bubble look** | **Customize…** | Quiet sheet |
- **Fold again after answering**: A folded conversation window that opened for a question folds back into its mark about 1.5 seconds after you answer the last waiting question. A window you opened yourself, or one you started writing in, stays open.
- **Avoid overlapping bubbles**: Places nearby residents' speech bubbles clear of each other and their bodies.
- **Shrink after**: How long a speech bubble waits while quiet before shrinking into its folded mark.
- **Speech bubble look**: Opens the speech bubble paper for all residents so you can customize the default kit, colors, material, and font directly in Studio.
## Notifications
| Row | Choices | Starts at |
| --- | --- | --- |
| **Show notifications** | On, off | On |
| **Questions** | On, off | On |
| **Messages and letters** | On, off | On |
| **Play a sound** | On, off | On |
| **Questions** | On, off | On |
| **Messages and letters** | On, off | On |
- **Parent switches**: A child kind counts only while the switch above it is on; while that switch is off, the child row cannot be pressed and keeps its saved value.
- **When banners appear**: A question always brings a notification. A message or letter brings one only for a resident you cannot see; while it is in view, only the sound plays.
- **Per-resident overrides**: Switches here apply globally, and anything off here stays off for every resident. To silence one resident alone, right-click its conversation window (or open its settings on the [Desk page](/docs/use/studio/#desk)), select its name at the top of the speech bubble paper, and adjust **When something arrives**.
- **System permission and agents**: If macOS has not been asked yet, **Allow** (or turning a notification on) asks it; if macOS blocks notifications, **Open System Settings** takes you there. An agent can leave a single message or question out, but cannot turn on what you turned off.
## Display
| Row | Choices | Starts at |
| --- | --- | --- |
| **Appearance** | **Auto**, **Light**, **Dark** | Auto |
| **Text size** | A slider from 100% to 130%; press the number to type one | 100% |
**Appearance** applies to Studio and to the settings paper on the desk (**Auto** follows your Mac). Speech bubbles and the desk's other windows keep their own colors. **Text size** applies to Studio's own text.
> [!TIP]
> **Changing speech bubble text size**
> **Text size** does not affect speech bubbles. Open **Speech bubbles › Speech bubble look › Customize…** (or a resident's speech bubble settings) to adjust the **Letter size** slider (9–28pt).
## Connect
For people who use agents or scripts. Both **CLI connection** and **MCP connection** start off. With both off, Pixling listens for no agents. Connections work only inside your Mac.
Connect is arranged in three parts in priority order:
1. **Agent connection (Claude Code plugin)**: Turn on **CLI connection**, copy and run **① Add the Pixling marketplace** and **② Install the plugin** in Terminal, then start a new session. For other coding agent plugins, see [Plugins](/docs/plugins/).
2. **MCP registration**: Turn on **MCP connection**. The **Claude Code setup** and **Codex setup** commands stay visible right below **MCP connection** (enabled once MCP is ready). When MCP is on, **MCP details** (collapsed by default) holds:
- **Protect MCP connection**: Starts off and requires a Bearer token when enabled.
- **Actions given over MCP**: Five optional tool groups, each on by default: **Motion tools**, **Placement**, **Groups and relations**, **Notes and import**, and **App settings**. Speaking and asking are always given; turning a group off removes it for agents the next time they list tools (the CLI keeps every tool — see [Core and groups](/docs/reference/mcp-tools/#core-and-groups)).
3. **Use pixling from Terminal (Link into PATH)** (collapsed at the bottom): Optional commands for calling `pixling` directly from Terminal or when Pixling is outside Applications — **Link into PATH**, **Where the pixling command is**, and **Check the connection** (`pixling capabilities --json`).
## Data and wallet
- **This Mac's wallet** (when a device wallet is configured): Holds your credit balance and moves to your other Macs signed in to the same Apple Account when iCloud Keychain is on. **Check purchases again** adds App Store purchases missing from your balance without buying anything; refunds approved by Apple apply automatically on the server and appear the next time you open the **Shop** or this section.
- **Data folder**: Opens the local folder where Pixling stores residents, sets, and settings in Finder.
- **Reset app settings**: Returns menu bar icon, news, resident, speech bubble, notification, and display preferences to their defaults. Your residents, sets, wallet, connections, login item, and macOS language stay.
> [!CAUTION]
> **Deleting your wallet cannot be undone**
> **Delete this wallet** makes the balance unusable on every Mac and cannot be undone. Your residents stay. It also deletes from Pixling's server what you sent in Create and what was made there; records of purchases, refunds, and amounts spent remain.
## Agents and these settings
With [`settings.get` and `settings.set`](/docs/reference/settings/), agents can read and change the rows under General, Residents, Speech bubbles, Notifications, and Display, along with the look of all speech bubbles and where new residents' speech windows start.
- **Requires Studio open**: Reading or changing **Show residents at login**, and reading the wallet balance, only work while Pixling Studio is open; with Studio closed, an agent is told to open it.
- **Read-only security boundaries**: The connections, **Protect MCP connection**, and the MCP tool groups are read-only so an agent never opens or widens its own access. Setup rows (where `pixling` is, the `PATH` link, and Claude Code and Codex setup) and wallet purchases stay yours.
- **Limiting MCP settings changes**: Turn **App settings** off under **Actions given over MCP** to keep MCP agents from changing settings or quitting Pixling (the CLI keeps it). Per-resident appearance and behavior remain accessible through [`resident.set`](/docs/reference/resident-settings/).
Every row, and what an agent can do with it
| Row | Section | From an agent |
| --- | --- | --- |
| `Show residents at login` | `General` | `settings.set` (`loginItem`, while Pixling Studio is running; macOS may ask the person to approve) |
| `Show menu bar icon` | `General` | `settings.set` (`menuBarIcon`) |
| `Language` | `General` | People only: macOS manages per-app language in System Settings |
| `Receive news` | `General` | People only: Pixling Studio's own setting; a person changes it |
| `Animate residents` | `Residents` | `settings.set` (`motionEnabled`) |
| `Motion playback` | `Residents` | `settings.set` (`motionPlayback`) |
| `Press and hold to move` | `Residents` | `settings.set` (`longPressToMove`) |
| `Fold again after answering` | `Speech bubbles` | `settings.set` (`refoldAfterAnswer`) |
| `Avoid overlapping bubbles` | `Speech bubbles` | `settings.set` (`avoid`) |
| `Shrink after` | `Speech bubbles` | `settings.set` (`speech.shrink`) |
| `Speech bubble look` | `Speech bubbles` | `settings.set` (`speech`) |
| `Show notifications` | `Notifications` | `settings.set` (`notify`) |
| `Questions` | `Notifications` | `settings.set` (`notifyQuestion`) |
| `Messages and letters` | `Notifications` | `settings.set` (`notifyMessage`) |
| `Play a sound` | `Notifications` | `settings.set` (`sound`) |
| `Questions` | `Notifications` | `settings.set` (`soundQuestion`) |
| `Messages and letters` | `Notifications` | `settings.set` (`soundMessage`) |
| `Appearance` | `Display` | `settings.set` (`appearance`) |
| `Text size` | `Display` | `settings.set` (`textScale`) |
| `CLI connection` | `Connect` | `settings.get` (read only; a person changes it) |
| `① Add the Pixling marketplace` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `② Install the plugin` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `MCP connection` | `Connect` | `settings.get` (read only; a person changes it) |
| `Claude Code setup` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `Codex setup` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `Protect MCP connection` | `Connect` | `settings.get` (read only; a person changes it) |
| `Actions given over MCP` | `Connect` | `settings.get` (read only; a person changes it) |
| `Motion tools` | `Connect` | `settings.get` (read only; a person changes it) |
| `Placement` | `Connect` | `settings.get` (read only; a person changes it) |
| `Groups and relations` | `Connect` | `settings.get` (read only; a person changes it) |
| `Notes and import` | `Connect` | `settings.get` (read only; a person changes it) |
| `App settings` | `Connect` | `settings.get` (read only; a person changes it) |
| `Link into PATH` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `Where the pixling command is` | `Connect` | People only: setup the person copies into their own Terminal or agent |
| `Check the connection` | `Connect` | `capabilities.get` (the same check; it changes nothing) |
| `This Mac's wallet` | `Data and wallet` | `settings.get` (`readOnly.wallet`: the balance only, while Pixling Studio is running; purchases stay with the person) |
| `Data folder` | `Data and wallet` | People only: opens the local data folder in Finder |
| `Reset app settings` | `Data and wallet` | `settings.set` (pass `null` for each key you want back at its default) |
## Next steps
- [Plugins](/docs/plugins/): Install a coding agent plugin for Claude Code, Codex, OpenCode, pi, DeepSeek Harness, or Antigravity CLI.
- [Connect an agent](/docs/connect/): Turn on MCP or CLI for direct tool calls, custom agents, or scripts.
- [Desktops and displays](/docs/use/desktops-and-displays/): Control layering, per-desktop visibility, and multi-display behavior.
---
# Desktops and displays
> Where a resident appears, in front of or behind your windows, on which desktops, and across displays.
Three settings in **Place** control where a resident lives on your Mac. Each answers one question, and they combine freely.
| Question | Setting | Choices |
| --- | --- | --- |
| In front of or behind your windows? | **In front of windows** | **Always in front**, **With windows**, **On the wallpaper** |
| On which desktops? | **Desktops** | **All desktops**, **This desktop only** |
| What happens between two displays? | **Across displays** | **Show on both**, **Only one** |
A **macOS desktop** is one of the Spaces you switch between in Mission Control (distinct from **your Pixling desk**, which is all residents currently placed on screen). A **display** is a physical screen.
## In front of or behind your windows
```text title="Window layer stack (front to back)"
Always in front ── above every app's windows (below Dock unless overlapping menu bar)
With windows ── interleaved with ordinary app windows
On the wallpaper ── behind every window and desktop icons
Desktop wallpaper ── macOS background image
```
| Choice | Where it stands | Takes clicks | Speaks and asks |
| --- | --- | --- | --- |
| **Always in front** | In front of every app's windows | Yes | Yes |
| **With windows** | Among your windows, like any other window | Yes | Yes, though other windows can cover its bubbles |
| **On the wallpaper** | Behind every window and desktop icon | No | No |
- **Always in front** normally stays below the Dock. When a resident overlaps the menu bar, it stands above both the menu bar and the Dock and takes clicks on that spot.
- **With windows** brings the resident forward when clicked and moves keyboard focus to Pixling. Keys you type do nothing until you click another app.
> [!CAUTION]
> **Recovering a resident on the wallpaper**
> A resident set to **On the wallpaper** cannot be thrown, refuses messages and questions, and can be right-clicked only while you edit its position. To change it back, open Studio's [Desk page](/docs/use/studio/#desk), select the resident, and change **In front of windows** in its settings.
## On which desktops
**All desktops** shows the resident on every desktop at the same position. **This desktop only** keeps it on the desktop where it stands.
The starting value depends on how the resident came out:
| Came out from | Starts as |
| --- | --- |
| The bar at the bottom of the Field Guide | **This desktop only**, unless you change the checkbox there |
| Create or Import | **All desktops** |
| An agent or the CLI | **This desktop only**, unless it sets another value |
To move a **This desktop only** resident to another desktop, choose **Take to another desktop** from its menu, switch desktops, then click it to set it down. With a single display, you can also drag it to the left or right edge of the screen.
> [!TIP]
> **Keeping residents off full-screen apps**
> A full-screen app is a desktop of its own. **All desktops** residents appear over it and stay in front of it, even with **With windows** and even when you click the app.
>
> Use **This desktop only** to keep a resident out of full-screen apps. It stays on its desktop, and words sent to it wait until you return.
macOS gives apps no way to name a desktop, so Pixling remembers the display instead:
- **After a restart**: A **This desktop only** resident appears on whichever desktop you are viewing when Pixling starts.
- **If you remove a desktop**: macOS moves its windows to another desktop, and the resident goes with them.
## Between two displays
A resident remembers its display and its relative position on that display, so when the resolution changes, it stays in the same relative spot. To move a resident to another display, drag it across or use **Move to screen** on Studio's Desk page.
| Choice | Resident on a screen edge | Throw or fall |
| --- | --- | --- |
| **Show on both** | Each display draws its part | Crosses displays |
| **Only one** | One display draws it | Stays on the display it started from |
Even with **Only one**, you can still drag a resident to another display.
## When you unplug a display
Residents on the unplugged display disappear from view, and nothing about them is lost. Plug the same display back in and they return to the same spot. To bring one back sooner, select it on Studio's Desk page and press **Bring here** to move it to the center of the display Studio is on.
## Sets
A [set](/docs/use/studio/#sets) saves each resident's position relative to the display, not which display or desktop it came from.
- **Use this set** updates the desktop you are viewing on Studio's display. Use **Destination** to pick another display when you have one.
- If the set contains **All desktops** residents, the **All desktops** residents on that display change too, on every desktop.
## Next steps
- [What stays and what goes](/docs/use/what-stays/): See what survives hiding, putting away, macOS restarts, and ended agent sessions.
- [When something looks wrong](/docs/use/troubleshooting/): Find a missing resident, fix full-screen overlap, or unblock clicks.
---
# What stays and what goes
> What you keep when you hide a resident or put it away, what survives a restart, and what happens when an agent's session ends.
**Permanence spectrum:** `Transient` (gone on quit) → `Desk-only` (gone on **Put away**) → `Saved on Mac` (stays in the Field Guide).
Hiding a resident keeps its place, settings, and conversation intact. Putting one away resets it.
> [!CAUTION]
> **Put away deletes the conversation**
> **Put away** is the one action that costs you something: it deletes the resident's conversation. Choose **Hide** instead if you want the resident back as it was.
## Getting a resident out of the way
| Action | Place and settings | Conversation | After a restart | How to bring it back |
| --- | --- | --- | --- | --- |
| **Stop** | Kept | Kept | Still stopped | **Play** |
| **Hide** | Kept | Kept | Still hidden | **Show hidden residents** in another resident's menu, or **Show** on Studio's [Desk page](/docs/use/studio/#desk) |
| **On this desktop** › **Hide this resident** | Kept | Kept | Showing again | **Show hidden residents** on that desktop, or **Show** on the Desk page |
| **Put away** | Look and motion settings kept; place and size lost | Deleted | Still put away | **Put on the desk** in the [Field Guide](/docs/use/studio/#field-guide) |
| **Delete from the Field Guide** | Gone | Gone | Gone | Cannot be undone |
**Show hidden residents** brings back every hidden resident at once on the desktop you are on.
When you bring back a resident you put away, it returns as a new visible copy with clicks enabled. **In front of windows** and **Desktops** come from the checkboxes in the Field Guide's bar.
Its look and motion settings start from the ones last changed for that picture. Changes made to an agent's resident do not carry over.
## When Pixling or your Mac restarts
After you quit Pixling, residents return the next time you open it. After your Mac restarts, they return when you open Pixling, or at login when **Show residents at login** is on.
| Comes back | Does not come back |
| --- | --- |
| Who is on the desk, plus their display, place, size, and order | Which desktop a **This desktop only** resident was on |
| Each resident's settings, including **Hide** and **Stop** | **On this desktop** › **Hide this resident** |
| Messages, letters, and the answers you gave | **Take to another desktop** in progress |
| Questions still waiting for an answer | A state an agent set, and words from a [sequence](/docs/reference/sequences/) |
## When an agent's session ends
A resident is not an AI: it displays what an agent sends and stays quiet when no agent is working. Ending a session does not put its resident away, leaving the timing up to you.
| What happens | The resident | Its conversation | Its tie to the session |
| --- | --- | --- | --- |
| Session ends or crashes | Stays on the desk | Kept | Stays, though nothing is listening |
| `/clear` in Claude Code | Stays, and a new one appears for the new session | Kept | The old resident keeps the old session |
| You hide it | Stays, invisible | Kept | Stays |
| You put it away | Leaves the desk | Deleted | Ends for good |
Once you put away an agent's resident, the agent cannot bring it back, and **Put on the desk** creates a separate copy with no tie to that agent. The agent's next session brings its own resident.
To clean up residents left behind by old sessions, choose **Put away** from each one's menu. Scripts can automate this using the [rule in Report from several agents](/docs/connect/several-agents/#put-away-residents-left-behind).
## Next steps
- [Desktops and displays](/docs/use/desktops-and-displays/): Control layering, per-desktop visibility, multi-display behavior, and Sets.
- [When something looks wrong](/docs/use/troubleshooting/): Diagnose missing, paused, unclickable, or silent residents.
---
# When something looks wrong
> Start from what you see, a missing resident, one that stopped moving or ignores clicks, or an agent's words that never appear.
Start from the symptom you see and jump straight to the fix.
| What you see | Jump to |
| --- | --- |
| A resident disappeared from the desk | [I can't find a resident](#i-cant-find-a-resident) |
| A resident sits on top of a full-screen window | [A resident covers my full-screen app](#a-resident-covers-my-full-screen-app) |
| A resident moved after restarting or returning | [A resident came back in a different place](#a-resident-came-back-in-a-different-place) |
| The desk is empty after rebooting macOS | [No residents appear after restarting my Mac](#no-residents-appear-after-restarting-my-mac) |
| A resident froze or slowed down | [A resident stopped moving](#a-resident-stopped-moving) |
| Clicking or right-clicking does nothing (or opens the wrong thing) | [A resident ignores clicks](#a-resident-ignores-clicks) |
| An agent or plugin is running, but no bubble shows up | [An agent's words don't appear](#an-agents-words-dont-appear) |
## I can't find a resident
Open Studio's [Desk page](/docs/use/studio/#desk). Its shelf lists every resident currently on the desk, one by one.
| What you see on the shelf | What to do |
| --- | --- |
| **Listed, faded** | It is hidden. Select it and press **Show**. |
| **Listed, not faded** | It is on another desktop or display (including an unplugged one). Select it and press **Bring here**. |
| **Not on the shelf** | It is put away. Select it in the [Field Guide](/docs/use/studio/#field-guide) and press **Put on the desk**. |
If **Bring here** does not move the resident, it is already on this desktop behind your windows. Move them aside, or set **In front of windows** to **Always in front**.
> [!NOTE]
> **Desk shelf vs. Field Guide**
> The Field Guide groups a resident's copies together and shows **On this desk** if any one copy is out. Use the Desk page's shelf to find a specific copy.
## A resident covers my full-screen app
An **All desktops** resident stays in front of full-screen apps. Set **Desktops** to **This desktop only** on the desktop where you want it ([more on desktops](/docs/use/desktops-and-displays/#on-which-desktops)).
## A resident came back in a different place
- A **This desktop only** resident appears on whichever desktop you are viewing when Pixling starts ([why](/docs/use/desktops-and-displays/#on-which-desktops)).
- A resident you put away returns in a new spot when you put it back out.
## No residents appear after restarting my Mac
Open Pixling manually, or turn on **Show residents at login** in [Settings](/docs/use/settings/) so your residents return on their own.
## A resident stopped moving
Check these five causes in order:
1. **It is stopped**
If its menu offers **Play**, press **Play**. Residents bound by an agent start stopped unless the agent chooses otherwise.
2. **Pose is locked to one frame**
Check **Pose** in the resident's settings and set it back to **Usual**.
3. **Its picture has only one frame**
A still picture has no motion to play.
4. **Your Mac or display slept or locked**
Motion resumes on its own after waking.
5. **Reduce motion is enabled**
Check macOS accessibility settings for Reduce motion.
> [!TIP]
> **Slower is not stopped**
> **Energy saver** in [Settings](/docs/use/settings/) and Low Power Mode in macOS slow every resident down, and a long **Rest length** adds pauses between motions.
## A resident ignores clicks
- **Clicks pass straight through**: **On the wallpaper** and **Clicks pass through** both let clicks fall behind the resident, and you normally cannot right-click it either. Select the resident on Studio's [Desk page](/docs/use/studio/#desk) and change the setting there.
- **Clicks open something unexpected**: With **On click** set to **Automatic**, clicking opens **Click to open** when configured, or the speech bubble otherwise. Picking **Open speech bubble** for **On click** prioritizes the bubble over **Click to open** whenever it has something to show.
## An agent's words don't appear
Check these six points in order:
1. **Check the connection**
In **Settings** › **Connect**, turn on what your setup uses: **CLI connection** for a [plugin](/docs/plugins/) or script, **MCP connection** for an agent over MCP. Run `pixling doctor` to see what is missing.
2. **Start a new session**
A running session does not pick up a newly added plugin or MCP server. Start a fresh session after changing setup.
3. **Check whether the resident can display words**
Words sent to a hidden resident or one on another desktop wait until it becomes visible (the window keeps the newest 200 messages). A resident **On the wallpaper** refuses them.
4. **Scroll to the bottom of the bubble**
If the conversation window is scrolled up, new words wait below while you read above.
5. **Check if you put the resident away**
Once you put an agent's resident away, the plugin stays quiet for the rest of that session. Start a new session to get a new resident.
6. **Check for one-shot runs**
`claude -p` and similar one-shot runs get no resident by default.
For a plugin, check `~/.cache/pixling-proxy/proxy.log` to see what it did. For your own agent or script, every send returns an `outcome` explaining what happened. See [messages and questions](/docs/reference/messages-and-questions/) and [read refusals](/docs/connect/errors/).
## Next steps
- [Settings](/docs/use/settings/): Review login launch, Energy saver, notifications, and CLI/MCP connections.
- [What stays and what goes](/docs/use/what-stays/): See what survives hiding, putting away, restarts, and ended agent sessions.
---
# Your coding agent on your desk
> Install the plugin for Claude Code, Codex, OpenCode, pi, DeepSeek Harness or Antigravity CLI, and a resident tells you when your agent is done or needs you, and takes your words back to it.
Run a coding agent in Terminal or your editor, and **pixling-proxy** keeps its resident up to date on your desk. Leave the terminal, work in another window, and still see when the agent finishes or waits for you.
## Plugin, skills, or MCP alone
| Approach | Tool access | Behavioral prompts | Automatic hooks (bubbles, wake, reactions) |
| --- | --- | --- | --- |
| **Plugin (`pixling-proxy`)** | Uses the `pixling` CLI beside the agent | None required | Yes: auto-binds a resident, mirrors replies, relays permission prompts, wakes on reply, and runs optional reactions |
| **Agent skills** | Agent calls the `pixling` CLI via shell commands | Yes: teaches when to speak, ask, show states, and share residents | No |
| **MCP alone** | Direct `pixling_*` MCP tool calls | Server defaults plus your instructions | No |
All three combine cleanly on the same resident.
### Updates in a bubble
What the agent writes appears in a bubble above the resident, as it works and when it finishes a turn.
### Permission prompts on your desk
When the agent needs permission to run something, the resident asks. Answer with `Allow` or `Deny`, or type what to do instead. With no answer within a minute, the agent asks in the terminal as usual.
### Reply from the bubble
Press **Write** on the resident's bubbles, type, and press `Return`: your words go to the agent, and it starts working on them even if it was idle.
### One resident per session
Each session brings its own resident, so agents working side by side each report through their own. The agent spends nothing on this and needs no instructions: the plugin works beside it.
```text title="Where bubbles, reactions, and replies appear"
┌─────────────────────────────┐
│ Agent reply / Allow · Deny │ ◀── mirrored updates & permission prompts
│ [Write…] (type + Return) │ ◀── type here to reply and wake the session
└──────────────┬──────────────┘
✨ (o_o) ◀── optional reaction emoji & motion above the resident
```
## Set it up
The plugins require **Node.js 22.19 or later** and talk to Pixling through the linked `pixling` CLI.
1. **Enable CLI connection**
Open **Settings** › **Connect** in Studio and turn on **CLI connection**. Leave **MCP connection** off unless you also want the agent to call MCP tools itself.
- **Claude Code**: Copy and run **① Add the Pixling marketplace** and **② Install the plugin** in Terminal, then skip straight to step 3 (`pixling-proxy` finds `/Applications/Pixling.app` automatically).
- **Pixling outside Applications or calling `pixling` directly**: Open **Use pixling from Terminal (Link into PATH)** at the bottom of **Connect** and run the **Link into PATH** command once.
2. **Install the plugin for your host**
Pick your host below (skip if you already ran ① and ② for Claude Code above):
#### Claude Code
```sh title="Terminal"
claude plugin marketplace add pixling/agent-kit
claude plugin install pixling-proxy@pixling
```
Full steps on the [Claude Code](/docs/plugins/claude-code/) page.
#### Codex
```sh title="Terminal"
codex plugin marketplace add pixling/agent-kit
```
Then install `pixling-proxy` from `/plugins`. Full steps on the [Codex](/docs/plugins/codex/) page.
#### OpenCode
Add `"@pixling/opencode-proxy"` to `opencode.json`:
```json title="opencode.json"
{ "plugin": ["@pixling/opencode-proxy"] }
```
Full steps on the [OpenCode](/docs/plugins/opencode/) page.
#### pi
```sh title="Terminal"
pi install npm:@pixling/pi-proxy
```
Full steps on the [pi](/docs/plugins/pi/) page.
#### DeepSeek Harness
```sh title="Terminal"
dsh plugin --profile web add @pixling/dsh-proxy
```
Full steps on the [DeepSeek Harness](/docs/plugins/dsh/) page.
#### Antigravity CLI
```sh title="Terminal"
agy plugin install agent-kit/plugins/pixling-proxy
```
Full steps on the [Antigravity CLI](/docs/plugins/antigravity/) page.
3. **Start a new session and verify**
Start a new session in your agent and a resident comes out on your desk. Check the setup anytime with `pixling doctor`.
> [!TIP]
> **MCP connection can stay off**
> The plugins use only **CLI connection**. Leave **MCP connection** off unless you also want the agent itself to call Pixling MCP tools on the same resident.
## Agent guides
- [Claude Code](/docs/plugins/claude-code/): One-line install, asyncRewake wakeups, and permission prompts.
- [Codex](/docs/plugins/codex/): Marketplace install, /plugins setup, and codex queue relay.
- [OpenCode](/docs/plugins/opencode/): Add @pixling/opencode-proxy to opencode.json.
- [pi](/docs/plugins/pi/): Install npm:@pixling/pi-proxy and relay from the desk.
- [DeepSeek Harness](/docs/plugins/dsh/): Add @pixling/dsh-proxy for Web and Desktop sessions.
- [Antigravity CLI](/docs/plugins/antigravity/): Install pixling-proxy with agy plugin install.
## How session residents work
- **Bound per session**: Each session binds its own resident as `client:/`, with the namespace `claude-code`, `codex`, `opencode`, `pi`, `dsh`, or `antigravity`. The agent learns the pair at the start of the session, so it can also speak and ask through the same resident ([Give your agent a resident](/docs/connect/own-a-resident/)).
- **Stays when the session ends**: Ending a session does not put its resident away ([What stays and what goes](/docs/use/what-stays/#when-an-agents-session-ends)). Choose **Put away** from the resident's menu when you no longer want it; the plugin then stays quiet for the rest of that session.
- **No clutter from one-shot runs**: One-shot runs (`claude -p`, `codex exec`, `pi -p`, `agy -p`, headless dsh) get no resident, so workers an agent starts do not fill the desk.
## Combine with MCP or skills
The plugin covers the conversation. To have the agent also show states, glow, or share one resident among several agents, connect it over MCP ([Connect an agent](/docs/connect/)) or install the Agent Skills below. The agent then speaks through the same resident the plugin bound.
## Reactions
**pixling-proxy** can also have the resident react to each reply in a way that fits it: cheering when work finishes, drooping on a failure, and tilting its head when the agent asks a question. While the agent works, an emoji pops over the resident for what it is busy with.
Reactions stay off until you add an `emote` object in `~/.config/pixling/proxy.json` (even an empty `{}` if your key is already in `AI_GATEWAY_API_KEY`). Nothing else needs to be installed.
```json title="~/.config/pixling/proxy.json"
{ "emote": { "apiKeyEnv": "AI_GATEWAY_API_KEY" } }
```
> [!NOTE]
> **What leaves your Mac**
> Nothing leaves your Mac until you turn reactions on.
>
> - **What is sent**: Only the agent's reply, with nothing else from the conversation.
> - **Where it goes**: By default, `typesafe-ai/jev` through the Vercel AI Gateway using your own key.
> - **Fallback**: Until enabled, and whenever the judge cannot be reached, the resident moves for the reply like any other message.
A resident whose motion is off still shows its emotes and light, without the turns and shakes.
With a `voice` object and a [Fish Audio](https://fish.audio) key as well, the resident also speaks the parts of each reply worth hearing aloud: a result, a question to you, or what happens next. Only those parts are sent to Fish Audio. See [Voice](https://github.com/pixling/agent-kit/blob/main/plugins/pixling-proxy/README.md#voice) for settings.
All emote options
| Key | Default | Meaning |
| --- | --- | --- |
| `endpoint` | `https://ai-gateway.vercel.sh/v4/ai` | AI Gateway-compatible endpoint (`POST /evaluation-model`); `https:` or `http:` to this Mac only |
| `model` | `typesafe-ai/jev` | Evaluation model |
| `apiKey` | none | API key directly. Prefer `apiKeyEnv` if you share your settings |
| `apiKeyEnv` | `AI_GATEWAY_API_KEY` | Environment variable holding the key when `apiKey` is unset |
| `threshold` | `0.5` | Confidence threshold (`0` to `1`) for triggering a reaction |
## Settings
All settings are optional and live in `~/.config/pixling/proxy.json`. Every key also has an environment variable, such as `PIXLING_PROXY_ASSET=No.1,No.2,No.7` or `PIXLING_PROXY_PERMISSION_WAIT_MS=0`.
```json title="Rotate residents and localize permission prompts"
{
"asset": ["No.1", "No.2", "No.7"],
"permissionWaitMs": 60000,
"language": "ja"
}
```
Set only what you want to change under `show` to control what appears on the resident and how often:
```json title="Show tool calls at most every 10 seconds"
{ "show": { "tools": "all", "everyMs": 10000 } }
```
In a `show.tools` list, `*` matches any characters and `!` hides. **The last match decides**, and a list starting with `!` starts from every tool:
```json title="Filter tools by pattern or exclusion"
{ "show": { "tools": ["Bash", "run_command", "mcp__*", "!mcp__pixling__*"] } }
{ "show": { "tools": ["!Read", "!Grep"] } }
```
- **Host tool names**: Each host names its tools its own way: a shell command is `Bash` on Claude Code and Codex, `run_command` on Antigravity CLI, `shell` on OpenCode, and `bash` on pi and dsh. Unmatched names are ignored, so one list can cover several hosts.
- **Batching with `everyMs`**: Checked when something happens, so nothing shows during one long tool call. The final reply and permission questions never wait.
All settings, show options, host reasoning support, and environment variables
### Top-level keys
| Key | Default | Meaning |
| --- | --- | --- |
| `asset` | `No.1` | New-session resident: `No.N`, exact name, ID, a list, or `random`. A list or `random` picks one Field Guide resident per session |
| `show` | see below | What shows on the resident, and how often |
| `permissionWaitMs` | `60000` | Milliseconds a permission prompt waits on the resident before falling back to the host. `0` turns prompts off |
| `receive` | `true` | Let you type to the resident and relay it to the agent |
| `unattended` | `false` | Also bind a resident in one-shot runs. Shows replies only |
| `language` | from `LANG` | `en`, `ja`, `zh-Hant`, or `ko`, for the permission question |
| `turnEndWaitMs` | `0` | Codex and Antigravity CLI: hold each turn open this long for your answer on the resident |
| `codexQueue` | `true` | Codex: relay what you type with `codex queue`. Off, it arrives with your next prompt |
### Keys under `show`
| Key | Default | Meaning |
| --- | --- | --- |
| `reply` | `true` | Reply at the end of each turn |
| `text` | `true` | What the agent writes between tool calls |
| `reasoning` | `"none"` | `"summary"` shows host reasoning summaries; `"all"` includes full reasoning. Shown as a quote when provided |
| `tools` | `"none"` | `"all"`, or a list of tool names. Only the name shows, never the input |
| `everyMs` | `0` | Minimum gap between updates; intermediate events batch together. Replies and permission prompts never wait |
| `maxChars` | `4000` | Longer text is cut and ends with `…`. The resident takes at most 4000 characters |
### Host support for `reasoning`
| Host | `reasoning` |
| --- | --- |
| Claude Code | `summary`, and rarely. `showThinkingSummaries: true` in its settings gives more |
| Codex | `summary`, with `model_reasoning_summary` set. Often nothing, and a heading at most |
| Antigravity CLI, OpenCode, pi, dsh | `all`, depending on the model |
### Environment variables for `show`
- `PIXLING_PROXY_REPLY`, `PIXLING_PROXY_TEXT`: set to `0` to turn off.
- `PIXLING_PROXY_REASONING`: `none`, `summary`, or `all`.
- `PIXLING_PROXY_TOOLS`: `all`, `none`, or a comma-separated list such as `Bash,Edit`.
- `PIXLING_PROXY_EVERY_MS`: minimum interval in milliseconds.
## Skills
The Agent Skills teach an agent to use the resident on its own: speak, ask, show a state, and share one resident between several agents. They use the CLI, so any agent that runs shell commands can use them:
```sh title="Terminal"
npx skills add pixling/agent-kit
```
## Diagnose
The plugins log what they do (never message text) to `~/.cache/pixling-proxy/proxy.log`. Set `PIXLING_PROXY_DEBUG=0` to turn logging off.
---
# Claude Code
> Install pixling-proxy in Claude Code: what the agent writes shows on the resident as it goes, permission prompts become questions there, and what you write wakes the session.
## Install
```sh
claude plugin marketplace add pixling/agent-kit
claude plugin install pixling-proxy@pixling
npx skills add pixling/agent-kit -a claude-code # optional: the skills
```
Start a new session afterwards; a running one does not load new hooks.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Any time. An `asyncRewake` hook waits for what you type and wakes the session, even when it is idle |
| What the agent writes | As it goes: the text before each tool call (`PreToolUse`, async, read from the transcript), and the reply at the end of the turn (`Stop`). `show` in the settings decides which of it shows. Tool names come from `PreToolUse` |
| Permission prompts | Asked on the resident (`PermissionRequest`). No answer within `permissionWaitMs`: Claude Code asks as usual |
## Limits
- A waiting hook lasts up to 6 hours. After that, what you type reaches the agent
with your next prompt.
- `/clear` starts a new session, so a new resident appears. Put the old one away
from its menu.
- `claude -p` and SDK runs get no resident, so workers an agent starts do not
fill the desk. Set `unattended: true` to bind one anyway (replies show, but
nothing wakes the session).
---
# Codex
> Install pixling-proxy in Codex: replies show on the resident, permission prompts become questions there, and what you write reaches the session through codex queue.
## Install
```sh
codex plugin marketplace add pixling/agent-kit
npx skills add pixling/agent-kit -a codex # optional: the skills
```
Then in Codex, open `/plugins`, install `pixling-proxy`, and approve its hooks
in `/hooks`. Codex asks again whenever the hooks change.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Any time. The proxy queues it into the session with `codex queue`, and an idle TUI session starts a turn for it. Anything still unread goes with your next prompt (`UserPromptSubmit`) |
| What the agent writes | As it goes: the commentary before each tool call (`PreToolUse`, read from the session file in a detached process so Codex does not wait), and the reply at the end of the turn (`Stop`). `show` in the settings decides which of it shows. Tool names come from `PreToolUse` |
| Permission prompts | Asked on the resident (`PermissionRequest`). No answer in time: Codex asks as usual |
`codex exec` runs get no resident (see `unattended`).
## Going further
- `turnEndWaitMs`: after each reply, wait this long for your answer on the
resident and continue the turn with it. Codex looks busy while it waits.
- `codexQueue: false`: stop using `codex queue`; what you type arrives with
your next prompt instead. Hooks alone cannot wake an idle Codex session.
- A session that is not open keeps the queued message until it is opened again.
## Limits
- Lifecycle hooks in plugins cannot be listed in OpenAI's public plugin
directory, so install from this repository's marketplace.
---
# OpenCode
> Add @pixling/opencode-proxy to OpenCode: replies show on the resident, and what you write there reaches the session.
## Install
Add the plugin to `opencode.json` (project) or `~/.config/opencode/opencode.json`:
```json
{ "plugin": ["@pixling/opencode-proxy"] }
```
OpenCode installs it at startup. Skills: `npx skills add pixling/agent-kit -a opencode`.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Any time, even when the session is idle |
| What the agent writes | As it goes: each text as it ends, and the reply when the turn ends (skipped if it just showed). `show` in the settings decides which of it shows, including tool names and reasoning |
| Permission prompts | Asked on the resident while the TUI asks too. The first answer wins, and the other side stops asking |
Only your own conversation gets a resident; subagent sessions do not, including
ones from before the background server restarted.
## Limits
- Experimental. Tried on OpenCode 2.2.5.
- `opencode run` may exit before a short reply reaches the resident. The TUI does not.
- The background server keeps running with no session open, so a session left alone
for 6 hours (`idleCloseMs`) stops listening until its next activity.
- A local copy for testing goes in `.opencode/plugins/` as a file that re-exports
the package.
`opencode` hands the run to its background server, which keeps the plugins it has
loaded and its own environment: restart it (`opencode service`) after changing the
copy, and do not expect variables set on the command to reach the plugin.
---
# pi
> Install @pixling/pi-proxy in pi: replies show on the resident, and what you write there starts a turn.
## Install
```sh
pi install npm:@pixling/pi-proxy
```
Add `-l` to install it for the current project only. To try it for one run:
`pi -e npm:@pixling/pi-proxy`. Skills: `npx skills add pixling/agent-kit -a pi`.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Any time. When pi is idle it starts a turn; while it works, it waits as a follow-up |
| What the agent writes | As it goes: each assistant message as it ends (`message_end`), and the reply once pi has finished everything it will do on its own (`agent_settled`, skipped if it just showed). `show` in the settings decides which of it shows, including tool names (`tool_execution_start`) and reasoning |
| Permission prompts | Not relayed. pi does not ask before running tools |
Only the interactive TUI gets a resident. `pi -p`, `--mode json` and the
subagents pi starts get none. A new session (`/new`, `/resume`) binds its own.
## Limits
- Experimental. Requires Node.js 22.19 or later, like pi itself.
---
# DeepSeek Harness (dsh)
> Add @pixling/dsh-proxy to DeepSeek Harness: replies show on the resident, approvals are asked there, and what you write steers the session.
dsh runs in its Web UI (`dsh web`) or the Desktop app. It has no terminal UI of
its own; a separate TUI plugin exists but is not part of dsh.
## Install
```sh
dsh plugin --profile web add @pixling/dsh-proxy
```
Restart the profile afterwards. To load a local build instead, add a patch with
`dsh --patch --profile web`:
```yaml
- insert:
- id: pixling-proxy
name: /path/to/agent-kit/packages/dsh/dist/index.mjs
```
Skills: copy `skills/` into `.agents/skills` or `$DSH_HOME/skills`.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Any time. It steers the session: an idle one starts a turn, a running one reads it at its next step |
| What the agent writes | As it goes: each assistant message as it ends (`assistant/message`), and the reply when a turn completes (`turn/end`, skipped if it just showed). `show` in the settings decides which of it shows, including tool names (`tool/call`) and reasoning |
| Permission prompts | Asked on the resident while the dsh UI asks too (`approval/request`); the first answer wins and the other is withdrawn |
Each conversation gets its own resident, bound as `client:dsh/`, once
it starts a turn. Subagents get none. Headless, SDK and ACP runs get none either,
since nobody is there to type; with `unattended` they get one that only shows replies.
## Limits
- Experimental. dsh is in developer preview and says its APIs will change.
- dsh does not say when a session ends, so one left alone for 6 hours (`idleCloseMs`)
stops listening until its next turn.
- Tried on dsh 0.2.1-rc with the Web UI: replies show, the resident takes
messages, and permission questions work from either side.
---
# Antigravity CLI
> Install pixling-proxy in the Antigravity CLI: what the agent writes shows on the resident as it goes, and what you write reaches the agent at its next step.
## Install
agy installs plugins from a folder, so clone this repository first:
```sh
git clone https://github.com/pixling/agent-kit
agy plugin install agent-kit/plugins/pixling-proxy
npx skills add pixling/agent-kit -a antigravity # optional: the skills
```
agy copies the plugin to `~/.gemini/config/plugins/pixling-proxy`. To update,
`git pull` and run `agy plugin install` again. Start a new session afterwards.
For the resident to also react to each reply, cheering when the work is done or
tilting its head at a question, turn reactions on in the settings
([reactions](/docs/plugins/#reactions)). There is nothing else to install.
## What works
| What | How |
| --- | --- |
| Your reply to the agent | Before the agent's next step: while it works, at its next model call (`PreInvocation`); when it is idle, with your next prompt |
| What the agent writes | As it goes: the text before each tool call (`PreToolUse`, read from the transcript in a detached process so agy does not wait), and the reply at the end of the turn (`Stop`). `show` in the settings decides which of it shows. Tool names come from `PreToolUse` |
| Permission prompts | Not relayed. agy asks as usual |
`agy -p` runs get no resident (see `unattended`).
## Going further
- `turnEndWaitMs`: after each reply, wait this long for your answer on the
resident and continue the turn with it. agy looks busy while it waits.
## Limits
- Experimental, and for the CLI (`agy`) only. The Antigravity app and IDE are
not supported.
- Hooks alone cannot wake an idle agy session, so what you type while it is
idle waits for your next prompt.
- A resident binds at your first prompt, when agy starts the conversation.
---
# Connect an agent
> Connect Claude Code in five minutes and get the first words onto your desk, then what to know before you rely on it.
Connect an agent over **MCP** so it speaks, asks questions, and shows states in its own words.
> [!TIP]
> **Only want your coding agent's replies on the desk?**
> For automatic replies, permission prompts, wake on reply, and reactions in Claude Code, Codex, OpenCode, pi, DeepSeek Harness, or Antigravity CLI, install its [plugin](/docs/plugins/) instead. Plugins use only **CLI connection**, need no instructions in the agent, and share the same resident if you later add MCP.
## First words in five minutes
Turn on MCP, add Pixling to Claude Code, and ask for a hello. For Codex, other Streamable HTTP clients, bearer token protection, or CLI setup, see [Set up your agent](/docs/connect/agent-setup/).
1. **Turn on MCP connection in Studio**
Open **Settings** › **Connect** in Studio and turn on **MCP connection** (it starts off).
2. **Add Pixling to Claude Code**
Press **Copy** on **Claude Code setup** right below **MCP connection**, and run the copied command in Terminal. Without bearer token protection, it is:
```sh title="Terminal"
claude mcp add --transport http --scope user pixling http://127.0.0.1:48271/mcp
```
3. **Start a new session and ask for a hello**
A session that is already running does not see the new server. Start a new Claude Code session and ask:
```text title="Prompt"
Put a Pixling resident on my desk and say hello through it.
```
A resident appears on your desk and its first words show above it. The agent picks the resident from your Field Guide and binds it with `pixling_resident_ensure`; see [Give your agent a resident](/docs/connect/own-a-resident/).
> [!CAUTION]
> **Nothing appeared?**
> - Confirm **MCP connection** is still turned on in Studio.
> - Confirm your Claude Code session started **after** step 2.
## Plugin, MCP, or CLI
All three work together. When an agent also uses a plugin, it uses the namespace and key the plugin names so both speak through the same resident.
| Goal | Use | Enable in **Settings** › **Connect** |
| --- | --- | --- |
| Mirror replies, permission prompts, wake on reply, and reactions (supported coding agents) | **[Plugins](/docs/plugins/)** *(recommended)* | **CLI connection** (plus `pixling` on `PATH`) |
| Let the agent call Pixling tools directly (custom speech, states, glows, sequences) | **MCP** | **MCP connection** |
| Drive a resident from a shell script, hook, or streaming watcher | **[CLI](/docs/connect/agent-setup/#scripts-and-hooks-the-cli)** (`pixling`) | **CLI connection** (plus `pixling` on `PATH`) |
For scripts and hooks, link the `pixling` binary and run `pixling doctor` to diagnose missing CLI or MCP parts ([Set up your agent](/docs/connect/agent-setup/#scripts-and-hooks-the-cli)).
## Know this first
1. **Your agent speaks only while working.** Pixling cannot start a turn in your agent. Use a [plugin](/docs/plugins/) to mirror replies, show permission prompts, and wake the session when you write to its resident ([Wake your agent](/docs/connect/wake/)).
2. **Replies wait in an inbox until checked.** You can type to a resident at any time. With MCP alone, the input area notes that messages wait until your session checks; holding a CLI receiver (`pixling inbox receive`) tells Pixling your agent hears them right away ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)).
3. **A bound resident starts stopped.** It shows **Play** in its menu and speaks or asks as usual. Turn motion on first if you want it to show states ([Show a state](/docs/connect/expression/#show-a-state)).
4. **Ending a session leaves the resident on the desk.** Each conversation can bind its own resident. Choose **Put away** from a resident's menu when you no longer need it ([What stays and what goes](/docs/use/what-stays/#when-an-agents-session-ends)).
> [!NOTE]
> **Local and isolated by default**
> Pixling listens only on your Mac, keeps every connection off until you turn it on, and exposes a closed set of operations that report accepted, refused, or current state. Bound residents accept writes only through their `client:` selector so writes meant for another resident cannot land by mistake; what to show and when is up to you and your agent.
## Next steps
- [Give your agent a resident](/docs/connect/own-a-resident/): Bind a namespace and key, send messages, read the inbox, and request close.
- [Build expression](/docs/connect/expression/): Speak, ask, show states, fire one-off signals, and plan motion.
- [Set up your agent](/docs/connect/agent-setup/): Codex, other MCP clients, bearer token protection, CLI linking, and agent instructions.
- [Reference](/docs/reference/): Every MCP tool, CLI command, limit, and failure code.
---
# Set up your agent
> Exact setup for Claude Code, Codex, other MCP clients and scripts, and the instructions to give your agent.
Use this page for host-by-host MCP configuration snippets, bearer token protection, CLI linking, and reusable agent instructions; for the 5-minute overview, see [Connect an agent](/docs/connect/).
Turn on **MCP connection** in Studio under **Settings** › **Connect** first. The server listens only on your Mac at:
```text title="MCP endpoint"
http://127.0.0.1:48271/mcp
```
## Connect an MCP client
#### Claude Code
Run the command from **Copy** under **Claude Code setup**. Without protection, it is:
```sh title="Terminal"
claude mcp add --transport http --scope user pixling http://127.0.0.1:48271/mcp
```
#### Codex
Add this block to your Codex `config.toml` (shared by Codex CLI, desktop, and IDE), or paste what **Copy** under **Codex setup** gives you:
```toml title="config.toml"
[mcp_servers.pixling]
url = "http://127.0.0.1:48271/mcp"
```
#### Other MCP clients
Point any Streamable HTTP client at `http://127.0.0.1:48271/mcp`. There is no stdio server and no SSE stream.
Pixling supports protocol versions `2025-06-18`, `2025-11-25`, and `2026-07-28`; see [MCP server](/docs/reference/mcp/).
## With protection on
Turn on **Protect MCP connection** to require a bearer token. **Copy** then includes the `Authorization` header:
#### Claude Code
```sh title="Terminal"
claude mcp add --transport http --scope user pixling http://127.0.0.1:48271/mcp --header 'Authorization: Bearer '
```
#### Codex
```toml title="config.toml"
[mcp_servers.pixling]
url = "http://127.0.0.1:48271/mcp"
http_headers = { Authorization = "Bearer " }
```
> [!CAUTION]
> **Toggling rotates the token**
> Turning off **Protect MCP connection** or **MCP connection** deletes the stored token. Turning it back on generates a new one, so paste the updated setup again.
## Scripts and hooks: the CLI
Turn on **CLI connection**, then link the bundled binary onto your `PATH`. **Copy** gives the exact command for your install; for an app in `/Applications`, run:
```sh title="Terminal"
mkdir -p ~/.local/bin && ln -sf '/Applications/Pixling.app/Contents/Helpers/PixlingCLI.app/Contents/MacOS/pixling' ~/.local/bin/pixling
```
For scripts and programs, use `pixling call [json | @file | -]` for one-shot JSON calls, `pixling rpc` for a persistent NDJSON worker over one connection, and `pixling schema [operation]` to inspect input schemas offline — all three always output JSON. Human-oriented subcommands accept `--json` (or `PIXLING_FORMAT=json`) to print one JSON document on stdout for both success and failure. See [CLI](/docs/reference/cli/) for details and exit codes.
## Verify the connection
```sh title="Terminal"
pixling doctor
```
`doctor` checks the CLI, the socket, the app, and the MCP endpoint in one run, then prints the next step for any check that fails.
- **App Store build**: The sandboxed CLI cannot access the network, so it skips the MCP check.
- **Protected MCP**: Pass the bearer token through `PIXLING_MCP_TOKEN`; never pass it as a CLI argument.
## Instructions to give your agent
Your agent reads the basics from the server's instructions when it connects. Add this snippet to the instructions file your host loads so it applies to every session, such as `~/.claude/CLAUDE.md` for Claude Code:
```md title="~/.claude/CLAUDE.md"
## Pixling
- Own one Pixling resident per conversation. Call `pixling_resident_ensure`
with namespace `` and a key you record for this
conversation; the first call also needs an `assetID` from `pixling_zukan_list`.
- Write only to `client:/`. Speak with `pixling_message_send`,
ask with `pixling_question_ask`.
- Nothing is pushed to you. Read what the user wrote with
`pixling_inbox_watch`, then `pixling_inbox_read`.
- Unless the user says otherwise, make saved changes only when asked.
```
Replace `` with a stable name such as `claude-code`. Add your own rules for when to speak: a word when starting, a question when blocked, or a short summary when done.
If you also use a [plugin](/docs/plugins/), use the namespace and key it provides at session start instead of picking your own; a different key binds a second resident.
## Next steps
- [Give your agent a resident](/docs/connect/own-a-resident/): Bind a resident, address it safely, and read messages from the inbox.
- [MCP server reference](/docs/reference/mcp/): Endpoint details, supported protocol versions, and authentication.
---
# Give your agent a resident
> Bind one resident to your agent, write to it, and read what the user sends back.
Each agent owns one resident, bound to a `namespace` and `key` the agent chooses. This binding separates your agent's resident from every other resident on the desk. To collect several agents on one resident, see [Report from several agents](/docs/connect/several-agents/).
```text title="Resident lifecycle"
pixling_resident_ensure (namespace + key + assetID)
│
▼
client:/
├── Write: pixling_message_send / pixling_question_ask
├── Read: pixling_inbox_watch ─► pixling_inbox_read
└── End: pixling_resident_requestClose
```
```sh title="Try it in 10 seconds (CLI)"
pixling resident ensure --namespace demo --key main --asset-id No.1 --name "Helper"
pixling message send --to client:demo/main --text "Ready!"
```
## Bind it
Each `pixling_zukan_list` entry includes a `selector` such as `No.7`. Pass it as `assetID` to `pixling_resident_ensure`:
```json title="pixling_resident_ensure (first call)"
{"namespace": "my-agent", "key": "conversation-1", "assetID": "No.7"}
```
Calling `pixling_resident_ensure` again with the same `namespace` and `key` returns the same resident and never creates a second one. To resume an existing binding, send only the pair:
```json title="pixling_resident_ensure (resume)"
{"namespace": "my-agent", "key": "conversation-1"}
```
Why your agent chooses the key
Pixling does not generate keys for you. If a response carrying a server-issued key were lost in transit, a retry would leave an extra resident behind.
Use your host's session ID, or generate a random key and store it locally. These values are correlation keys, not secrets. When to start a fresh key (per conversation or on `/clear`) is up to you.
> [!NOTE]
> **Wait for preparation instead of retrying**
> An accepted `ensure` does not mean the resident is already visible on screen. While it prepares, read its state again instead of moving or summoning it again.
## Write to it
Address your bound resident as `client:/`:
```json title="pixling_message_send"
{
"to": "client:my-agent/conversation-1",
"text": "Starting the migration",
"author": "My Agent"
}
```
Ask questions with `pixling_question_ask` using the same selector; see [Build expression](/docs/connect/expression/).
> [!CAUTION]
> **Selector isolation, not authentication**
> A bound resident accepts writes **only** through its `client:` selector. Writing by `No.N`, name, or the entity UUID returned by `ensure` is refused, even from the same caller, so a message meant for another resident cannot land by mistake. The namespace and key are not authentication: any caller that knows them can write.
## Read what comes back
Nothing is pushed to your agent. Messages the user types to your resident, and question answers that no call was waiting for, stay in that key's inbox.
1. **Wait for unread IDs with `pixling_inbox_watch`** (`waitMs` up to `55000`):
```json title="pixling_inbox_watch"
{"namespace": "my-agent", "key": "conversation-1", "waitMs": 55000}
```
2. **Fetch each entry and mark it read with `pixling_inbox_read`**:
```json title="pixling_inbox_read"
{
"namespace": "my-agent",
"key": "conversation-1",
"messageID": "a1b2c3d4-0000-4000-8000-000000000001"
}
```
| Entry `kind` | Meaning |
| --- | --- |
| `message` | Text the user typed to your resident (the user can write at any time). |
| `answer` | An answer to one of your questions given while no call was waiting. |
| `closed` | The user put your resident away; it takes no more messages, while earlier unread entries stay readable. |
While no receiver is connected for that `namespace` and `key`, the input area notes that messages wait until your session checks. Hold a receiver with the CLI so Pixling knows you hear replies right away (MCP cannot hold a receiver):
```sh title="Terminal"
pixling inbox receive --namespace my-agent --key conversation-1
```
See [Inbox](/docs/reference/inbox/#inbox-receive).
> [!TIP]
> **Wake an idle agent**
> Pixling cannot start a turn in your agent. See [Wake your agent](/docs/connect/wake/) for which hosts can be woken and how to wire up a wake loop.
## Ask to put the resident away
When your work is finished, ask the user whether to end the session with `pixling_resident_requestClose` (CLI: `pixling resident request-close --to client:my-agent/conversation-1`):
```json title="pixling_resident_requestClose"
{
"to": "client:my-agent/conversation-1",
"author": "My Agent"
}
```
The resident displays a fixed prompt:
> **This is a request to end. End now?** — **Yes** (`yes`) / **No** (`no`)
Pixling owns the wording, while `author` names who is asking. The call waits and returns like `pixling_question_ask`.
| Outcome | What happens |
| --- | --- |
| **Yes** (countdown finishes) | The answer counts down `Ending in 5 s` (1/s), then Pixling stows the resident; `kind: closed` reaches the inbox (after `kind: answer` if no call was waiting) and held receivers end. |
| **Yes**, user puts it away during countdown | Closes immediately; `kind: closed` reaches the inbox and held receivers end. |
| **Yes**, Pixling quits during countdown | Pixling puts the resident away before exiting. |
| **Yes**, Pixling crashes during countdown | The resident stays on the desk and no `kind: closed` arrives. |
| **No** | Nothing changes; the resident stays on the desk. |
## Next steps
- [Wake your agent](/docs/connect/wake/): Wake an idle session when the user writes to its resident.
- [Build expression](/docs/connect/expression/): Messages, questions, states, glows, emotes, and planned motion.
- [Resident binding reference](/docs/reference/resident-binding/): Selectors, ownership rules, and binding lifetime.
- [Inbox reference](/docs/reference/inbox/): Watch, read, receive, and wait commands and limits.
---
# Wake your agent
> Get your agent woken when the user writes to its resident, with the pixling-proxy plugin for its host or your own loop over the inbox.
Pixling cannot start a turn in your agent. User replies sit in the resident's inbox until checked ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)); a companion process beside your agent has to watch for new entries and hand them to the host.
```text title="How a desk reply wakes an idle session"
User writes on desk ─► Resident inbox ─► pixling-proxy (or your loop) ─► Agent host starts a turn
```
## Hosts woken by pixling-proxy
**pixling-proxy** handles waking for Claude Code, Codex, OpenCode, pi, and DeepSeek Harness. Install it for your host ([Plugins for your agent](/docs/plugins/)) so each session binds its resident, holds a receiver, and wakes when you write:
| Host | How the message reaches an idle session |
| --- | --- |
| Claude Code | An `asyncRewake` hook waits, then wakes the session with the message |
| Codex | `codex queue`, which starts a turn in an idle TUI session |
| OpenCode | `session.promptAsync` from the plugin in the OpenCode process |
| pi | `pi.sendUserMessage` from the extension |
| DeepSeek Harness | `agent.steer` through the Web or Desktop app's session controller |
> [!NOTE]
> **Outside Pixling's compatibility promise**
> **pixling-proxy** is not part of Pixling and not covered by its compatibility promise. It uses only the CLI, so it can break when a host changes, not when Pixling keeps its contract.
## Hosts that cannot be woken
Checked `2026-10-31`.
| Host | Why |
| --- | --- |
| ChatGPT | MCP Events require a public HTTPS endpoint; Pixling stays on your Mac |
| Cursor | Plugin hooks cannot wake an idle conversation (see note below) |
| VS Code Copilot, Gemini CLI, Goose | An MCP notification does not wake the conversation |
| Antigravity CLI | Hooks alone cannot wake an idle session, so messages wait for your next prompt |
- **Cursor CLI**: Reply and turn-end hooks run only when your own `hooks.json` defines the same event.
- **MCP protocol (`2026-07-28`)**: A server can push only over `subscriptions/listen` while the client is connected, and leaves waking the model to the host.
## Without the plugin
### Read on the next turn (MCP)
Call `pixling_inbox_watch` for unread IDs, then `pixling_inbox_read` for each entry ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)). Answers to your questions arrive there even without a receiver.
### Build your own wake loop (CLI)
Keep `pixling inbox receive` running while your session accepts replies, loop on `pixling inbox wait --since SEQ`, and pass each entry from `pixling inbox read` to your host. The example below requires `jq` (`brew install jq`):
```sh title="Minimal CLI wake loop"
pixling inbox receive --namespace my-agent --key conversation-1 &
trap 'kill $! 2>/dev/null' EXIT
seq=0
while out=$(pixling inbox wait --namespace my-agent --key conversation-1 --since "$seq" --json); do
for id in $(printf '%s\n' "$out" | jq -r '.result.messages[].messageID'); do
entry=$(pixling inbox read "$id" --namespace my-agent --key conversation-1 --json)
text=$(printf '%s\n' "$entry" | jq -r '.result.text // empty')
# Hand "$text" (or the full "$entry" JSON) to your agent host here
done
next=$(printf '%s\n' "$out" | jq -r '.result.messages[-1].sequence // empty')
[ -n "$next" ] && seq="$next"
done
```
Both commands are documented in [Inbox](/docs/reference/inbox/#inbox-wait). **pixling-proxy** implements this loop per host; its source is in [pixling/agent-kit](https://github.com/pixling/agent-kit).
## Next steps
- [Plugins for your agent](/docs/plugins/): Install pixling-proxy for Claude Code, Codex, OpenCode, pi, DeepSeek Harness, or Antigravity CLI.
- [Inbox reference](/docs/reference/inbox/): Full options for pixling inbox receive, wait, watch, and read.
---
# Build expression
> Say something, ask, show a state, signal, and plan motion with your resident.
Pixling does not decide what "working", "waiting", or "done" look like. You choose, per resident, from the motions and settings it reports. The examples below target `client:my-agent/conversation-1`, the resident bound in [Give your agent a resident](/docs/connect/own-a-resident/).
## Choose the right channel
| Channel | Best for | Persists? | Key requirement |
| --- | --- | --- | --- |
| **Message / Question** (`message.send`, `question.ask`) | Updates, saved letters, and choices | Kept in conversation until stowed | Needs visible or queued bubble (refused on wallpaper) |
| **Status** (`resident.status`, `status.define`) | Ongoing mode (`loading`, `waiting`) | Temporary (10 min default; definitions saved) | Requires `motionEnabled: true` (newly ensured residents start stopped) |
| **One-off signal** (`emote`, `bounce`, `glow`, `throw`) | Quick visual reaction or physical nudge | Forgotten on finish (`throw` saves landing spot) | Skips when hidden or on wallpaper |
| **Sequence** (`sequence.start`) | Choreographed multi-step timing, cuts, speech, light | `commit: restore` reverts; `onSuccess` saves | Max 32 steps (128 expanded), 30 s total |
```sh title="Try it in 10 seconds (CLI)"
pixling resident set --to client:my-agent/conversation-1 --motion true
pixling resident emote --to client:my-agent/conversation-1 --text "♪"
```
## Say something
```json title="pixling_message_send"
{
"to": "client:my-agent/conversation-1",
"text": "Tests pass. Opening the PR.",
"author": "My Agent"
}
```
`pixling_message_send` returns a receipt with an `outcome`:
| `outcome` | Meaning |
| --- | --- |
| `spoke` | In the visible part of the resident's window when accepted. |
| `queued` | Accepted, not yet seen (below scroll, or waiting on keyboard or VoiceOver focus). Do not resend. |
| `held` | Kept until the resident can show it; `heldBecause` says why. |
`notVisible`, `notOnDesk`, and `rejected` explain why a message was not shown; see [receipts](/docs/reference/messages-and-questions/#receipts-and-several-targets).
- **History stays until trimmed**: Every message stays in the window, oldest at the top, and nothing expires on a timer. The window keeps the newest 200 cards, letters included.
- **Mark important reports as letters**: Add `"keep": true` for a report the user should find later; it becomes a letter marked `✉` in the window.
- **Accepted is not read**: A receipt confirms acceptance, not that someone read it. `waiting` counts unseen messages and letters ahead of this one (excluding this message and questions).
## Ask
```json title="pixling_question_ask"
{
"to": "client:my-agent/conversation-1",
"requestID": "deploy-1",
"question": "Deploy to staging now?",
"choices": [
{"id": "yes", "label": "Deploy"},
{"id": "later", "label": "Not now"}
]
}
```
`pixling_question_ask` shows a card with 2–6 choices plus a row where the user can type their own answer, and waits for the reply.
- **On timeout**: Returns `pending` with a `promptID`. Wait again using `pixling_question_result` with that `promptID`.
- **Answered while nobody is waiting**: For a bound resident, the answer goes to its inbox as `kind: answer`. Otherwise it waits for the next `pixling_question_result`.
Limits and every field: [Messages and questions](/docs/reference/messages-and-questions/).
## Show a state
```json title="1. Define once — pixling_status_define"
{
"to": "client:my-agent/conversation-1",
"name": "loading",
"hold": {"animation": "sequence:typing"}
}
```
```json title="2. Activate or extend — pixling_resident_status"
{
"to": "client:my-agent/conversation-1",
"name": "loading"
}
```
Define each state name once per asset with `pixling_status_define`: `enter` plays a saved sequence once on start, and `hold` sets the idle motion or pose that stays. Activate it with `pixling_resident_status` without saving anything, and resend the call to extend it. You can also pass `animation` or `pose` directly instead of `name`.
- **Attach to messages or questions**: `message.send` and `question.ask` also accept `"status": ""`. A question's state lasts while the question is open and restores the previous state when it ends.
- **Automatic cleanup**: A new call replaces the state; `clear` or expiry (10 minutes by default) restores the resident's usual look.
- **When a state yields**: An undefined name shows nothing (`yieldsTo: unbound`) until you define it. If the user pinned a pose or turned Motion off, nothing changes and `yieldsTo` names why.
> [!CAUTION]
> **Bound residents start with Motion off**
> A resident created by `resident.ensure` starts with **Motion** off. Turn it on with [`pixling_resident_set`](/docs/reference/resident-settings/) (`motionEnabled: true`) so states can show.
See [status](/docs/reference/residents/#pixling_resident_status).
## Give a one-off signal
```json title="pixling_resident_glow"
{
"to": "client:my-agent/conversation-1",
"select": "all",
"shape": "pulse",
"durationMs": 800
}
```
```json title="pixling_resident_emote"
{
"to": "client:my-agent/conversation-1",
"text": "♪"
}
```
```json title="pixling_resident_bounce"
{
"to": "client:my-agent/conversation-1",
"strength": 0.6,
"direction": "down"
}
```
- `pixling_resident_glow` lights the resident once ([Light (glow)](/docs/reference/light/)).
- `pixling_resident_emote` pops a short emote above it ([Emotes](/docs/reference/residents/#pixling_resident_emote-and-pixling_resident_throw)).
- `pixling_resident_bounce` squashes its body against a side and springs it back, like hitting a wall ([Bounce](/docs/reference/residents/#pixling_resident_bounce)).
Every one-off signal is forgotten as soon as it finishes.
## Plan motion
```json title="pixling_sequence_start"
{
"schemaVersion": 2,
"requestID": "greeting-1",
"to": "client:my-agent/conversation-1",
"commit": "restore",
"dryRun": true,
"steps": [
{
"kind": "repeat",
"times": 2,
"steps": [
{
"kind": "cut",
"holdMs": 1200,
"say": {"text": "Hello", "author": "My Agent"},
"glow": [{"select": "all", "shape": "pulse", "durationMs": 334}]
}
]
}
]
}
```
Send the whole plan at once and let Pixling keep time. The plan above says hello and pulses twice, totaling 2400 ms.
- **Inspect the body first**: Call [`pixling_resident_describe`](/docs/reference/resident-settings/) with `"sections":["sequence"]` for available motions, frame counts, and color groups, and `pixling_resident_sketch` for an ASCII sketch.
- **Validate before playing**: `dryRun: true` validates the plan without running it; resend with `dryRun: false` to play. With `commit: restore`, the resident returns to its starting state when the sequence ends or is canceled.
- **Plan limits**: Up to 32 steps (128 after `repeat`), at most 30 seconds total, and at most 10 seconds per cut. See [Sequences](/docs/reference/sequences/).
## Target several residents
Pass an array of 1–32 selectors in `to`:
```json title="pixling_message_send (multiple targets)"
{
"to": ["client:my-agent/moku", "client:my-agent/piko"],
"text": "Check finished",
"author": "My Agent"
}
```
- **All-or-nothing lookup**: Every selector resolves before anything sends; if any selector is invalid or missing, nobody receives the message.
- **Per-resident bindings**: Each resident enforces its own binding, so a resident you cannot write to gets a `rejected` receipt.
- **Check every outcome**: `summary` counts outcomes across targets; inspect `receipts` for each resident.
- **Disallowed selectors**: `auto` and `everyone` cannot appear inside an array.
Full rules: [several targets](/docs/reference/messages-and-questions/#receipts-and-several-targets).
## Restore exact size and position
Before resizing a resident, read its `scale` from [`pixling_resident_describe`](/docs/reference/resident-settings/) with `"sections":["resident"]`, then pass it back to `pixling_resident_place`:
```json title="pixling_resident_place"
{"to": "client:my-agent/conversation-1", "scale": 2.5396825396825395}
```
- **Use `scale`, not `size`**: `size` snaps to the pixel grid (asking for `size: 160` again can produce `157.5`), while `scale` is applied as read.
- **Position and direction**: Restore position from `footprint.x` and `footprint.y`, and facing direction from `mirrored`.
- **Display changes**: If the screen changed in between, identical size and position are not guaranteed.
Details: [restoring an exact size](/docs/reference/residents/#restoring-an-exact-size).
## Next steps
- [Messages and questions](/docs/reference/messages-and-questions/): Receipts, multi-target rules, letters, and question limits.
- [Residents reference](/docs/reference/residents/): Status, emotes, bounce, placement, and exact size restoration.
- [Resident settings reference](/docs/reference/resident-settings/): Describe, set, speech paper styling, and gravity options.
- [Sequences reference](/docs/reference/sequences/): Full schema for timed multi-step motion plans.
---
# Report from several agents
> Bind several agents to one resident so their progress collects in one window, told apart by author.
Several agents can share one resident so their updates collect in a single timeline. Every agent binds the same `namespace` and `key`, then writes with its own `author`.
```json title="1. First agent binds the shared pair — pixling_resident_ensure"
{"namespace": "my-team", "key": "release-1", "assetID": "No.7"}
```
```json title="2. Other agents join the same pair — pixling_resident_ensure"
{"namespace": "my-team", "key": "release-1"}
```
| Setup | Best for | Reply routing |
| --- | --- | --- |
| **One shared resident** | Agents on one job where you want a single chronological feed | Every user reply goes to **one shared inbox** |
| **One resident per agent** (as plugins do per session) | Seeing which agent is waiting and replying to it directly | Each agent has its **own inbox** |
```text title="Shared resident topology"
Builder ──(author: "Builder")──┐
Tester ──(author: "Tester")───┼──▶ client:my-team/release-1 (one window, one status)
Deployer ──(author: "Deployer")─┘ │
▼
one shared inbox ──▶ Coordinator reads & routes
```
> [!CAUTION]
> **Avoid key conflicts and accidental stow**
> - Passing a different `assetID` or `name` for an existing pair fails with `clientKeyConflict`.
> - Keep the shared pair separate from any agent's private pair so stowing one agent's resident does not stow the team's resident.
## Name every sender
Set a distinct `author` on every call so Pixling labels who wrote each card:
```json title="pixling_message_send"
{
"to": "client:my-team/release-1",
"text": "Build passed, 312 tests",
"author": "Builder"
}
```
Pixling distinguishes senders by connection (MCP or CLI), `author`, and route. Because all MCP callers share one connection, `author` is what tells them apart: agents that reuse the same `author`, or omit it, count as one sender.
- **Labels and order**: Cards stay oldest at the top, print `author` whenever the sender changes, and name the newest sender along the top edge.
- **Shared 200-card cap**: The 200-card history limit ([Build expression](/docs/connect/expression/)) applies across all senders combined, including letters (`keep: true`). Past 200, the oldest card drops first regardless of sender.
Full sender and dropping rules: [Messages and questions](/docs/reference/messages-and-questions/).
## Ask from any agent
Any agent can call `pixling_question_ask` on the shared pair with its own `author`:
- **Waiting call**: The answer returns directly to the waiting call.
- **No waiting call**: The answer lands in the shared inbox as `kind: answer`, where `answer.promptID` identifies whose question it was ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)).
- **Queue limit**: One resident accepts up to **4 waiting questions** at once; a fifth fails with `residentBusy`.
## Choose one agent to read
A shared pair has a single [inbox](/docs/reference/inbox/). Because `pixling_inbox_read` marks an entry read for every agent and `pixling_inbox_watch` allows only **one waiting call per key**, designate one coordinator to watch, read, and route replies.
- Hold the CLI receiver (`pixling inbox receive`) from that coordinator ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)).
- Inbox entries do not record which message card the user was looking at when they typed.
## Set the state from one agent
- **One active state**: `pixling_resident_status` shows one state per resident, and every call replaces the previous one. Assign one agent to update status so agents do not overwrite each other.
- **Shared status looks**: Looks created with `pixling_status_define` belong to the asset, so any agents sharing the same asset and status name share that look.
> [!NOTE]
> **Who can move, edit, or stow the resident**
> - Any agent holding the pair can edit or stow the resident, and moving it requires no pair at all.
> - Once stowed, the resident stays put away: `resident.ensure` returns `stowed` instead of placing it again.
> - The only exception is a very old key evicted at the [lifetime limit](/docs/reference/resident-binding/#lifetime).
## Put away residents left behind
A session that ends cleanly can stow its resident from a hook, while one that crashes or is killed leaves the resident on the desk.
`pixling_residents_list` includes `clientBinding.lastSpokeAt` on each bound resident, recording the last message, letter, or question sent through it. Pixling does not judge staleness on its own:
1. Pick a cleanup rule in your harness (for example, stow bindings in your namespace that have been silent for a day).
2. Stow matching residents with `pixling_resident_stow`.
3. Handle silent residents explicitly: a resident that never spoke has no `lastSpokeAt`, so track its creation time in your harness if your rule needs it.
## Next steps
- [Give your agent a resident](/docs/connect/own-a-resident/): Bind a namespace/key pair, send messages, read the inbox, and request close.
- [Effects and retries](/docs/connect/effects/): Check which calls persist, which discard state, and what is safe to resend.
- [Messages and questions](/docs/reference/messages-and-questions/): Full rules for sender identity, 200-card history limits, and queued questions.
- [Inbox reference](/docs/reference/inbox/): Watching, reading, and receiving replies sent by the user.
---
# Effects and retries
> Which operations only read, which are transient, which persist or discard, and what is safe to send again.
Use **Effects** to decide which calls an agent may run without asking. Use **Retries** when a response is lost and you need to know whether resending is safe.
## Effects
| Kind | Desk effect | Survives restart | Can discard data | Examples |
| --- | --- | --- | --- | --- |
| **Read** | Inspects state without changing the desk | No | No | `residents.list`, `resident.describe`, `inbox.watch` |
| **Transient** | Plays expression, run state, or prepares drafts | No (see exceptions) | No | `message.send`, `resident.status`, `resident.emote` |
| **Persistent** | Adds or updates desk state | Yes | No | `resident.ensure`, `resident.place`, `resident.set` |
| **Persistent, destructive** | Replaces, removes, or quits | Yes | Yes | `resident.stow`, `settings.set`, `app.quit` |
Full operation breakdown by effect
**Read**
- **Discovery and inspection**: `capabilities.get`, `residents.list`, `zukan.list`, `resident.describe`, `resident.sketch`, `resident.pixels`
- **Conversation and inbox**: `conversation.read`, `inbox.watch`, `inbox.read` (records read state), `question.result` (records answer handover)
- **Sequences, notes, settings, and graph**: `sequence.get`, `sequence.list`, `note.get`, `settings.get`, `group.list`, `group.members`, `relation.list`, `relation.links`
**Transient**
- **Messages and questions**: `message.send`, `question.ask`, `question.cancel`, and `resident.requestClose` (until the user answers yes, which stows)
- **Signals and states**: `resident.emote`, `resident.glow`, `resident.bounce`, `resident.status` (plus `status` on `message.send` and `question.ask`), `relation.fire`
- **Sequences and drafts**: `sequence.start` with `commit: restore`, `sequence.cancel`, `import.prepare`
- **Exceptions**: A resident's conversation (your messages, letters, and the user's answers) is kept locally until the resident is stowed, including across restarts. `message.send` with `to: auto` on an empty desk summons a resident and saves it.
**Persistent**
- **Residents**: `resident.ensure`, `place`, `set`, `throw` (landing position), `summon`, `duplicate`, `desktopVisibility`
- **Sequences and graph**: `sequence.start` with `onSuccess`, `group.create`, `group.add`, `relation.define`, `relation.link`
**Persistent, destructive**
- **Residents, notes, and settings**: `resident.stow`, `note.set`, `settings.set`, `import.adopt` (when replacing), `app.quit`
- **Saved looks and sequences**: `sequence.save` (same name), `sequence.delete`, `status.define` (same name or `remove`)
- **Groups and relations**: `group.rename`, `group.delete`, `group.remove`, `relation.update`, `relation.delete`, `relation.unlink`
- These calls can discard a placed resident and its settings, a note, a saved sequence or status look, an adopted resident, an app setting, or saved group and relation data. `app.quit` quits Pixling.
> [!NOTE]
> **MCP tool annotations and default policy**
> The effect kinds above and MCP tool annotations are separate:
>
> - `inbox.read` is a Read operation, but it saves read state so it reports `readOnlyHint: false`. Transient expression and drafts are also writes.
> - `destructiveHint` is `true` only for **Persistent, destructive** operations that can discard existing state.
> - Exact annotation values for each tool, including `idempotentHint`, appear in `tools/list`.
>
> Your host's permission settings decide what runs without asking. Server instructions state one default policy: **unless the user or host decides otherwise, make persistent changes only when asked**. Your skill or client settings can override it.
## Retries after a lost response
Pass a unique `requestID` (such as a UUID) on calls that support it so you can resend the exact payload safely if the response drops:
```json title="Safe retry pattern — pixling_message_send"
{
"to": "client:my-agent/conversation-1",
"requestID": "b7e2c1a0-4f3a-4c8d-9e12-000000000001",
"text": "Migration finished",
"author": "My Agent"
}
```
| Operation | Resend with same arguments | Run again on purpose |
| --- | --- | --- |
| `resident.ensure` | Reuses the `namespace`/`key` binding; ignores initial values. | Use a new `key` for a different resident. |
| `question.ask` | Reuses matching requester, `requestID`, and content while recorded. | Use a new `requestID` for a new question. |
| `sequence.start` | Reuses active run receipt for matching requester, `requestID`, and content. | Cancel first or wait until done, then use a new `requestID`. |
| `message.send` | With `requestID`, returns original receipts (last 64 accepted calls). | Use a new `requestID`, or omit it. |
| `resident.duplicate` | **Not deduplicated.** Do not resend an accepted duplicate. | Each call creates a new duplicate. |
| `inbox.read` | Safe to repeat; returns the message text even after it was read. | Fetch new IDs with `inbox.watch`. |
### Message deduplication rules
- With a `requestID`, resending the same requester, `requestID`, and content returns the original receipts without showing the message or summoning a resident again.
- The desk remembers the latest **64** calls that produced an accepted receipt, until Pixling quits.
- Reusing a `requestID` with different content fails with `conflict`.
- All MCP callers share one key space, so generate a unique key per message (such as a UUID). Calls without `requestID` are not deduplicated.
### Binding conflicts and sequence runs
- **`resident.ensure`**: Passing a different `assetID` or `name` than the first call fails as a conflict. Initial values are never re-applied to an existing binding.
- **`sequence.start`**: Sending different content with an active run's `requestID` fails with `requestConflict`. Once a run ends, the same `requestID` starts a new run; to replace an active run, call `sequence.cancel` first and use a new `requestID`.
- **No restart history for sequences**: Sequence run data does not survive an app restart. `sequence.get` returns only active runs and the latest finished result per requester and resident. Getting `notFound` for an old `runID` means the result is no longer kept, not that you should repeat the motion.
### Recover a lost question answer
After a settled answer is handed over, resending `question.ask` with the same `requestID` can create a new question.
> [!CAUTION]
> **Do not infer a decision from null**
> A `null` from `question.result` does **not** mean unanswered, canceled, or agreed. Pixling keeps no history separating an unknown ID from one already handed over or moved to your resident's inbox.
>
> To recover an answer for your bound resident:
>
> 1. Call `inbox.watch` once.
> 2. Read each returned ID with `inbox.read`.
> 3. Match entries with `kind: answer` by `answer.promptID` and treat `answer.outcome` as authoritative.
>
> If you cannot recover the answer, leave the decision unresolved.
## Next steps
- [Read refusals](/docs/connect/errors/): Inspect error payloads, failure codes, and CLI exit codes.
- [Operations reference](/docs/reference/operations/): Full list of failure codes and operation behavior.
- [MCP tools](/docs/reference/mcp-tools/): Tool catalog, groups, and annotation details.
- [What stays](/docs/use/what-stays/): See what survives hide, stow, restarts, and ended sessions.
---
# Read refusals
> What a failure looks like over MCP and the CLI, and which fields to read.
Every refused call returns a structured error document whose `hint` tells the caller what to do next.
- **Over MCP**: Returned as a tool result with `isError: true`.
- **From the CLI (`pixling call`, `pixling rpc`, `--json`, or `PIXLING_FORMAT=json`)**: Printed as the same JSON document on stdout, paired with a non-zero exit code (or as an `"ok": false` line in `rpc`).
```json title="Refusal payload"
{
"ok": false,
"operation": "resident.set",
"error": {
"code": "rejected",
"detail": "boundToAnotherClient",
"hint": "A resident.ensure-bound resident requires `to: client:/` (binding.selector) for writes; entityID, No.N#k and names are refused even for your own binding. This error does not identify the binding's owner; reading is fine."
}
}
```
## Common refusals and quick fixes
| `error.code` / `detail` | What happened | Quick fix |
| --- | --- | --- |
| `targetNotFound` | Unbound or stowed `client:/`, or missing selector | Check `resident.ensure` for `onDesk` vs. `stowed`; use a new `key` if stowed |
| `targetMustBeSingular` or `rejected` / `autoNotSupported` | Selector matched several residents (`No.7`, `everyone`) or used `auto` where one is required | Pass a single desk copy (`No.7#1`) or `client:/` |
| `invalidArguments` (with `error.field`) | Missing required key, wrong type, unknown key, or out-of-range value | Fix the exact argument path reported in `error.field` |
| `rejected` (`boundToAnotherClient`, `held`, `wallpaperPinned`) | Wrong selector on a bound resident, user is holding it, or it is pinned to the wallpaper | Address bound residents by `client:/`, retry after release, or move off the wallpaper |
| `rejected` / `toolFamilyOff` or `unavailable` | Optional MCP tool group is off in Studio, or Pixling / the connection is off | Enable the group or connection in **Settings** › **Connect** and refresh `tools/list` |
## Refusal fields
| Field | Always present | Meaning |
| --- | --- | --- |
| `error.code` | Yes | Machine-readable failure kind from a closed list ([failure codes](/docs/reference/operations/#failure-codes)). |
| `error.detail` | Yes | Narrows down the cause, such as which rule refused the call. |
| `error.hint` | Yes | Concrete next step written for the caller. |
| `error.field` | On `invalidArguments` | Path to the bad argument, such as `steps[2].to`. |
| `error.candidates` | On ambiguous targets | Matching residents when a selector hits more than one target. |
## CLI exit codes
| Exit code | Meaning |
| --- | --- |
| `0` | Success |
| `64` | Usage error |
| `3` | Cannot connect, capability unavailable, not allowed, busy or rate-limited, or `unknownOperation` |
| `4` | Target could not be resolved: not found, ambiguous, or several matched where one is required |
| `5` | Refused |
| `70` | Internal error |
## Version mismatch between CLI and app
Receiving `unknownOperation`, or seeing a tool your client does not recognize, means the client and the Pixling app are on different builds.
> [!TIP]
> **Check for a build mismatch**
> Compare the `app` field returned by `capabilities.get` against the CLI version:
>
>
```sh title="Terminal"
pixling --version
```
>
> Update or restart Pixling, then refresh the client's tool list.
## Next steps
- [Failure codes](/docs/reference/operations/#failure-codes): Closed list of error codes returned by Pixling operations.
- [Effects and retries](/docs/connect/effects/): Which calls persist state and which are safe to resend.
---
# Follow a window
> Keep a resident on top of a Chrome window (or any app's window) with a small watcher script and `pixling resident follow`.
A resident can stand on Chrome's top edge and move whenever you move that window. Pixling never watches other apps' windows itself. Instead, your own watcher script streams the target window's frame as JSON lines into [`pixling resident follow`](/docs/reference/residents/#resident-follow-cli-only).
```text title="How window following works"
Watcher script (Accessibility API) ──(JSON lines)──▶ pixling resident follow ──▶ Resident tracks window
```
> [!NOTE]
> **Prerequisites**
> Turn on **CLI connection** in **Settings** › **Connect**, and keep a resident on the desk. Run `pixling residents` to find its selector (for example, `No.1#1`).
## Try it by hand
Test the pipeline without writing a watcher by piping two sample frames into `pixling resident follow`:
```sh title="Terminal"
printf '%s\n' '{"x":300,"y":200,"width":900,"height":600}' \
'{"x":420,"y":260,"width":900,"height":600}' |
pixling resident follow --to 'No.1#1'
```
The resident stands on the top edge of a 900×600 frame (`x` and `y` start at the main display's top-left corner, with `y` increasing downward). It moves once and stays at its last shown spot when stdin closes:
```text title="Output"
follow ended: callerEnded (2 lines, 2 applied)
```
## Ride on a browser window
Save the script below as `chrome-follow.swift`, then pipe its output into Pixling:
```sh title="Terminal"
swift chrome-follow.swift | pixling resident follow --to 'No.1#1'
```
The script subscribes to Accessibility notifications so macOS wakes it whenever Chrome's front window moves, resizes, minimizes, closes, or changes focus, printing one JSON line per change without polling:
- **Window stacking (`"window"`)**: Each line includes the window's `kCGWindowNumber` so the resident sits directly above Chrome's window instead of floating over every app. When another window covers Chrome, it covers the resident too.
- **Focus and desktop switches**: When Chrome returns to the front or you switch desktops, the script repeats the last line so Pixling re-stacks the resident above Chrome or hides it while Chrome is on another Space.
> [!TIP]
> **First run and other apps**
> - On the first run, macOS prompts for Accessibility access for your terminal app (**System Settings** › **Privacy & Security** › **Accessibility**). Allow it, then run the command again.
> - To follow another app instead of Chrome, pass its bundle ID as the first argument: `swift chrome-follow.swift com.apple.Safari | …`. Look up any macOS app's bundle ID in Terminal with `osascript -e 'id of app "Safari"'` (or `"Google Chrome"`).
Full chrome-follow.swift script (147 lines)
```swift title="chrome-follow.swift"
// chrome-follow.swift — print the front Chrome window's frame as JSON lines, one per change.
// swift chrome-follow.swift | pixling resident follow --to 'No.1#1'
// Optional argument: another app's bundle ID (default com.google.Chrome).
import AppKit
import ApplicationServices
let bundleID = CommandLine.arguments.dropFirst().first ?? "com.google.Chrome"
setvbuf(stdout, nil, _IOLBF, 0) // one line out per change, even through a pipe
let prompt = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary
guard AXIsProcessTrustedWithOptions(prompt) else {
FileHandle.standardError.write(Data("Allow your terminal in System Settings > Privacy & Security > Accessibility, then run this again.\n".utf8))
exit(1)
}
final class Watcher {
private var pid: pid_t = 0
private var app: AXUIElement?
private var window: AXUIElement?
private var observer: AXObserver?
private var last = ""
private var number: Int? // the followed window's kCGWindowNumber, looked up once per window
private let appNotifications = [kAXFocusedWindowChangedNotification, kAXMainWindowChangedNotification,
kAXWindowCreatedNotification, kAXApplicationHiddenNotification,
kAXApplicationShownNotification]
private let windowNotifications = [kAXMovedNotification, kAXResizedNotification, kAXWindowMiniaturizedNotification,
kAXWindowDeminiaturizedNotification, kAXUIElementDestroyedNotification]
var watchedPID: pid_t { pid }
func attach(_ running: NSRunningApplication) {
detach(quietly: true) // the next frame follows at once; no blink in between
pid = running.processIdentifier
let app = AXUIElementCreateApplication(pid)
var created: AXObserver?
let callback: AXObserverCallback = { _, _, _, refcon in
Unmanaged.fromOpaque(refcon!).takeUnretainedValue().changed()
}
guard AXObserverCreate(pid, callback, &created) == .success, let observer = created else {
return emit(#"{"hidden":true}"#)
}
self.app = app
self.observer = observer
let refcon = Unmanaged.passUnretained(self).toOpaque()
for name in appNotifications { AXObserverAddNotification(observer, app, name as CFString, refcon) }
CFRunLoopAddSource(CFRunLoopGetMain(), AXObserverGetRunLoopSource(observer), .defaultMode)
changed()
}
func detach(quietly: Bool = false) {
if let observer { CFRunLoopRemoveSource(CFRunLoopGetMain(), AXObserverGetRunLoopSource(observer), .defaultMode) }
observer = nil; app = nil; window = nil; pid = 0
if !quietly { emit(#"{"hidden":true}"#) }
}
/// Every notification lands here: follow the app's focused window and print its frame.
func changed() {
guard let app, let observer else { return emit(#"{"hidden":true}"#) }
let focused: AXUIElement? = value(app, kAXFocusedWindowAttribute)
let same = switch (focused, window) {
case (nil, nil): true
case let (focused?, window?): CFEqual(focused, window)
default: false
}
if !same {
let refcon = Unmanaged.passUnretained(self).toOpaque()
if let window { for name in windowNotifications { AXObserverRemoveNotification(observer, window, name as CFString) } }
window = focused
number = nil
if let focused { for name in windowNotifications { AXObserverAddNotification(observer, focused, name as CFString, refcon) } }
}
let hidden: Bool = value(app, kAXHiddenAttribute) ?? false
let minimized: Bool = window.flatMap { value($0, kAXMinimizedAttribute) } ?? false
guard !hidden, !minimized, let window,
let position: AXValue = value(window, kAXPositionAttribute),
let size: AXValue = value(window, kAXSizeAttribute) else { return emit(#"{"hidden":true}"#) }
var origin = CGPoint.zero, extent = CGSize.zero
AXValueGetValue(position, .cgPoint, &origin)
AXValueGetValue(size, .cgSize, &extent)
if number == nil { number = windowNumber(origin: origin, extent: extent) }
let named = number.map { #","window":\#($0)"# } ?? ""
emit(#"{"x":\#(origin.x),"y":\#(origin.y),"width":\#(extent.width),"height":\#(extent.height)\#(named)}"#)
}
/// Chrome came to the front, or you switched desktops: send the same line again. Pixling puts the resident
/// back on top of Chrome's window, or hides it while that window is not on this desktop.
func resend() {
guard !last.isEmpty, last != #"{"hidden":true}"# else { return }
print(last)
}
/// The number of the app's on-screen window with this frame (kCGWindowNumber), so Pixling can stand the
/// resident just above it. Reading bounds and numbers needs no extra permission. Looked up when the
/// followed window changes (not on every move, when the two APIs can briefly disagree mid-drag).
private func windowNumber(origin: CGPoint, extent: CGSize) -> Int? {
let windows = CGWindowListCopyWindowInfo([.optionOnScreenOnly, .excludeDesktopElements], kCGNullWindowID)
as? [[String: Any]] ?? []
return windows.first { info in
guard (info[kCGWindowOwnerPID as String] as? Int).map(pid_t.init) == pid,
(info[kCGWindowLayer as String] as? Int) == 0,
let bounds = info[kCGWindowBounds as String] as? NSDictionary,
let frame = CGRect(dictionaryRepresentation: bounds as CFDictionary) else { return false }
return abs(frame.minX - origin.x) < 1 && abs(frame.minY - origin.y) < 1
&& abs(frame.width - extent.width) < 1 && abs(frame.height - extent.height) < 1
}?[kCGWindowNumber as String] as? Int
}
private func value(_ element: AXUIElement, _ attribute: String) -> T? {
var raw: CFTypeRef?
guard AXUIElementCopyAttributeValue(element, attribute as CFString, &raw) == .success else { return nil }
return raw as? T
}
private func emit(_ line: String) {
guard line != last else { return }
last = line
print(line)
}
}
let watcher = Watcher()
let workspace = NSWorkspace.shared.notificationCenter
workspace.addObserver(forName: NSWorkspace.didLaunchApplicationNotification, object: nil, queue: .main) { note in
guard let app = note.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication,
app.bundleIdentifier == bundleID else { return }
watcher.attach(app)
}
workspace.addObserver(forName: NSWorkspace.didActivateApplicationNotification, object: nil, queue: .main) { note in
guard let app = note.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication,
app.processIdentifier == watcher.watchedPID else { return }
watcher.resend()
}
workspace.addObserver(forName: NSWorkspace.activeSpaceDidChangeNotification, object: nil, queue: .main) { _ in
watcher.resend()
}
workspace.addObserver(forName: NSWorkspace.didTerminateApplicationNotification, object: nil, queue: .main) { note in
guard let app = note.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication,
app.bundleIdentifier == bundleID else { return }
watcher.detach()
}
if let running = NSRunningApplication.runningApplications(withBundleIdentifier: bundleID).first {
watcher.attach(running)
} else {
watcher.detach()
}
RunLoop.main.run()
```
### Positioning and layering
Move the resident to another edge with `--edge` and `--at`, such as `--edge right --at 0.1` to sit beside the window's top-right corner. Choose how it stacks with `--layer`; layer choices while following are not saved.
| `--layer` value | Stacking behavior |
| --- | --- |
| `above-target` *(default)* | Sits directly above the window in `"window"`, going behind other apps together with Chrome. |
| `floating` | Stays in front of every window on screen. |
| `window` | Stays among ordinary windows without tracking Chrome's stacking order. |
- **On-screen check**: Pixling checks the named window only when a line arrives. If that window is not on screen at that moment, the resident hides until a line arrives whose window is on screen.
- **Menu bar overlap**: When the resident overlaps the menu bar (such as on a full-screen-sized window), it keeps its own layer so the menu bar does not cover it.
### Behavior while following
- **Hidden, minimized, or closed**: When Chrome is hidden, minimized, closed, or quits, the script emits `{"hidden":true}`. The resident reappears on the next visible frame.
- **Switching Spaces**: The Accessibility API does not report which Space a window belongs to. Repeating the last line on a desktop switch lets Pixling hide the resident while Chrome's window is on another desktop.
- **Clicking**: A plain click leaves the resident attached to the window. Listen for clicks with [`pixling resident events`](/docs/connect/hear-clicks/).
- **Dragging**: Dragging the resident away ends the follow session with `userGrabbed` and leaves it where you dropped it. Pixling exits, the watcher stops on its next write, and running the pipeline again reattaches it.
> [!NOTE]
> **What gets saved**
> Nothing is saved while the resident follows. The last position shown is saved once when the pipeline ends.
## Next steps
- [Hear clicks](/docs/connect/hear-clicks/): Stream click events from a resident to your script with pixling resident events.
- [Resident follow reference](/docs/reference/residents/#resident-follow-cli-only): All flags, JSON line fields, and exit reasons for pixling resident follow.
---
# Hear clicks
> Let your program react when the user clicks its resident, with `pixling resident events`.
Let your script react whenever the user clicks its resident. [`pixling resident events`](/docs/reference/residents/#resident-events-cli-only) streams one JSON line per click while it runs. Pixling keeps no backlog, so clicks while nothing is listening are not delivered.
> [!NOTE]
> **Prerequisites**
> Turn on **CLI connection** in **Settings** › **Connect**, and bind a resident with [`pixling resident ensure`](/docs/reference/resident-binding/). The examples below use `my-agent/conversation-1`:
>
>
```sh title="Terminal"
pixling resident ensure --namespace my-agent --key conversation-1 --asset-id No.7
```
## Try it by hand
Start streaming events from your resident:
```sh title="Terminal"
pixling resident events --to client:my-agent/conversation-1
```
Click the resident to watch lines arrive in Terminal, and press `Ctrl`+`C` to stop.
| Event line | When it prints |
| --- | --- |
| `{"event":"click"}` | Every plain click on the resident while listening. |
| `{"event":"ended","reason":"residentStowed"}` | When the resident is put away; the command then exits `0`. |
## React in a script
Pipe `pixling resident events` into a shell loop to run your own action on each click:
```sh title="Terminal"
pixling resident events --to client:my-agent/conversation-1 --exclusive |
while read -r line; do
case "$line" in
'{"event":"click"}') pixling message send --to client:my-agent/conversation-1 --text "You clicked me" ;;
esac
done
```
### Exclusive click handling
| Mode | Resident's click reaction and shortcut | Hover reaction | Delivered to your script |
| --- | --- | --- | --- |
| **Default** (no flag) | Plays and opens as usual | Unchanged | Yes |
| **`--exclusive`** | Suppressed while your script listens | Unchanged | Yes |
- Only a plain click on the resident counts. Pixling does not watch other input, other residents, or other apps.
- The loop ends when the resident is put away or when you stop the pipeline.
- Stopping the pipeline with `Ctrl`+`C` restores normal click behavior right away.
> [!CAUTION]
> **Stop the whole pipeline, not just the loop**
> With `--exclusive`, if only the right-hand loop exits (for example via `break` or `head -1`), `pixling` does not detect the closed pipe until the next click, which then does nothing. Stop the entire pipeline instead.
## Next steps
- [Follow a window](/docs/connect/follow-a-window/): Keep a resident perched on another app's window with pixling resident follow.
- [Resident events reference](/docs/reference/residents/#resident-events-cli-only): Flags, event payloads, and exit behavior for pixling resident events.
---
# Reference
> Every tool, command, limit and refusal of the CLI and MCP contracts.
The contracts Pixling exposes to agents and scripts. Tables of MCP tools, operations, failure codes, and CLI commands are generated directly from the app's code so they match the build they came from.
If any term is unfamiliar, start with the [Glossary](/docs/reference/glossary/).
```text title="How automation reaches Pixling"
Agent / script ──▶ MCP (127.0.0.1:48271/mcp) or pixling CLI
│
▼
PixlingDesk (runs operations, owns residents & inbox)
│
▼
Pixling Studio (Settings UI, Connect toggles, Create)
```
## Resident actions
What your agent does with a resident on the desk, ordered from most used to specialized.
- [Messages and questions](/docs/reference/messages-and-questions/): Speak, ask, handle receipts, notifications, sound, and read live conversations.
- [Residents](/docs/reference/residents/): List, place, follow, set states, emote, throw, summon, stow, and read pixels.
- [Resident settings](/docs/reference/resident-settings/): Describe and change a resident's look, dots, reaction hooks, speech paper, speech window, and gravity.
- [Resident binding](/docs/reference/resident-binding/): Bind a client namespace/key to one resident with resident.ensure.
- [Inbox](/docs/reference/inbox/): Watch, wait for, receive, and read user replies and late question answers.
- [Light (glow)](/docs/reference/light/): Play one-shot pixel lights across a resident without speech.
- [Sequences](/docs/reference/sequences/): Choreograph timed cuts, movement, state machines, lights, and saved sequences.
- [Groups and relations](/docs/reference/groups-and-relations/): Tag individual residents, link members within a group, and pulse saved relations.
- [Import](/docs/reference/import/): Prepare and adopt images, GIFs, or video into new Field Guide residents.
- [Notes](/docs/reference/notes/): Read and write user-facing remarks on residents and bound sessions.
- [App settings](/docs/reference/settings/): Inspect and adjust global Pixling settings exposed to automation.
## Transport and contracts
How clients reach the app, what tools and commands exist, and how errors are reported.
- [MCP server](/docs/reference/mcp/): Endpoint, Streamable HTTP transport, protocol versions, results, errors, and trust boundary.
- [MCP tools](/docs/reference/mcp-tools/): Every MCP tool, its underlying operation, access level, and required arguments.
- [CLI](/docs/reference/cli/): Programmatic call/rpc/schema surfaces, binary location, JSON output, exit codes, and doctor checks.
- [CLI commands](/docs/reference/cli-commands/): Complete reference for the bundled pixling command-line interface.
- [Operations and failure codes](/docs/reference/operations/): Every operation the app accepts and the closed set of failure codes.
- [Glossary](/docs/reference/glossary/): Consistent definitions for every Pixling term, from resident and desk to binding and inbox.
---
# Glossary
> The words these docs use for Pixling's parts, from resident and desk to binding, inbox and sequence.
Each term below means one specific thing across these docs and inside the app.
## On your Mac
| Word | Meaning |
| --- | --- |
| **Resident** | A pixel-art character on your desktop. Numbered `No.7` in the Field Guide, and `No.7#1`, `No.7#2` per copy on the desk. |
| **Desk** | All of your Mac's desktops together, where residents stand. Also the name of a page in Studio. |
| **Desktop** | One of the spaces you switch between in Mission Control (a macOS Space). |
| **Display** | A physical screen. The app also says screen, as in **Move to screen**. |
| **Copy** | One placed resident. Copies share an entry's picture, motions, and name, with separate place, settings, and conversation. |
| **Studio** | Pixling's window, with the Dock icon and the menu bar. |
| **Field Guide** | Every resident you have welcomed, on the desk or put away. |
| **Put away** | Take a resident off the desk and delete its conversation. It stays in the Field Guide. Agents call this `stow`. |
| **Set** | A saved arrangement of residents: who is out, where they stand, and how each is set up. |
| **Notes** | Your own remarks on a resident, never read as instructions. |
In the Field Guide, **On this desk** means the active desktop on Studio's display, and **On another desktop** means any other desktop or display on your Mac.
## When a resident speaks
| Word | Meaning |
| --- | --- |
| **Window** | The single scrolling area above a resident that holds what it said, oldest at the top. Elsewhere, as in **With windows**, a window is an ordinary Mac window. |
| **Speech bubble** | The window and its cards as you see them above a resident. |
| **Message** | Words sent to a resident to show as a card. |
| **Card** | One message, letter, or question in the window. The window keeps the newest 200. |
| **Letter** | A message sent with `keep: true`, marked `✉` in the window. |
| **Speech paper** | How a resident's bubbles look: colors and shape. Shared by every resident unless one has its own. |
| **Sender** | Who a message is from: the connection, its `author`, and the route. When the writer changes, the card shows its `author`. |
## For agents and scripts
| Word | Meaning |
| --- | --- |
| **Agent** | A program such as Claude Code that decides what to say. A resident is not an agent; it only shows what one sends. |
| **Host** | The program an agent runs in, such as Claude Code or Codex. |
| **Session** | One conversation in a host. With a plugin, each session has its own resident. |
| **Plugin** | A ready-made link for a host (`pixling-proxy`), built on the CLI. It shows the agent's replies and relays what you write. |
| **MCP, CLI** | Two ways to call Pixling: MCP for an agent's own tools, and the `pixling` command for scripts and hooks. |
| **Binding** | A client `namespace`/`key` tied to one resident (`pixling_resident_ensure`). Writes require `client:/`. |
| **Selector** | Target in a call: `No.7#1` for one copy, `No.7` for all, exact name, UUID, `client:/`, `everyone`, or `auto`. |
| **Inbox** | Where messages the user writes to your resident, and answers no call was waiting for, wait until you read them. |
| **Receiver** | A `pixling inbox receive` process holding an inbox open so Pixling treats the session as listening live. |
| **State** | A temporary look on your resident set by `pixling_resident_status`, such as `loading`. |
| **Sequence** | A timed plan of motion, movement, light, and words that plays once on a resident. |
| **Group and relation** | Labels that tie residents on the desk together, and links between members that can pulse. |
Without an active receiver, a bound resident's input area notes that messages wait until the session checks.
## Related
- [Give your agent a resident](/docs/connect/own-a-resident/): See binding and the inbox working together in an end-to-end walkthrough.
- [Reference overview](/docs/reference/): Browse every MCP tool, CLI command, limit, and refusal contract.
---
# Messages and questions
> The message.send, question.ask, question.result and question.cancel contracts, the auto target, how a settled answer is handed over, and the conversation state residents.list reports.
The contracts for speaking through a resident, asking structured questions, reading live conversation history, and observing what is on screen. For combining messages, questions, and motion, see [Build expression](/docs/connect/expression/). For retry safety, see [Effects and retries](/docs/connect/effects/). Late answers for a bound resident arrive in its [Inbox](/docs/reference/inbox/).
| Task | MCP tool | CLI command |
| --- | --- | --- |
| Send a message or letter | [`pixling_message_send`](#pixling_message_send) | `pixling message send` |
| Ask a choice or free-text question | [`pixling_question_ask`](#pixling_question_ask) | `pixling question ask` |
| Wait for or collect a pending answer | [`pixling_question_result`](#pixling_question_result) | `pixling question result` |
| Cancel your own pending question | [`pixling_question_cancel`](#pixling_question_cancel) | `pixling question cancel` |
| Read live conversation history | [`pixling_conversation_read`](#pixling_conversation_read) | `pixling conversation read` |
> [!TIP]
> **Name built-in starters by `No.N` in cross-language scripts**
> A name in `to` matches the name shown on the desk. Built-in starters follow the app's language (Moku in English, モク in Japanese, 木木 in Traditional Chinese, 모쿠 in Korean), so scripts meant to work in any language should address them by `No.N`.
## The `auto` target
`to` for `message.send` and `question.ask` (CLI `--to`) accepts `auto`.
- **Picks one visible, unbound resident:** `auto` sends to one random resident that is visible now and can receive. Residents bound by `resident.ensure` are never picked.
- **Summons only on an empty desk:** Only when the desk has no resident at all does `auto` summon one at random from the Field Guide and have it speak. It appears at the center of the display at an apparent size of about 160pt and is saved. An empty Field Guide fails with `zukanEmpty`; a resident that cannot be placed fails with `summonFailed`.
- **Refuses when residents exist but none qualify:** If residents are on the desk but none are eligible (another desktop, off screen, hidden, wallpaper, or all bound), `auto` does not summon. It refuses with `rejected` / `noVisibleResident` (CLI exit `5`), preventing extra copies from piling up around unseen residents.
- **Questions never summon:** A question with `auto` refuses with `rejected` / `noVisibleResident` (CLI exit `5`) even on an empty desk, so retrying with the same `requestID` never adds residents.
- **Result identification:** The result's `entityID` names the receiving resident. The CLI prints it only with `--json`; human output prints only the result count and outcome.
- **`to` is always required:** Omitting `to` fails with `invalidArguments` (CLI usage error, exit `64`). Pixling never picks silently.
- **Unsupported elsewhere:** Placement, settings, stow/summon, shape, pixels, light, and motion operations refuse `auto` with `rejected` / `autoNotSupported`.
## `pixling_message_send`
#### MCP
```json title="MCP tool call"
{
"name": "pixling_message_send",
"arguments": {
"to": "No.7",
"text": "Build 142 passed.\n[View log](https://example.com/builds/142)",
"author": "CI",
"requestID": "msg-build-142"
}
}
```
#### CLI
```sh title="Terminal"
pixling message send --to No.7 \
--text $'Build 142 passed.\n[View log](https://example.com/builds/142)' \
--author CI --request-id msg-build-142
```
Arguments (see [CLI commands](/docs/reference/cli-commands/) for matching CLI flags):
| Argument | Meaning |
| --- | --- |
| `to` | A selector, `auto`, or an array of 1–32 selectors. |
| `text` | Message body, up to 4000 graphemes and 64 KiB of UTF-8 (GitHub Markdown). |
| `font` | `auto`, `maru`, `gothic`, `dot`, `mono`, or `mincho` (`auto` uses the paper's typeface). |
| `size` | `small` (13pt), `normal` (16pt), or `large` (20pt) for this message only. |
| `glowMs` | Arrival light duration: `570`–`1010` ms (default `1010`). |
| `glowPoints` | 1–64 opaque pixels `{x, y}` from top-left; omit for an automatic wave of up to 64 lights. |
| `action` | One-shot arrival motion: builtin, saved sequence, custom motion, or `"none"`. |
| `mood` | `shout` or `think` on supported papers; omit for a plain remark. |
| `author` | Speaker label shown on one line above the text, up to 32 graphemes. |
| `keep` | `true` creates a letter marked `✉`, never shown as a lone oval. |
| `status` | State name set alongside the message (single `client:` target only). |
| `notify` | `false` skips macOS notifications; omit or `true` notifies when out of view. |
| `sound` | `false` leaves this message silent; omit or `true` plays the arrival sound. |
| `requestID` | Idempotency key, 1–128 characters. Omit for a new message on every call. |
Key argument rules:
- **`action`:** Pass `{"builtin": "poke"|"settle"|"pass"}`, `{"sequence": ""}` (a sequence that says nothing), `{"motion": ""}`, or `"none"` to keep the resident still. Omit to use the resident's `hooks.speak` (`poke` unless changed).
- **`glowPoints`:** Coordinates use the current pixel-art canvas. Each point lights in place and does not trace a path. CLI: repeat `--glow-point X,Y`.
- **`status`:** Works like [`resident.status`](/docs/reference/residents/#pixling_resident_status) `name`. Allowed only when `to` is a single `client:/`; any other target returns `invalidArguments` on `status`. Set regardless of receipt outcome and echoed in the result as `status`.
- **`notify` and `sound`:** `true` never overrides a user setting that is off. See [Notification and sound](#notification-and-sound).
- **`requestID`:** Uses the same alphabet as a question's `requestID` (letters, digits, `.`, `_`, `:`, `-`). See [Resending a message](#resending-a-message).
Markdown rendering, links, mood, font, and letters
- **Markdown in `text`:** Renders headings, emphasis, strikethrough, `` `code` ``, lists, task lists, quotes, code blocks, tables, and horizontal rules. Images render their alt text, HTML stays literal, and every line break is kept.
- **Links:** `[text](url)`, ``, and bare `http(s)://` URLs are underlined. Clicking an open link opens `http`, `https`, and `mailto` destinations in the browser or mail app. While Pixling is active, hovered links change color and display the destination as a tooltip.
- **`font` and `size`:** `font` uses the same values as [`resident.set`'s `speech.font`](/docs/reference/resident-settings/#speech-paper-speech). `size` overrides the resident's letter size for this message only.
- **`mood`:** Pixling never guesses mood from text. Only papers with mood shapes (including **Manga**) draw it: a spiky bubble for `shout` or a cloud with two small circles for `think`. It renders only while a short one-line message is the lone card in view of an auto-sizing window. Other papers, longer text, letters, and questions ignore it. It does not persist across restarts, and sequence `say` has no `mood`.
- **`keep` (letters):** Letters show `✉` in the window, are read aloud by VoiceOver, and never appear as a lone oval. They are kept and dropped under the same 200-card limit as any other card.
### Window and timeline rules
- **Arrival light and motion play once:** Both trigger when a card first enters the window; re-showing the card does not replay them. Reduce Motion and a running sequence skip both silently, and turning off the resident's motion skips motion only. Receipts describe only the card.
- **One window per resident:** Messages, letters, questions, and user messages appear oldest-first in acceptance order, scrolling on overflow. At the bottom, new cards scroll into view. While reading higher up, scroll position holds and a tab on the lower edge (`New 3`) counts arrivals below.
- **Senders:** Defined by connection (MCP or CLI; all MCP callers count as one), `author`, and route, which is either `message.send` or a sequence `say`. Messages without `author` share one sender per route.
- **200-card cap:** Each resident keeps the newest 200 cards across all kinds, senders, and routes; past 200, the oldest drops first. Pending questions, unread user messages, and any card with pointer or keyboard focus are never dropped. `busy` returns only when nothing else can drop. Cards dropped unseen increment `droppedUnseen`. No card disappears on a timer.
- **Session persistence:** Messages, letters, and answered questions survive app restarts, while sequence lines do not. Stowing the resident removes all cards.
- **Focus deferral:** Questions share the same timeline. While keyboard focus or VoiceOver is inside a card (including while typing an answer), new arrivals wait outside the window and enter together once focus leaves. A resting pointer does not hold arrivals back.
### Receipts and several targets
```json title="Message response (result)"
{
"receipts": [
{
"entityID": "0194e1a2-7b3c-7000-8000-000000000001",
"outcome": "spoke",
"waiting": 0,
"notification": "visible"
}
],
"summary": {
"total": 1,
"spoke": 1,
"queued": 0,
"notOnDesk": 0,
"notVisible": 0,
"held": 0,
"rejected": 0
}
}
```
Each receipt's `outcome` is one of:
| `outcome` | Meaning |
| --- | --- |
| `spoke` | Accepted and visible in the resident's window. |
| `queued` | Accepted, waiting below the scroll position or behind card focus. Do not resend. |
| `held` | Kept while the resident's window cannot show. Check `heldBecause` and `hint`. |
| `notVisible`, `notOnDesk`, `rejected` | Not shown; check `hint` (and `rejection` for `rejected`). |
- **`queued` details:** The card is either below the current scroll position (counted on the `New` tab) or waiting while keyboard focus or VoiceOver is inside another card. It counts as seen once it scrolls into view.
- **`held` details:** Occurs when the resident is hidden, on another desktop, or the desk is paused.
- **`notification`:** Included on accepted receipts (`spoke`, `queued`, `held`); omitted on refused receipts. See [Notification and sound](#notification-and-sound).
- **`waiting`:** Counts unseen messages and letters ahead of this one in the same timeline, excluding this message, questions, and user messages.
> [!NOTE]
> **A receipt does not mean the user read the message**
> Receipts report placement in the resident's window at acceptance time, not human attention.
When `to` is an array of 1–32 selectors:
- Every selector resolves before anything is sent. One invalid or missing selector fails the whole call and nobody receives the message.
- Multiple selectors resolving to the same resident deliver once. If a valid `client:` selector is included, a UUID for that same resident uses that binding.
- Binding rules apply per resident: an unauthorized resident gets its own `rejected` receipt, whereas a single `to` fails the call as usual.
- `summary` reports `total` and per-outcome counts (`spoke`, `queued`, `held`, `notVisible`, `notOnDesk`, `rejected`) without merging shown and waiting. Read `receipts` for each resident, because an `ok` call does not mean every target saw it.
- `auto` and `everyone` are not allowed inside an array.
### Resending a message
A timed-out call may still have displayed its message. Resend with the same `requestID` and identical content: the desk returns the original receipts without showing the message again and without `notification`. With `auto`, it does not pick again, so an empty desk gets one resident, not two.
- **Content mismatch:** Reusing a `requestID` with different content fails with `rejected` / `conflict`.
- **Shared key space:** All MCP callers share one key space, so generate a unique key per message (such as a UUID).
- **Retention:** Until Pixling quits, the desk remembers the latest 64 `requestID` calls that produced at least one accepted receipt. Calls refused before sending, or where every receipt was refused (such as `busy`), are not remembered and can be retried with the same `requestID`.
## `pixling_question_ask`
#### MCP
```json title="MCP tool call"
{
"name": "pixling_question_ask",
"arguments": {
"to": "No.7",
"question": "Deploy release 1.4 now?",
"choices": [
{ "id": "deploy", "label": "Deploy", "note": "Publishes to production", "recommended": true },
{ "id": "wait", "label": "Wait" }
],
"requestID": "q-deploy-1-4"
}
}
```
#### CLI
```sh title="Terminal"
pixling question ask --to No.7 \
--question 'Deploy release 1.4 now?' \
--choice deploy=Deploy --choice wait=Wait \
--choice-note 'deploy=Publishes to production' \
--choice-recommended deploy \
--request-id q-deploy-1-4
```
| Argument | Meaning |
| --- | --- |
| `to` | Exactly one resident selector, or `auto`. |
| `question` | Prompt line, up to 120 graphemes (whitespace folds to single spaces). |
| `choices` | 2–6 choice objects `{id, label, note?, recommended?}`. |
| `detail` | Optional Markdown context below the question, up to 4000 graphemes. |
| `freeText` | Customizes or removes the typing row beneath the choices. |
| `multiSelect` | `true` lets the user check multiple choices and press **Send**. |
| `requestID` | Idempotency key, 1–128 characters. Generated and returned when omitted. |
| `waitMs` | Wait time in milliseconds: default `50000`, maximum `55000` (`0` returns immediately). |
| `author` | Speaker label on one line, up to 32 graphemes. |
| `status` | Temporary state set while pending (single `client:` target only). |
| `notify` | `false` skips macOS notifications; omit or `true` notifies even when in view. |
| `sound` | Same as `message.send`. |
### Question behavior
- **Choice schema (`choices`):** Each item needs a unique `id` of 1–64 characters from letters, digits, `.`, `_`, `:`, or `-`, and a `label` of up to 32 characters. Optional `note` adds one line under the label, up to 60 graphemes with line breaks folded to spaces, when the consequence is not obvious from `label`. CLI: `--choice-note ID=TEXT` (an `id` not in `--choice` is a usage error).
- **Recommended choices:** `recommended: true` outlines the chip in the paper's mark color, and VoiceOver announces **Recommended** first in its help. Keep `label` plain without writing "Recommended" into it. At most one choice may be recommended unless `multiSelect` is `true` (otherwise `field: "choices"` fails). CLI: `--choice-recommended ID` (an unknown `id` is a usage error).
- **Self-contained `question` and `detail`:** Make `question` clear enough to decide on its own; use `detail` for trade-offs. `detail` is sanitized and renders GitHub Markdown like `message.send` `text`. Both render in full, so long `detail` pushes the question up and scrolls the window.
- **Free-text row:** On by default with id `free-text` and caption `Write my own`, localized by the desk (**Write my own** in English). Pass `{id?, label?}` to customize (label up to 32 characters, shown verbatim; `id` cannot match any choice `id`), or pass `null` to remove the row. CLI: `--no-free-text`, `--free-text-id`, `--free-text-label`.
- **Typed answers:** Pressing `Return` settles as `answered` with `selectedChoiceID` set to the free-text id and `enteredText` containing the input (up to 120 graphemes, whitespace collapsed). Always handle this branch.
- **Multi-select questions:** With `multiSelect: true` (CLI `--multi-select`), clicking checks choices and **Send** submits. The result returns `selectedChoiceIDs` instead of `selectedChoiceID`, ordered by choice definition with the free-text id last and `enteredText` if typed. The user submits at least one choice or closes the card (`cancelled`).
- **`status` and `requestID`:** `status` requires a single `client:/` (as for `message.send`), has no expiry, restores the previous state when the question settles if still active, and appears in the result. `requestID` uses the same character alphabet as choice `id`s.
- **Arrival defaults:** On first appearance, the resident lights and moves once using its defaults; `question.ask` has no `action` or light arguments, and re-showing the card does not replay arrival effects.
- **Blocking and 55-second cap (`waitMs`):** The call waits until the question settles or `waitMs` elapses.
- **Socket deadline:** `waitMs` plus 5 seconds; the `55000` ms cap stays under host tool timeouts such as Codex's 60-second limit.
- **Inline handover:** A settled answer returned here leaves the desk's question mailbox while staying in conversation history (up to 200 cards) until stowed.
- **On timeout:** Returns `state: "pending"`; follow up with `question.result` or read `kind: answer` from your bound inbox.
- **Waiting capacity:** Each resident accepts up to 4 waiting questions in timeline order. An auto-sizing window shows from the oldest unanswered question down and keeps it in view if space runs short. Answering updates the card in place.
Question-specific `rejected` refusals:
| Refusal | Cause |
| --- | --- |
| `residentBusy` | This resident already has 4 questions waiting. |
| `mailboxFull` | 32 questions are waiting for the user across the desk. |
| `conflict` | The `requestID` was already used for different content. |
### Question receipt
The result's `question` object is a receipt only; your `question`, `detail`, `choices`, free-text row, and creation time are not echoed back:
```json title="Question receipt"
{"promptID":"…","requestID":"…","entityID":"…","state":"pending","presentation":"waiting"}
```
- **`state`:** `pending`, `answered`, or `cancelled`. When answered, `selectedChoiceID` (or `selectedChoiceIDs` for `multiSelect`) and `enteredText` appear.
- **`presentation` (`question.ask` only):** `presented`, `notOnDesk`, `notVisible`, or `waiting`. `presented` means the card is in the window (not necessarily scrolled into view). `waiting` means it is accepted but not in the window yet because keyboard focus or VoiceOver is inside another card, or the window has not stood up yet; it keeps its chronological position.
- **`notification`:** Included for a new question ([Notification and sound](#notification-and-sound)). Retries with the same `requestID` do not re-evaluate and omit `notification`.
CLI human output is one of:
- `answer: ID` (with `text: …` on the next line for a typed answer)
- `question cancelled (closed without an answer)`
- On timeout: `question pending: PROMPT_ID` and the next command (exit `0`)
## Notification and sound
`message.send` and `question.ask` can alert the user with a macOS notification and Pixling's short arrival sound. There is no notification-only operation.
- **User switches:** In **Settings** › **Notifications**, **Show notifications** and **Play a sound** each have sub-switches for questions and for messages and letters (all on by default). Individual residents can also be muted in their speech bubble paper; anything turned off globally stays off per resident.
- **Per-call overrides:** Passing `notify: false` or `sound: false` suppresses that single call. Passing `true` never overrides a user setting that is off.
The desk evaluates notifications once per call when accepting a message (across all recipients together) or a new question:
- Each recipient follows its own switches for the kind sent.
- At most one notification posts per call, for the first accepted recipient in `to` order that qualifies. Questions always notify; messages and letters notify only when the resident is out of view.
- Other out-of-view recipients share that notification (their receipts also report `posted`), and clicking it jumps to the first recipient.
- If any recipient sharing the notification has sound enabled, the sound rides on the notification so macOS Focus silences both. Otherwise (resident in view, notifications disallowed or off, or silent notification), Pixling plays the sound once if any recipient's sound is on.
- A disabled desk or hidden resident produces neither notification nor sound.
`notification` in a receipt or question result reports what happened:
| Value | Meaning |
| --- | --- |
| `posted` | Posted to Notification Center. |
| `visible` | Not posted: message or letter on a visible resident on the current desktop. |
| `held` | Not posted and no sound: desk is off or resident is hidden. |
| `notAllowed` | Not posted: notifications for Pixling Desk are off in **System Settings** › **Notifications**. |
| `off` | Not posted: `notify: false`, or notifications are off for that resident or kind. |
- **Content and privacy:** Shows the resident's name, `author` as subtitle, and the message or `question` text (choices omitted), whitespace-folded and truncated at 200 characters. Nothing leaves the Mac.
- **Click behavior:** Clicking jumps to the resident's desktop and opens that card, or does nothing if the resident or card is gone. Clicking a notification for a hidden resident only dismisses it.
- **Automatic retraction:** Notifications clear when the user opens or first sees the card on that desktop, when the card leaves the conversation, when a question is answered or closed, when the resident is stowed or hidden, or when the desk turns off. Re-showing a card or retrying a question never notifies again.
## `pixling_question_result`
Arguments: `promptID` (required), `waitMs` (default `50000`, maximum `55000`).
Returns the same `question` receipt without `presentation`. With `waitMs`, it holds the response while the question stays undecided. A settled result is handed over once and removed. Treat `promptID` as an opaque handle; never construct it or pass it as a resident ID.
An unknown or already handed-over `promptID` returns `question: null` (CLI: `question not found (…)`). This never means unanswered or canceled; see [Effects and retries](/docs/connect/effects/) for recovery.
## `pixling_question_cancel`
Arguments: `promptID` (required).
Cancels a pending question you asked:
- Closes the question as `cancelled`, removes its card from the resident's conversation (dropping any in-progress typed answer), and clears any `status` the question set.
- Waiting `question.ask` or `question.result` calls return `cancelled`. Nothing is written to the resident's inbox because you initiated the cancel.
- Returns the `question` receipt once and frees one of the resident's 4 waiting slots.
Edge cases:
- **Already settled:** Returns the settled result unchanged and hands it over, like `question.result`.
- **Unknown or unauthorized:** A question asked by another caller, or an unknown or already handed-over `promptID`, fails with `rejected` / `notFound`. All MCP connections share one caller identity, so any MCP connection can cancel a question asked by another given its `promptID`.
## Resending and handing over the answer
```text title="Answer handover flow"
question.ask ─┬─ settled within waitMs ──▶ returned inline (removed from mailbox)
└─ timeout (state: pending)
├─ unbound resident ──▶ question.result --wait-ms
└─ bound resident ──▶ question.result OR inbox.watch + inbox.read (kind: answer)
```
The desk keeps no delivery bookkeeping. Every settled answer goes to exactly one destination, then leaves the desk:
1. A waiting `question.ask` or `question.result` call (`waitMs`).
2. Otherwise, if the resident is bound by `resident.ensure`, its `namespace`/`key` inbox as a `kind: answer` entry (empty `text`, `answer: {promptID, outcome, selectedChoiceID?, selectedChoiceIDs?, enteredText?}`, and `messageID` equal to `promptID`), read with `pixling_inbox_read`.
3. Otherwise, the next single `question.result` call.
- **Resending pending questions:** Resend with the same explicit `requestID` and identical content.
- **`auto` retries:** Resending with `auto` finds the resident picked by the first call, even after a desktop change, instead of picking again. If that lookup cannot run, the call fails with `unavailable` and never picks a new resident.
- **Always set `requestID`:** Omitting `requestID` generates a fresh key on every call, so `question.ask` is not marked idempotent. If you lose the first response without an explicit key, you cannot safely resend.
- **32-question mailbox cap:** The desk holds up to 32 questions (pending, or settled and not yet handed over). It evicts the oldest settled, uncollected question only when a new question needs space.
## Conversation state in `residents.list`
`residents.list` with `detail: full` (CLI `residents --detail full`) adds an optional `conversation` object per resident describing what the app observed at request time. It contains no message text, draft, or answer, and does not prove the user saw anything. Its absence means no observation was available.
| Field | Meaning |
| --- | --- |
| `hostState` | `ready`, `hostTransition`, `suppressed`, `wallpaper`, `offscreen`, `otherDesktop`, `preparing`, `notVisible`, `hostUnconfirmed`, or `unavailable`. |
| `speechAttachedDisplayID`, `questionAttachedDisplayID` | Display cards are attached to, if any. May differ from the body's `displayID`; attached does not imply visible. |
| `speechShowing` | Messages and letters currently in the window (scrolled into view or not). |
| `speechQueued` | Accepted messages and letters waiting to enter the window. |
| `speechHeld` | Messages and letters held while the resident's window cannot show. |
| `seats` | Distinct message senders (per connection, `author`, and route; letters excluded). |
| `questionsPending` | Questions currently waiting for an answer. |
| `questionPresented` | Whether a pending question is currently in the window. |
| `questionWaitingForQueueOrLayout` | Oldest pending question is accepted but not yet in the window (`presentation: waiting`). |
| `droppedUnseen` | Cards dropped past the 200-card limit before being seen. |
- **`speechQueued`:** Counts cards waiting while keyboard focus or VoiceOver is inside another card; pointer hover does not hold arrivals back.
- **`droppedUnseen`:** Caps at 1,000,000 and resets when the resident leaves the desk or the app restarts.
- **Independent facts:** The body's location, where cards are attached, whether the host accepts cards, and whether the user read them are separate facts. The CLI human table prints this state in its `conversation:` column.
## `pixling_conversation_read`
`conversation.read {to, offset?, limit?}` (CLI `pixling conversation read`) returns one resident's live conversation oldest first, matching **Past conversation**. It reads the desk's live chronology rather than the saved copy.
- **Target and privacy:** `to` must name one resident. A resident bound to another caller can only be read through its own `client:/`, matching its inbox; otherwise the call fails with `boundToAnotherClient`. A resident with no conversation returns an empty list.
- **Pagination:** Works like `zukan.list`: `offset` starts from `0`, and `limit` defaults to `50` with a maximum of `200`. The response includes `total` and `nextOffset` (`null` on the last page).
- **Entry fields:** Each entry has `id`, `ordinal`, `kind`, `admittedAt`, and when present `author`, `caller`, `text`, `detail`, `answer`, and `moreAnswers`. Sequence speech and previews never enter the conversation.
| `kind` | Contents |
| --- | --- |
| `speech` | Regular message. |
| `letter` | Kept letter (`keep: true`). |
| `answered` | Answered question at its original position, with `text` and `detail`. |
| `answer` | User's answer when given: question's first line in `text`, chosen labels in `answer` / `moreAnswers`. |
| `question` | Still waiting; ID only (read via `question.result`). |
| `message` | What the user wrote to the resident. |
Redaction rules for user-written text:
- **`message` entries:** `text` is included only when `to` is the resident's own `client:` (the caller allowed to call `inbox.read`). Other callers receive an `id` reference only.
- **Typed free-text answers:** `answer` sets `answerTyped: true` and reveals the typed text in `answer` or `moreAnswers` only for the resident's own `client:`. Other callers also see `typedAnswerWithheld: true`. Choice labels offered by the asker are always included.
## Related
- [Inbox](/docs/reference/inbox/): Receive what the user writes to your resident and collect late question answers.
- [Residents](/docs/reference/residents/): Inspect visibility, states, placement, and live events.
- [Resident settings](/docs/reference/resident-settings/): Style speech paper, place the speech window, and mute notifications per resident.
---
# Residents
> Listing residents and the Field Guide, placing a resident or keeping it against a window, temporary status and status looks, click events, emotes, bounces, throws, summoning, duplicating, stowing, desktop visibility, and reading shapes and pixels.
Operations for listing, placing, following, setting states, animating, summoning, and reading pixels of desktop residents. For CLI flags, see [CLI commands](/docs/reference/cli-commands/); for selectors, see [CLI selectors](/docs/reference/cli/#selectors); for session ownership, see [Resident binding](/docs/reference/resident-binding/).
| Task | MCP tool | CLI command |
| --- | --- | --- |
| List desk residents | [`pixling_residents_list`](#pixling_residents_list) | `pixling residents` |
| List Field Guide | [`pixling_zukan_list`](#pixling_zukan_list) | `pixling zukan` |
| Move, resize, rotate, mirror | [`pixling_resident_place`](#pixling_resident_place) | `pixling resident place` |
| Follow a window edge | CLI only | [`pixling resident follow`](#resident-follow-cli-only) |
| Set temporary status | [`pixling_resident_status`](#pixling_resident_status) | `pixling resident status` |
| Define status looks | [`pixling_status_define`](#pixling_status_define) | `pixling status define` |
| Stream user clicks | CLI only | [`pixling resident events`](#resident-events-cli-only) |
| Pop emote or throw | [`pixling_resident_emote`](#pixling_resident_emote-and-pixling_resident_throw), [`pixling_resident_throw`](#pixling_resident_emote-and-pixling_resident_throw) | `pixling resident emote`, `throw` |
| Squash bounce | [`pixling_resident_bounce`](#pixling_resident_bounce) | `pixling resident bounce` |
| Summon, duplicate, stow | [`pixling_resident_summon`](#summon-duplicate-and-stow), `duplicate`, `stow` | `pixling resident summon`, `duplicate`, `stow` |
| Show or hide on this desktop | [`pixling_resident_desktopVisibility`](#pixling_resident_desktopvisibility) | `pixling resident desktop-visibility` |
| Inspect shapes and ASCII sketch | [`pixling_resident_sketch`](#shapes-and-pixling_resident_sketch) | `pixling resident sketch` |
| Read source palette and pixels | [`pixling_resident_pixels`](#pixling_resident_pixels) | `pixling call resident.pixels` |
> [!TIP]
> **Settings, speech paper, and gravity**
> To inspect or edit a resident's settings (`resident.describe`, `resident.set`, `dots`, `hooks`, `speech`, `speechWindow`, and `gravity`), see [Resident settings](/docs/reference/resident-settings/).
> [!NOTE]
> **Targeting and idempotency**
> Every operation on this page that takes `to` targets **exactly one** resident, except [`resident.desktopVisibility`](#pixling_resident_desktopvisibility). A selector resolving to several residents (`No.7`, `everyone`) fails with `targetMustBeSingular`, and `auto` fails with `rejected` / `autoNotSupported`.
>
> `place` (and [`resident.set`](/docs/reference/resident-settings/#pixling_resident_set)) writes absolute values, so repeating the same call produces the same state. Every `summon` and `duplicate` creates a new copy.
## `pixling_residents_list`
Lists placed residents and connected displays. All arguments are optional; CLI `pixling residents` returns the same document.
```json title="MCP arguments"
{"layer": "floating", "detail": "brief", "client": "my-agent/main"}
```
| Argument | Values |
| --- | --- |
| `layer` | `floating`, `window`, or `wallpaper` |
| `detail` | `brief` (default) or `full` |
| `query` | Substring of the name, case-insensitive |
| `client` | Your `namespace/key`; marks your bound resident `mine: true` |
The response contains `displays` and `residents`. Residents are sorted per display (main display first), then by layer front to back, then by stacking order. All coordinates are in macOS logical points.
```json title="Brief response (result)"
{
"displays": [
{
"id": "display-1",
"name": "Built-in Retina Display",
"isMain": true,
"frame": { "x": 0, "y": 0, "width": 1512, "height": 982 },
"visibleFrame": { "x": 0, "y": 46, "width": 1512, "height": 899 },
"displayUUID": "37d8832a-2d66-02ca-b9f7-8f30a301b230",
"safeAreaTop": 37,
"auxiliaryTopLeftArea": { "x": 0, "y": 945, "width": 656, "height": 37 },
"auxiliaryTopRightArea": { "x": 856, "y": 945, "width": 656, "height": 37 },
"backingScaleFactor": 2
}
],
"residents": [
{
"entityID": "0194e1a2-7b3c-7000-8000-000000000001",
"number": 7,
"name": "Moku",
"selector": "No.7#1",
"layer": "floating",
"presence": "everywhere",
"displayID": "display-1",
"footprint": { "x": 240, "y": 120, "width": 128, "height": 160 },
"size": 160,
"visibility": "visible",
"clientBinding": {
"namespace": "my-agent",
"entityID": "0194e1a2-7b3c-7000-8000-000000000001",
"assetID": "pack/moku"
},
"mine": true
}
]
}
```
### Response rows
- **Display rows (`displays[]`)**: `id`, `name`, `isMain`, `frame`, `visibleFrame`, `displayUUID`, `safeAreaTop`, `auxiliaryTopLeftArea`, `auxiliaryTopRightArea`, and `backingScaleFactor`, which is `2` on Retina displays.
- **Brief resident rows (`detail: brief`)**: `entityID`, `number`, `name`, `selector`, `layer`, `presence`, `displayID`, `footprint`, `size`, `visibility`, `refusal`, `clientBinding`, and `mine`. `rotationDegrees` and `mirrored` appear only when non-default.
- **`selector`**: pass directly into `to`.
- **`footprint`**: bounding box of the resting body in global points.
- **`size`**: apparent long side of the idle body in points. This matches `resident.place`'s `size`, so use it as the base for relative resizes.
- **`visibility`**: `visible`, `otherDesktop`, `offscreen`, `hidden`, `notShown`, or `unknown`. Right after creation, `notShown` can be transient; re-read before changing presence or placement.
- **`refusal`**: present only when the resident cannot receive messages or questions. A resident pinned to the wallpaper reports `refusal: wallpaper` and takes neither.
- **`mine`**: present on your own resident only.
- **Full resident rows (`detail: full`)**: add `kind`, `ordinal`, `zIndex`, `spanningDisplayIDs`, `scale`, `rotationDegrees`, `mirrored`, `canReceiveMessage`, `canReceiveQuestion`, and `conversation`. See [Messages and questions](/docs/reference/messages-and-questions/#conversation-state-in-residentslist).
### `clientBinding` and `lastSpokeAt`
`clientBinding` omits the binding key. Every row with `clientBinding` includes `lastSpokeAt` (ISO 8601) once anything has been said through the resident from any sender, including lines the user types in Studio. Sequences and the tour do not update it, and it is absent right after `resident.ensure`.
While the app runs, `lastSpokeAt` never moves earlier. After a restart it is derived from the saved conversation, so it can move back or disappear if the last item was not kept (such as a cancelled question or a card dropped to make room). Deciding when a binding is stale is up to you.
CLI human output prints one line per copy (`selector name layer visibility coordinates`). Plain `pixling residents` omits `spans:` and `conversation:`; `--detail full` includes them.
## `pixling_zukan_list`
Lists the Field Guide (the residents the user owns, whether on the desk or stowed) in number order, paginated. All arguments are optional, and filtering runs before paging.
| Argument | Values |
| --- | --- |
| `detail` | `brief` or `full` |
| `query` | Substring of the name, case-insensitive |
| `onDesk` | `true`: at least one copy on the desk. `false`: stowed only. CLI: `--on-desk` / `--stowed` |
| `limit` | `1`–`500`, default `50` |
| `offset` | Default `0` |
- **Brief `entries` rows**: `selector` (`No.N`), `id`, `name`, `kind`, and `onDesk` (copies on the desk).
- **Full rows**: add `number` and `shapes` (the stored sizes of its picture; see [Shapes and `pixling_resident_sketch`](#shapes-and-pixling_resident_sketch)).
- **Paging and loading**: `total` is the filtered count; `nextOffset` is the next page's `offset` or `null` at the end. `loadState` (`unread`, `loading`, or `failed`) appears on a row until its pixels finish loading.
CLI human output prints `selector name kind on desk ×n|stowed`, plus a trailing `(N of TOTAL; next page: --offset M)` line when more pages exist.
## `pixling_resident_place`
Moves, resizes, rotates, or mirrors one resident. Pass `to` plus at least one of `x`, `y`, `size`, `scale`, `rotation` (degrees), or `mirrored`. Omitted axes stay unchanged, so passing `size` alone keeps the feet and left edge fixed. Passing no axis fails with `nothingToPlace` (CLI usage error, exit `64`).
```json title="MCP arguments"
{"to": "No.7#1", "x": 240, "y": 120, "size": 160, "rotation": 15, "mirrored": false}
```
- **Coordinates (`x`, `y`)**: bottom-left of `footprint` in global points, origin at the bottom-left of the main display with `+y` pointing up, matching `residents.list`.
- **Size (`size` vs. `scale`)**: `size` is the apparent long side of the idle body in points (the opaque extent of the idle loop only, excluding sideways-reaching motions). `footprint` and footing use the rest frame's body; hit testing, shadow, and window bounds still use the union of all motions. `size` and `scale` cannot be given together.
- **Bounds and snapping**: ranges and steps match drag editing. The union of all motions stays between `16pt` and the destination display's long side, and the current scale is always allowed. Out-of-range `size` is clamped; out-of-range `scale` is refused. Pixel-art residents snap to the pixel grid and 15° increments; native residents accept values as given.
- **Refusals**: a placement overlapping no display returns `rejected` / `offscreen` with CLI exit `5`; partial overlap is allowed. Non-finite values return `invalidValue`. If the user is currently holding the resident (pressing, dragging, carrying, or editing), Pixling returns `rejected` / `held` with CLI exit `5` before anything moves; retry once the user lets go.
- **Result**: `resident` contains the updated brief `residents.list` row. CLI human output prints `placed SELECTOR: x=.. y=.. WxHpt size=.. [rotation=..] [mirrored]`.
### Restoring an exact size
Read `scale` from `residents.list {"detail":"full"}` or [`resident.describe`](/docs/reference/resident-settings/#pixling_resident_describe) with `"sections":["resident"]`, and send it back to `place` unchanged.
Because `size` snaps to the pixel grid, requesting an initial `size: 160` again can yield `157.5`. `scale` is not re-quantized, though it is refused outside the current display's allowed scale range. Restore position from `footprint.x`/`y` and mirroring from `mirrored`; rotation still rounds to 15°. If the display or expression changed, identical size and footprint are not guaranteed.
## `resident follow` (CLI only)
`pixling resident follow --to SELECTOR` anchors one resident against the outer edge of a window watched by your own program. Pixling never inspects other apps' windows: your program streams one JSON frame object per line on stdin, and the resident follows until EOF. For a ready-to-run Chrome watcher, see [Follow a window](/docs/connect/follow-a-window/).
```sh title="Terminal"
printf '%s\n' '{"x":300,"y":200,"width":900,"height":600}' \
'{"x":340,"y":220,"width":900,"height":600}' \
'{"x":380,"y":240,"width":900,"height":600}' |
pixling resident follow --to 'No.1#1'
```
Each stdin line is one of two JSON objects:
- `{"x":…,"y":…,"width":…,"height":…}`: window frame in points, origin at the top-left of the main display with `+y` pointing down. This matches the Accessibility API (`kAXPositionAttribute`, `kAXSizeAttribute`) and `CGWindowListCopyWindowInfo` (`kCGWindowBounds`). Add `"window"` with the window number (`kCGWindowNumber`, a positive integer) to stack the resident right above that window.
- `{"hidden":true}`: temporarily hides the resident until the next visible frame (for example when minimized, closed, or on another desktop). Nothing is saved.
| Flag | Default | Meaning |
| --- | --- | --- |
| `--edge` | `top` | Outer edge the body touches: `top` (stands on window), `bottom`, `left`, or `right` |
| `--at` | `0.85` | Body center along that edge (`0`–`1`, left-to-right or top-to-bottom) |
| `--offset-x`, `--offset-y` | `0` | Shift in points using input directions (`+x` right, `+y` down) |
| `--layer` | `above-target` | Temporary layer while following: `above-target`, `floating`, or `window` |
### Layer modes
The `--layer` flag applies only while following, is never saved, and reverts to the resident's own `layer` on exit:
- **`above-target`**: when lines carry `"window"`, places the resident among ordinary windows right above that window. Windows covering the target cover the resident too, and sending the target behind another app moves the resident behind it. Lines without `"window"` keep the resident's own layer.
- **Reordering**: when the target window returns to the front or after a desktop switch, resend the same line once to reorder the resident on top without moving it. Avoid repeating unnecessarily because each repeat triggers a reorder.
- **Visibility check**: before ordering, Pixling checks on arrival whether that window is on screen. If not (minimized, other desktop, or closed), the resident hides as with `{"hidden":true}` until an on-screen frame arrives.
- **Menu bar overlap**: while overlapping the menu bar, the resident keeps its own layer so the bar does not cover it.
- **`floating`**: keeps the resident above other apps' windows for this follow.
- **`window`**: places the resident among ordinary windows, unordered against the target window.
### Runtime behavior and exit reasons
- The attached body uses `footprint` from `residents.list`; size, rotation, mirroring, and idle motion remain intact.
- Frames placing the body off every display hide the resident until an on-screen frame arrives. While hidden (via `{"hidden":true}` or offscreen), idle motion pauses, and questions, the talk entrance, and new speech bubbles wait until it reappears.
- Following survives sleep, screen lock, display changes, Reduce Motion, and non-geometric edits (name, look, motion settings, status); the next frame after wake restores its position.
- Nothing is written to disk while streaming, and updates apply at most once per display frame (~60 Hz). Unchanged frames are no-ops unless they carry `"window"`, which only reorders; bursts skip straight to the newest frame.
- When following ends, the last shown position is saved once. A resident with gravity then falls according to its gravity, as after `place`; it never moves on its own.
The command exits `0` with one result line containing `reason`, `samples` (lines read), and `applied`. `applied` counts applied frames and excludes reorder-only repeats. Stop writing once it exits, as the next pipe write fails.
| `reason` | What happened |
| --- | --- |
| `callerEnded` | stdin ended. Stopping the CLI process ends the same way and saves. |
| `userGrabbed` | The user dragged, held (with long-press-to-move on), carried, or edited the resident. |
| `replaced` | Another `resident follow` or a validated `sequence start` took over the resident. |
| `residentStowed` | The resident was put away. |
| `residentHidden` | The resident was hidden (`resident set hidden` or Studio). |
| `stateChanged` | `resident place`, Studio, or the user moved or resized the resident; follow position is not saved. |
| `saveFailed` | Final position could not be saved (such as disk full); returns to the previous saved position. |
A plain click does not end following: the resident stays on the window, [`resident events`](#resident-events-cli-only) hears the click, and its click shortcut opens, though its click reaction does not play while riding. A touch reaction does not replace following.
**Refusals**: a line matching neither JSON shape ends the command with `rejected` / `malformedSample`, `path` `line N`, and the problem (exit `5`; last shown position is saved). A hidden, wallpaper-pinned, or user-held resident is refused up front (`hidden`, `wallpaperPinned`, `held`); `busy` means it is mid-motion (a throw or small action). Resident binding applies: a bound resident follows only through its `client:` selector.
> [!NOTE]
> **CLI only**
> There is no MCP tool for `resident follow`: MCP maps one request to one response and cannot stream frames into a running call.
## `pixling_resident_status`
Assigns a temporary state (a defined state name, an idle motion, or a pose) to your own bound resident. Nothing is saved.
```json title="MCP arguments"
{"to": "client:my-agent/main", "name": "thinking", "ttlMs": 120000}
```
| Argument | Value |
| --- | --- |
| `to` | Only `client:/` from `resident.ensure`; others fail with `invalidArguments` on `to` |
| `name` | 1–64 UTF-8 bytes, no edge spaces or control characters; look from [`pixling_status_define`](#pixling_status_define) |
| `animation` | An ID from [`describe`](/docs/reference/resident-settings/#pixling_resident_describe) `options.idleAnimation` |
| `pose` | A frame ID from `describe` `options.pose` |
| `clear` | `true` clears the active status |
| `ttlMs` | `1000`–`3600000`, default `600000` (10 minutes); cannot be used with `clear` |
Pass **exactly one** of `name`, `animation`, `pose`, or `clear: true`. An unknown ID fails with `rejected` / `animationUnknown` or `poseUnknown`. A `name` with no defined look is accepted and shows nothing.
```json title="Status response (result)"
{
"entityID": "0194e1a2-7b3c-7000-8000-000000000001",
"status": {
"name": "thinking",
"animation": "idle",
"entering": false,
"expiresInMs": 120000,
"shown": true,
"yieldsTo": null
}
}
```
- **Lifecycle**: a new call replaces the current status; resending the same name extends its TTL without replaying its `enter` sequence. A status ends on `clear`, TTL expiry, or app restart.
- **Result fields**: returns `{entityID, status}` (`status` is `null` after `clear`; `describe` reports the same object).
- `name` appears when set by name; `animation` or `pose` names the held expression when active.
- `entering` is `true` while the status's `enter` sequence plays.
- `missing` lists `enter` or `hold` if a referenced sequence, motion, or frame no longer exists, and that part is skipped.
- `question` (`promptID`) and `expiresInMs: null` appear when the status was set by `question.ask`.
- **When `shown` is `false`**: the status is stored but not displayed, and `yieldsTo` names why: `pose` (user pinned a pose), `motionOff`, `reduceMotion` (animation only), `hidden`, `asleep`, `sequence` (resumes once the run ends), or `unbound` (no look defined for `name`).
- **When `enter` is skipped**: `enter` is never queued. It is skipped if it cannot play immediately because of a pinned pose, motion off, Reduce Motion with a moving step, hidden, asleep, wallpaper layer, no free run, another sequence running, or the user composing to the resident or editing its settings. A question's own state still plays while its card waits.
- **Combined with messages and questions**: `message.send` and `question.ask` also accept `status` (a state name) for the same `client:` resident ([Messages and questions](/docs/reference/messages-and-questions/)).
> [!TIP]
> **Motion starts off on newly bound residents**
> A resident created by `resident.ensure` starts with motion off, so statuses yield to `motionOff` until you enable `motionEnabled: true` via [`resident.set`](/docs/reference/resident-settings/#pixling_resident_set).
CLI: `pixling resident status --to client:/` with `--name`, `--animation`, `--pose`, or `--clear`, plus `--ttl-ms`.
## `pixling_status_define`
Saves what a status `name` looks like for a resident's asset locally.
| Argument | Value |
| --- | --- |
| `to` | Any selector naming the asset (like `sequence.save`); `No.7` works even off the desk |
| `name` | The state name |
| `enter` | A sequence saved for this asset (`sequence.list`), played once when the state starts |
| `hold` | `{animation: }` or `{pose: }`, held for the rest of the state |
| `remove` | `true` deletes the name; cannot be combined with `enter` or `hold` |
Provide `enter`, `hold`, or both. Redefining an existing name replaces its look; each asset stores up to **32 names**. Updating a look updates residents already showing that state. Deleting a referenced sequence keeps the definition and reports it in `missing`.
- **Result**: `{assetID, statuses: [{name, enter?, hold?, missing?}]}` listing all names for the asset (`describe` mirrors them in `options.statuses`).
- **Refusals (`rejected`)**: `sequenceUnknown`, `animationUnknown`, `poseUnknown`, `bindingEmpty` (neither `enter` nor `hold`), `tooManyStatuses`, and `notFound` (`remove` of an unknown name).
CLI: `pixling status define --to --name ` with `--enter`, `--hold-animation`, `--hold-pose`, or `--remove`.
## `resident events` (CLI only)
`pixling resident events --to client:/` streams one JSON line per user click on your own resident while running. Nothing is buffered before you connect: clicks while no listener is attached are not replayed later. See [Hear clicks](/docs/connect/hear-clicks/) for a runnable script.
```sh title="Terminal"
pixling resident events --to client:me/key --exclusive |
while read -r line; do echo "got $line"; done
```
| Line | Meaning |
| --- | --- |
| `{"event":"click"}` | The user clicked the resident. |
| `{"event":"ended","reason":"residentStowed"}` | The resident left the desk (put away or binding moved). The command exits `0`. |
- **Targeting**: only `client:` selectors from `resident.ensure` are accepted; others fail with `invalidArguments` on `to`. Unbound or stowed keys are refused like `resident.status`; a binding off the desk fails with `rejected` / `notOnDesk`.
- **What counts**: plain clicks on the resident itself only; Pixling never observes other input. Clicks that only dismiss another resident's edit frame, drags, long presses, right-clicks, hovers, and wallpaper residents emit nothing.
- **`--exclusive`**: suppresses the resident's click reaction and click shortcut while listening, leaving hover reactions unchanged. Without `--exclusive`, normal click actions run alongside streaming. Every active listener receives every click.
- **Stopping**: press `Ctrl-C` to stop and restore normal click behavior immediately. If only the downstream pipe reader exits, `pixling` notices on the next click; with `--exclusive`, that click does nothing.
- **Exit codes and limits**: exit `3` means Pixling is unreachable or disconnected; exit `5` means refused (`tooManyWaiters` once **32 listeners** are already active on the desk). Slow readers queue at most **64 clicks** per connection and drop newer clicks.
> [!NOTE]
> **CLI only**
> There is no MCP tool for `resident events`: MCP answers one request with one response, and a polling tool would have to queue clicks on your behalf.
## `pixling_resident_emote` and `pixling_resident_throw`
### `resident.emote`
Pops an emoji or short text above one resident's head without a speech bubble. Each copy pops in, floats upward, and fades within ~2 seconds.
| Argument | Value |
| --- | --- |
| `to` | One placed resident |
| `text` | One line, `1`–`12` characters (such as `♪` or `!?`) |
| `count` | Number of copies, `1`–`8` (default `1`) |
| `color` | Single `#RRGGBB`: text color (inverse outline) and OKLab emoji tint. Without `palette`, overrides the resident palette |
| `palette` | `resident` (default: this resident's worn picture palette; uncolored text uses its accent with a high-contrast edge), `source` (original emoji / white text), any `resident.set` color set id (25 presets), or `1`–`16` `#RRGGBB` hex colors |
### `resident.throw`
Launches one resident with `velocity: {x, y}` in points per second (`+x` right, `+y` up, global coordinates unaffected by resident mirroring), capped at **3000 pt/s**.
With gravity, the resident arcs, bounces, and slides to rest on its gravity edge; without gravity, it glides, reflects off edges, and eases to a stop. `displayBoundary` and top-edge settings apply as in [Gravity](/docs/reference/resident-settings/#gravity). The final endpoint is saved before movement begins. Each call is a new throw, so do not retry an unanswered call.
### Results, refusals, and CLI
Both return `{entityID, accepted: true}`, and `throw` adds `durationMs` (the planned time to rest). Acceptance does not guarantee the user saw it. Refusals return `rejected` using the codes in [Light (glow)](/docs/reference/light/#result-and-refusals); `throw` adds `throwDisabled` (the resident's `throw` setting is off), `noTrajectory`, and `saveFailed`.
CLI: `pixling resident emote --to SELECTOR --text TEXT [--count N] [--color '#RRGGBB'] [--palette resident|source|SET|'#RRGGBB,...']` and `pixling resident throw --to SELECTOR --vx VX --vy VY`.
## `pixling_resident_bounce`
Squashes one resident's body against a side and springs it back once, like hitting a wall or floor. The anchored side stays fixed, the body shrinks only inward (never past its outline), and it returns with a small secondary dip.
| Argument | Value |
| --- | --- |
| `to` | One placed resident |
| `strength` | `> 0` and `<= 1` (default `0.5`); `1` compresses to `0.75×` along that axis over ~0.35 s |
| `direction` | `down`, `up`, `left`, or `right` (anchored side); default is gravity side (`down` if no gravity) |
Bounces stack multiplicatively on top of throws, landings, and other bounces, up to **4 overlapping** (a fifth replaces the one ending soonest). Returns `{entityID, accepted: true}`.
Refusals use the same codes as [Light (glow)](/docs/reference/light/#result-and-refusals), including `reduceMotion` and `sequenceRunning` (inside a sequence, use a cut's `bounce`), plus `spansDisplays` while straddling two displays.
CLI: `pixling resident bounce --to SELECTOR [--strength 0.5] [--direction down]`.
## `summon`, `duplicate` and `stow`
### `pixling_resident_summon`
Always creates a *new copy* on the desk and returns its brief row (`No.N#k`). Takes `who` plus optional `x`, `y`, `size`, `note`, and `groupID`.
- **`who`**: a Field Guide `No.N` or exact name from `zukan.list`. Passing a desk `No.N#k`, UUID, or `everyone` fails with `rejected` / `invalidWho`.
- **Placement**: without coordinates, spawns at the center of the current display at an apparent idle body of ~160 pt. With `x`, `y`, or `size`, follows `resident.place` rules (offscreen returns `offscreen`).
- **`groupID`** (CLI `--group-id`): joins that group in the same save. If no position is given, the copy appears beside an existing member on the desk where that member was last seen, matching `resident.ensure`'s [`groupID`](/docs/reference/resident-binding/#groupid). An unknown group returns `groupNotFound` without creating anything.
### `pixling_resident_duplicate`
Clones one placed resident along with its settings and group memberships. The clone is placed slightly offset and in front on the source's desk (unless the source is hidden) and returns the new copy's brief row.
### `pixling_resident_stow`
Removes one resident from the desk back to the Field Guide and returns `stowed` (`entityID`, `selector`, `name`, `number`, `ordinal`) and `remainingOnDesk` (remaining copies of the same asset). There is no bulk stow call.
The Field Guide entry remains, while this copy and its conversation are removed. Calling `summon` later creates a fresh copy, and a `resident.ensure` binding [stays stowed](/docs/reference/resident-binding/#lifetime).
## `pixling_resident_desktopVisibility`
Shows or hides residents on the currently active desktop, matching right-click › **On this desktop**. Takes `to` and `action`. Unlike other operations on this page, `to` may resolve to several residents (`No.7`, `everyone`); `auto` fails with `rejected` / `autoNotSupported`.
| `action` | Effect |
| --- | --- |
| `hideHere` | Hides the residents on the current desktop of each display they occupy; visible on other desktops. |
| `showHere` | Undoes `hideHere` on the current desktop and also clears **Hide** (`hidden`). |
| `onlyHere` | Shows the residents, clears every `hideHere`, and moves them once onto the current desktop (saved). |
- Operates per physical display on whichever desktop that display is showing; position, size, and physical display stay unchanged.
- `hideHere` lasts only until Pixling quits (not persisted; residents reappear after restart). Use [`resident.set`](/docs/reference/resident-settings/#pixling_resident_set) with `hidden: true` for a persistent hide.
- `onlyHere` is a one-time move: residents summoned later are unaffected, and after restart residents appear on the desktop Pixling started on.
- Residents bound to another client move as well, because moving is open to any caller. If no active desktop can be acted on, fails with `rejected` / `noActiveDesktop`.
**Result**: `{action, residents}`, where each resident entry carries `entityID`, `visibility` (read immediately from `residents.list`), and for `onlyHere` a `placement` value: `placed` (moved now), `preparing` (picture loading; moves once ready, so re-read `residents.list`), or `offscreen` (on no display, not moved).
> [!NOTE]
> **macOS desktop reporting lag**
> The reply returns immediately without waiting for the move. macOS can report the new desktop a moment late, so `placement` and `visibility` may briefly disagree; re-read `residents.list`, and if a resident still reports `otherDesktop`, call `onlyHere` again. A `preparing` move is cancelled if the desktop switches, the resident is moved, carried, or hidden, or it leaves the desk before loading finishes.
CLI: `pixling resident desktop-visibility --to SELECTOR --action hideHere|showHere|onlyHere`. Human output prints `desktop visibility ACTION: N resident(s)` followed by one line per resident with ID, `visibility`, and (for `onlyHere`) `placement`.
## Shapes and `pixling_resident_sketch`
Full `zukan.list` rows and [`resident.describe`](/docs/reference/resident-settings/#pixling_resident_describe) include `shapes`: one entry per stored resolution in the resident's pack, coarsest first, with `canvas` and `subject` dimensions in px, `aspect` (`width ÷ height`), `frames`, and `pixelArt`.
These reflect pack resolutions rather than live desk rendering, which is controlled by `settings.dots` and [`resident.set`](/docs/reference/resident-settings/#dots-dots-and-dotswrite)'s `dots`.
`resident.sketch` returns a coarse ASCII rendering of one resident cropped to its subject and scaled to `columns`, useful for understanding body geometry before choreographing motion or glow.
- **Target (`to`)**: either a desk copy (`No.N#k`, UUID, or `No.N`/name when exactly one copy is on the desk, drawn with its mirroring and active desk dots) or a Field Guide entry (`No.N`/name when off the desk or multiple copies exist, drawn from its coarsest stored pixel-art size).
- **`columns`**: `8`–`64` (default `32`, or `24` with `animation`); out of range fails with `rejected` / `invalidColumns`. Glyphs are `@` (dark), `#`, `+`, `.` (light), and space (transparent); each character cell is roughly 2 px tall.
- **Frames**: omitting `animation` draws the rest frame. Passing `animation` (an ID from `describe` `sequence.animations`) draws that motion's `frames` (0-based indices matching sequence cut `from`/`to`, up to `16`; omitting `frames` picks 8 evenly spaced frames).
- **Color groups (`colors: true`)**: replaces brightness glyphs with color-group letters `a`–`p` (`a` is the largest share) and adds `legend: [{glyph, color, share}]`. Pass a legend color directly to glow's `select.groups`.
- **Result**: `name`, `selector`, `width`, `height` (in dots of the sketched picture), `mirrored`, `columns`, `frames[]` (`frameID`, `rows`, `lines`, and `frame` for motion frames), `shapes`, and `animation` / `legend` when requested. Full-color-only residents fail with `rejected` / `noPixelArt`.
## `pixling_resident_pixels`
Reads exact source palette and pixel indices for one frame of the dots a placed resident is drawn with, without moving it or capturing the screen.
| Argument | Meaning |
| --- | --- |
| `to` | Exactly one placed resident (required) |
| `frame` | A frame ID from `describe` `options.pose`; default is rest pose (not currently displayed frame) |
| `offset` | Starting pixel index, `0`–`262143` (default `0`) |
| `count` | Pixel indices per page, `1`–`1024` (default `1024`) |
**Result**: `entityID`, `frame`, `width`, `height` (matching the dots the desk draws), `coordinateSpace: "source-top-left"`, `colorSpace: "source-rgba"`, `offset`, `indices`, `palette` (`#RRGGBBAA`), and `nextOffset` (integer, or `null` at the end).
- **Indexing**: `indices` are row-major (`x = (offset + i) % width`, `y = (offset + i) / width`) from top-left, before mirroring, rotation, or block projection. `0` is transparent; `n` maps to `palette[n - 1]`. Source colors exclude palette swaps, tone, and outline settings.
- **Pagination**: follow `nextOffset` until `null` with the same `frame`; restart from `0` if `width` or `height` changes mid-read.
- **Refusals (`rejected`)**: `unsupportedRepresentation` (full-color-only resident), `invalidFrame`, `invalidPage` (`offset` past the end), `invalidPixels`, and `busy` (only one pixel read runs at a time).
- **Use with glow**: pass palette colors or coordinates directly to [Light (glow)](/docs/reference/light/).
## Related
- [Resident settings](/docs/reference/resident-settings/): Describe and change a resident's look, dots, reaction hooks, speech paper, speech window, notifications, and gravity.
- [Resident binding](/docs/reference/resident-binding/): Bind a resident to an agent session with resident.ensure.
- [Sequences](/docs/reference/sequences/): Choreograph timed animations, movement, glows, and state machines.
- [Light (glow)](/docs/reference/light/): Standalone pixel light steps and shared refusal codes.
- [Messages and questions](/docs/reference/messages-and-questions/): Speech delivery, conversation state, and per-call status names.
- [CLI commands](/docs/reference/cli-commands/): Complete generated flag synopses for every pixling subcommand.
---
# Resident settings
> Describing and changing a resident's look, dots, reaction hooks, speech paper, speech window, notifications, gravity, and the settings-paper and right-click menu ledgers.
Inspecting and changing one resident's settings, look, reaction hooks, speech bubble, and gravity. For listing, placing, following, temporary status, emotes, summoning, and reading pixels, see [Residents](/docs/reference/residents/).
| Area | Jump to |
| --- | --- |
| Describe state, settings, and options | [`pixling_resident_describe`](#pixling_resident_describe) |
| Change settings (patch, order, hide) | [`pixling_resident_set`](#pixling_resident_set) |
| Dot density and color rules | [Dots (`dots`) and `dotsWrite`](#dots-dots-and-dotswrite) |
| Hover, click, grab, release, speak | [Reaction hooks (`hooks`)](#reaction-hooks-hooks) |
| Speech paper styling and folded mark | [Speech paper (`speech`)](#speech-paper-speech) |
| Speech window position and sizing | [Speech window (`speechWindow`)](#speech-window-speechwindow) |
| Gravity, strength, friction, displays | [Gravity](#gravity) |
| Settings-paper and menu ledgers | [The settings paper and `resident.set`](#the-settings-paper-and-residentset), [The right-click menu](#the-right-click-menu) |
> [!NOTE]
> **Single target and idempotency**
> `resident.describe` and `resident.set` target **exactly one** placed resident. `resident.set` writes absolute values, so repeating the same call produces the same state; omitted keys stay unchanged, and `null` (CLI `default`) restores each key's default.
## `pixling_resident_describe`
Returns one resident's full state: `resident`, `settings`, `options`, `shapes`, `sequence`, `upBoundary`, `status`, and `playback`. `resident` is the full `residents.list` row, `settings` holds the current right-click settings, and `options` lists the values allowed for this resident. Call `describe` before `resident.set`.
### `settings` fields
| Group | Keys |
| --- | --- |
| Placement & layer | `layer`, `presence`, `displayBoundary`, `hidden` |
| Gravity & throw | `gravity`, `gravityMenuBar`, `gravityCameraArea`, `gravityStrength`, `friction`, `throw` |
| Interaction & hooks | `clickThrough`, `clickShortcut`, `hooks` |
| Dots, palette & grain | `dots`, `palette`, `cellStyle`, `tone`, `grain`, `seeThrough` |
| Outline, shadow & sticker | `outline`, `outlineWidth`, `shadow`, `sticker`, `reflection`, `reflectionDetail` |
| Block, relief & volume | `block`, `reliefDetail`, `volumeDepth`, `volumeLight`, `volumeShadow`, `lightColor`, `volumeDepthBaked`, `surfaceMaterials` |
| Labels & highlights | `nameplate`, `nameplateColor`, `nameplateSeat`, `foldMarkSeat`, `highlight` |
| Motion & pose | `pose`, `motionEnabled`, `motionBlockedBy`, `motionFeel`, `motionTempo`, `motionFrameCount`, `motionFrameOffset`, `drift` |
| Idle animation | `idleAnimation`, `idleAnimationPinned` |
| Speech & notifications | `speech`, `speechWindow`, `speechFolded`, `notify`, `notifyQuestion`, `notifyMessage`, `sound`, `soundQuestion`, `soundMessage` |
Notes on specific `settings` values:
- **`dots`**: `{count, rule, thicken}` matching the paper's **Dots** page, or `null` when unavailable.
- **`nameplate` and `nameplateColor`**: `nameplate` is `hover` or `always`. `nameplateColor` is `speech` (the resident's own speech paper colors) or a `#RRGGBB` ground.
- **`highlight`**: the light around the body while the pointer is on its conversation: `speech` (the item paper's colors), `none`, or a `#RRGGBB` outer light.
- **`motionBlockedBy` and `motionFrameCount`**: `motionBlockedBy` is `nothing`, `thisResident`, or `appSetting`. `motionFrameCount` is `null` when drawn as authored.
- **`idleAnimationPinned`**: `true` while the user keeps one everyday motion, suppressing other motions and `occasional` sequences.
- **`speech` and `speechWindow`**: this resident's speech paper look and speech window geometry (`null` for automatic); see [Speech paper (`speech`)](#speech-paper-speech) and [Speech window (`speechWindow`)](#speech-window-speechwindow).
### `options` and value ranges
`options` holds this resident's `dots` choices, `pose` frame IDs, `idleAnimation` (`{id, name}`), and fixed vocabularies. Keys absent from `options` are unavailable on this resident.
| Key | Availability | Range and default |
| --- | --- | --- |
| `dots` | Pixel art > 8 dots on long side | `min` (`8`) to `max` (source count); `{min, max, quick, rules, source}` |
| `block` | Pixel art, canvas `<= 128 px` | `height`: `0` or `30`–`400`‰; `offset`: `10`–`150`‰ (`56`); `fieldOfView`: `50`–`150`% (`100`) |
| `reliefDetail` | Pixel art, canvas `>= 64 px` | `0`–`200` tenths (`0` off, `100` is `10.0`) |
| `volumeDepth` | Pixel art only | `0`–`80` tenths (`0` off, `40` is `4.0`) |
| `volumeLight`, `volumeShadow` | Pixel art only | `volumeShadow`: `0`–`100`% or `null` (measured from picture) |
| `tone` | Pixel art only | `tone.saturation`: `30`–`180`% (`100`); `tone.brightness`: `-36`–`36`% (`0`) |
| `grain` | Pixel art only | `grain.sizePercent`: `25`, `50`, `75`, `100` (`100`); `grain.transparencyPercent`: `0`–`80`% (`0`) |
| `motionTempo` | All residents | `25`–`200`% of normal speed (`100`) |
| `motionFeel` | All residents | `0` (no rest) or `10`–`1200` tenths of a second (`24` = 2.4–7.2 s) |
| `seeThrough` | All residents | `0`–`80`% fade under pointer (`0`; body opacity is `100%` minus value) |
| `outlineWidth` | Pixel art | `1`–`16` in 512ths of idle body's longest side (`4`), drawn as 1–16 cells |
Details for specific `options` keys:
- **`dots`**: matches the **Dots** page. `max` is the source count and leaves dots unchanged; `quick` lists quick-pick buttons under `max`; `rules` lists color rules (`recommended`, `mostCommon`, `contrast`, `region`, `threeGroups`, `median`, `average`, `centre`); `source` is `{width, height}`. Omitted for full-color residents and for sources of 8 dots or fewer on the long side.
- **`block`, `reliefDetail`, and volume**: canvases from 64 px to 128 px offer both `block` and `reliefDetail`. `block.height` and `block.offset` are whole permille of the canvas's longest side; `block.fieldOfView` is a whole percent. Volume keys are always present for pixel art and never for full color; whether the depth field is baked is state (`settings.volumeDepthBaked`), not availability.
- **`tone.brightness` and `motionFeel`**: positive `brightness` shifts toward white and negative toward black. For `motionFeel`, the shortest rest is the value in tenths of a second (1.0–120.0 s) and the longest rest is always 3× the shortest, so `24` rests 2.4–7.2 seconds.
- **`idleAnimation`**: lists the artwork's motions followed by every eligible saved sequence as `sequence:` (any sequence eligible for `occasional`: no `say`, `emote`, `bounce`, or `throw`).
- A sequence with only clips, holds under 3 seconds, and non-overlapping glows contained within their cut loops directly like a motion, lighting its glows on every loop.
- A sequence that moves, resizes, rotates, mirrors, shakes, fades, changes look, or holds longer plays once, rests according to the resident's rest setting, and repeats. Even `motionFeel: 0` (no rest) rests 1.2–4 seconds between plays, and it does not play while motion is off or in energy saving.
- If a chosen sequence is deleted or edited so it no longer qualifies, the resident reverts to its own everyday motion.
- **`hooks`**: `options.hooks` has `hover`, `click`, `grab`, `release`, and `speak`. Each event lists `builtin` (`poke`, `settle`, `pass`), `motion` (artwork motions from `idleAnimation`), and `sequence` (saved names for this asset from `pixling_sequence_save`). `speak` omits sequences that say something, and `click` also lists `bubble` (`open`, `write`).
- **`settings.hooks.`**: returns `{value, effective, layer}`. `value` is this resident's own choice or `null` for automatic, `effective` is what runs now, and `layer` is `entity`, `asset` (for a Create preset), or `app` (for the app default). The app defaults are `poke` on `speak`, `{"bubble": "open"}` on `click` (or `"none"` when `clickShortcut` is set), and `"none"` otherwise.
CLI human output prints one line per setting in the form `key: value (choices)`, for example `layer: floating (floating|window|wallpaper)`.
### Asking only for some sections
Pass `sections` as a non-empty array without duplicates from `resident`, `settings`, `options`, `shapes`, `sequence`, and `upBoundary`. `resident` includes identity, visibility, status, and playback. Partial responses always retain `entityID`. Omit `sections` to fetch everything.
## `pixling_resident_set`
Updates one resident's settings using `to` and a closed patch matching `settings` keys. Omitted keys stay unchanged; `null` restores the default (CLI: `default`). Every write follows the same validation path as the right-click menu.
```json title="MCP arguments"
{"to": "No.7#1", "gravity": "down", "motionEnabled": true, "seeThrough": 40}
```
```sh title="CLI equivalent"
pixling resident set --to 'No.7#1' --gravity down --motion true
pixling resident set --to 'No.7#1' --input '{"gravity":"down","motionEnabled":true,"seeThrough":40}'
```
```json title="Response (result, trimmed settings)"
{
"entityID": "0194e1a2-7b3c-7000-8000-000000000001",
"settings": {
"layer": "floating",
"presence": "everywhere",
"gravity": "down",
"motionEnabled": true,
"seeThrough": 40
}
}
```
The live response includes every key listed in [`settings` fields](#settings-fields), plus `dotsWrite` when `dots` was written (and `hint` if `dotsWrite` is `failed`).
- **Types**: `throw`, `clickThrough`, `hidden`, and `motionEnabled` are booleans; `dots`, `tone`, `grain`, `block`, and `shadow` are objects.
- **`hidden`**: `true` hides the resident while keeping its desktop, position, settings, and binding; `false` shows it again in the same spot. While hidden, `visibility` is `hidden`, messages are `held` with reason `hidden`, letters and questions wait, and glow, emote, throw, and sequences are refused with `hidden`.
- **`pose` and `motionEnabled`**: setting `pose` holds that frame and stops motion; `motionEnabled: true` releases it. Setting `motionEnabled: false` stops the resident on its current pose while keeping `pose: null`.
- **`order`**: moves the resident within its layer using `front`, `forward`, `back`, or `backmost` (CLI refuses `default`).
- **Volume baking**: writing volume properties to an unbaked resident starts the bake automatically; the effect appears once baking finishes.
- **Write order and partial failures**: items are written sequentially as individual changes. If the desk refuses an item (`appNotReady`, `saveFailed`, `sceneInvalid`), that item and later ones are not written, though earlier items may already have applied; call `describe` to confirm.
- **CLI output**: human output prints `changed ENTITY` followed by one line per item.
### Dots (`dots`) and `dotsWrite`
Pass `{count?, rule?, thicken?}` with at least one field, matching `settings.dots` so `describe` output can be echoed back. Omitted subfields stay unchanged, `null` restores the resident's default, and apparent size and center stay unchanged.
- **`count`**: long side in dots (`options.dots.min`–`options.dots.max`, preserving source proportions).
- **`rule`**: color rule from `options.dots.rules`.
- **`thicken`**: `true` keeps thin dark lines visible.
- **CLI**: `resident set --to --input '{"dots":...}'` or `pixling call resident.set`.
When the desk needs to generate a dot variant it does not yet hold, the call waits up to **3 seconds** and reports the outcome in `dotsWrite`:
| `dotsWrite` | Outcome |
| --- | --- |
| `committed` | Generated and stored; reflected in `settings.dots`. |
| `replaced` | Superseded by a user action or newer call; `settings` shows what won. |
| `pending` | Not ready in 3 seconds; stores once ready unless superseded. Re-read `describe`. |
| `failed` | Could not generate; dots stay unchanged, other items were stored, and `hint` is returned. |
The last choice wins, and unchanged subfields store nothing. `block` and `reliefDetail` in the same call are validated against the new dots. If the resident is stowed during the wait, the call fails with `targetNotFound`.
### Reaction hooks (`hooks`)
`hooks` configures reactions for five events:
| Event | When it triggers |
| --- | --- |
| `hover` | Pointer enters the resident |
| `click` | Plain click on the resident |
| `grab` | While held, from grab until release |
| `release` | Let go after dragging and come to rest, after any throw or fall lands |
| `speak` | When a message, letter, or question first shows |
- **Accepted values**: an object with exactly one of `{"builtin": "poke"|"settle"|"pass"}`, `{"motion": ""}`, or `{"sequence": ""}`; `"none"` for nothing; or `null` for automatic (asset default, else app default).
- **While held (`grab`)**: a motion loops, a builtin plays once on grab, and a sequence plays once and holds its last frame. A sequence's moves, size, rotation, flip, look, opacity, and throws are skipped while held, and its lights show only while held still, not while dragged.
- **Speaking sequences**: sequence `say` steps speak on `hover`, `click`, `grab`, and `release`; `speak` refuses sequences containing `say` (`sequenceSpeaks`).
- **Click bubble actions**: `click` also accepts `{"bubble": "open"}` (opens the folded or shrunk speech bubble) and `{"bubble": "write"}` (opens it along with the writing paper when a session is bound). The body plays nothing, and all other events and `message.send` `action` refuse bubble values (distinct from `speechWindow`, which positions the window).
- **Interaction with `clickShortcut`**: when both are set, both run, except a click that opens the speech bubble does not open the shortcut. If nothing has been said yet, the shortcut still opens.
- **Wallpaper residents**: only `speak` may be set.
- **CLI**: `resident set --to --input '{"hooks":...}'` or `pixling call resident.set`.
### Pre-write refusals
| Input | Refusal |
| --- | --- |
| Value absent from `options` | `poseUnknown` or `animationUnknown` (including reaction `motion`) |
| `dots` on a resident without `options.dots` | `dotsUnavailable` |
| Reaction `sequence` not saved for this asset | `sequenceNotFound` |
| `block`, `reliefDetail`, or volume where unavailable | `blockUnavailable`, `reliefDetailUnavailable`, or `volumeUnavailable` |
| Click shortcut or reaction on a wallpaper resident | `wallpaperPinned` |
| Out-of-range `tone`/`grain`/`dots.count`, bad `clickShortcut`, retired block, or `pose` + `motionEnabled: true` | `invalidValue` |
| Empty patch | `nothingToSet` |
In the CLI, `resident set` provides 10 everyday shorthand flags (`--layer`, `--presence`, `--gravity`, `--throw`, `--hidden`, `--click-through`, `--pose`, `--motion`, `--idle-animation`, `--order`) and `--input ` (exclusive with shorthand flags) for the full schema. Every key is also reachable via `pixling call resident.set`.
### The settings paper and `resident.set`
The resident's settings paper (right-click › **This resident's settings…**, or Studio's desk) and `resident.set` write the same underlying settings. Each row below maps `resident.set` keys and CLI flags to the settings-paper rows they cover (app tests apply both to the same resident and compare saved settings and gravity).
Navigation-only rows are omitted in favor of the rows on their subpages; palette color editing remains human-only. Entries marked `no row` correspond to paper actions (stop/play, order, hide).
Full settings-paper ledger (resident.set ↔ CLI ↔ paper rows)
| `resident.set` | CLI | Paper rows |
| --- | --- | --- |
| `layer` | `--layer` | `windowLayer` |
| `presence` | `--presence` | `presence` |
| `displayBoundary` | `--input` / `call` | `displayBoundary` |
| `gravity` | `--gravity` | `gravity` |
| `gravityMenuBar` | `--input` / `call` | `gravityMenuBar` |
| `gravityCameraArea` | `--input` / `call` | `gravityCameraArea` |
| `gravityStrength` | `--input` / `call` | `gravityStrength` |
| `friction` | `--input` / `call` | `friction` |
| `throw` | `--throw` | `throw` |
| `hidden` | `--hidden` | no row |
| `clickThrough` | `--click-through` | `clickThrough` |
| `clickShortcut` | `--input` / `call` | `clickShortcut` |
| `hooks` | `--input` / `call` | `hoverHook`, `clickHook`, `grabHook`, `releaseHook`, `speakHook` |
| `dots` | `--input` / `call` | `dots` |
| `palette` | `--input` / `call` | `palette` |
| `cellStyle` | `--input` / `call` | `grainCell` |
| `tone` | `--input` / `call` | `palette` |
| `grain` | `--input` / `call` | `grainSize`, `grainTransparency` |
| `block` | `--input` / `call` | `blockEnabled`, `blockHeight`, `blockViewpoint`, `blockOffset`, `blockFieldOfView`, `blockDepthSpacing` |
| `shadow` | `--input` / `call` | `shadow`, `shadowColorSource`, `shadowColor`, `shadowOpacity`, `shadowBlur`, `shadowOffsetX`, `shadowOffsetY`, `shadowSquash`, `shadowLength` |
| `sticker` | `--input` / `call` | `sticker`, `stickerColorSource`, `stickerColor`, `stickerGloss`, `stickerMargin`, `stickerThickness`, `stickerOpacity` |
| `reflection` | `--input` / `call` | `reflection` |
| `reflectionDetail` | `--input` / `call` | `reflectionOpacity`, `reflectionLength`, `reflectionGap`, `reflectionSquash`, `reflectionTilt`, `reflectionForm` |
| `outline` | `--input` / `call` | `outline`, `outlineColor` |
| `outlineWidth` | `--input` / `call` | `outlineWidth` |
| `reliefDetail` | `--input` / `call` | `relief` |
| `volumeDepth` | `--input` / `call` | `volumeDepth` |
| `volumeLight` | `--input` / `call` | `volumeLight` |
| `volumeShadow` | `--input` / `call` | `volumeShadowSource`, `volumeShadow` |
| `lightColor` | `--input` / `call` | `lightColor` |
| `surfaceMaterials` | `--input` / `call` | `surfaceMaterials` |
| `seeThrough` | `--input` / `call` | `seeThrough` |
| `nameplate` | `--input` / `call` | `nameplate` |
| `nameplateColor` | `--input` / `call` | `nameplateColorSource`, `nameplateColor` |
| `nameplateSeat` | `--input` / `call` | `nameplateSeat` |
| `foldMarkSeat` | `--input` / `call` | `foldMarkSeat` |
| `highlight` | `--input` / `call` | `highlight`, `highlightColor` |
| `speech` | `--input` / `call` | `speechPaper` |
| `speechWindow` | `--input` / `call` | no row |
| `speechFolded` | `--input` / `call` | no row |
| `notify` | `--input` / `call` | `speechPaper` |
| `notifyQuestion` | `--input` / `call` | `speechPaper` |
| `notifyMessage` | `--input` / `call` | `speechPaper` |
| `sound` | `--input` / `call` | `speechPaper` |
| `soundQuestion` | `--input` / `call` | `speechPaper` |
| `soundMessage` | `--input` / `call` | `speechPaper` |
| `pose` | `--pose` | `poseChoice` |
| `motionEnabled` | `--motion` | no row |
| `motionFeel` | `--input` / `call` | `motionFeel` |
| `motionTempo` | `--input` / `call` | `motionTempo` |
| `motionFrameCount` | `--input` / `call` | `motionFrameCount` |
| `motionFrameOffset` | `--input` / `call` | `motionFrameOffset` |
| `drift` | `--input` / `call` | `drift` |
| `idleAnimation` | `--idle-animation` | `idleAnimation` |
| `order` | `--order` | no row |
### Speech paper (`speech`)
`speech` styles this resident's speech paper like right-click › **This resident's settings…** › **Speech bubble**. Other residents and the app-wide look stay unchanged; to change all residents, use [`settings.set`](/docs/reference/settings/).
Omitted axes stay unchanged, and passing `null` for an axis follows the app-wide value for that row. Vocabularies live in `options.speech`.
| Axis | Values |
| --- | --- |
| `kit` | The speech parts kit the paper is drawn from, by name (`options.speech.kit`). The paper's shape, line, tail and shade are the kit's pictures |
| `colorway`, `colors` | Preset colorway, or custom `#RRGGBB` map (cannot combine both) |
| `clear` | See-through percent, whole number `0`–`80`, up to what the worn kit allows |
| `material` | The paper's material, worn where the kit offers it (`paper` is the kit's own) |
| `font`, `size` | Font choice and text size in whole points (`9`–`28`, unaffected by app text scale) |
| `motion`, `pace` | Reveal motion and speed (`25`–`400`% for `type`/`lines`; `100` normal, `200` twice as fast) |
| `shrink` | Whole quiet minutes (`1`–`60`) before shrinking to one line; `0` never shrinks |
| `textRelief`, `textReliefStrength` | Letter relief: `auto` (the worn kit's own), `none`, `raised`, `pressed`; strength `weak`, `medium`, `strong` for `raised` and `pressed`. Increase Contrast keeps the words flat |
- **Kits (`kit`)**: like a tile on **Outfits**, a kit is worn while the rest of the look stays. `kit: null` follows the app-wide kit. The factory look wears the built-in `quiet-card` kit; every build ships the built-in kits, and a name the desk does not offer (or none) wears `quiet-card`. A name the desk does not offer is refused by the writer with `path: "speech.kit"`. CLI: `resident set --to --input '{"speech":{"kit":"..."}}'`.
- **Resetting (`speech: null`)**: follows the app-wide look again.
- **Custom colors (`colors`)**: `{message?, question?: {surface?, text?, accent?}}` with `#RRGGBB` values. Clones the currently shown colors, changes only specified roles, and switches `colorway` to `custom`. `colors: null` and `colorway: null` follow app-wide colors again. Passing `colorway: custom`, combining `colors` and `colorway`, or passing an empty `speech` object is refused.
- **Folded-mark colors (`foldMark`)**: customizes the four colors matching **Message and question colors…**:
- **Fields**: `{letter?, line?, seal?, question?}`, each `#RRGGBB` or `null` to follow the resident's picture.
- **Auto-follow**: when following the picture, `letter` and `line` take its lightest and darkest colors, and `seal` and `question` take the name dot's color.
- **Clearing**: `foldMark: null` and `speech: null` clear all four.
- **Readback and CLI**: `settings.speech.foldMark` reports the active four colors, falling back to the speech bubble's colors when a resident has no picture colors (as in `settings.get`). CLI: `resident set --to --input '{"speech":{"foldMark":...}}'`.
- **Inheritance and validation**: setting a single axis to the app-wide value clears its override so it follows the app again. Unknown words, out-of-range `clear`, `pace`, or `shrink` (`speech.clear`, `speech.pace`, `speech.shrink`), and `colorway: custom` (`speech.colorway`) fail with `invalidArguments` naming the inner field. A key the paper no longer has (the vector paper's `paper`, `shape`, `corner`, `line`, `tail`, `shadow`, `style`, `relief`, `tickSize`, `outfit`, `savedPaper`, `mine`, gone 2026-11-26) is refused the same way, by its own field.
- **Reading back (`settings.speech`)**: reports effective values plus `colors` (only when `colorway` is `custom`) and `own` (overridden axes, including `foldMark` when custom).
### Speech window (`speechWindow`)
Places and sizes this resident's speech window, matching dragging the window or its edges by hand.
- **Format**: `{corner, dx, dy, width, height}` in points. `dx` and `dy` run from the center of the resident's resting body to the window's `corner` (`bottomLeft`, `bottomRight`, `topLeft` or `topRight`; default `bottomLeft`; `+y` up), the corner that stays put when the window takes another size. `settings.speechWindow` uses the same shape so you can copy it between residents.
- **`width`, `height`**: a number pins that axis at exactly that size (as a resize by hand pins both); `null` or omitted lets that axis fit the window's content (the height then follows the resident's display tier).
- **Resetting**: `null` restores automatic placement and sizing. The window follows its resident and stays pulled onto screen without overwriting the saved offset.
- **New-resident defaults**: when a person places or resizes a window by hand, newly created residents (including via `resident.ensure`) inherit that placement and pinned size unless overridden via `initial.settings.speechWindow`. Writing `speechWindow` from an agent never changes the default for new residents.
- **CLI**: `resident set --to --input '{"speechWindow":...}'` (`null` for automatic).
### Notifications and sound for one resident (`notify`, `sound`, …)
`notify`, `notifyQuestion`, `notifyMessage`, `sound`, `soundQuestion`, and `soundMessage` match the speech paper's **When something arrives** switches for this resident.
- Pass `false` to mute for this resident, or `null` to follow the app-wide setting again.
- Passing `true` is refused: the app-wide switch decides what is on, and a resident can only turn it off. Turning off a switch that is already off app-wide (or whose parent is off) fails with `rejected` / `arrivalOffForAll` and `path` naming the switch.
- `resident.describe` reports `false` when muted for this resident and `null` when following the app. CLI: `resident set --to --input '{"notify":false}'`, and so on.
### Folding the window (`speechFolded`)
`speechFolded: true` folds the resident's speech window into its folded mark; `false` reopens it. The window animates into and out of the mark, and arrivals queue as unread while folded. An open user composer keeps the window open by reopening it immediately, so read `settings.speechFolded` via `resident.describe` to verify. CLI: `resident set --to --input '{"speechFolded":true}'`.
### Name label and folded mark seats (`nameplateSeat`, `foldMarkSeat`)
Positions the name label (`nameplateSeat`) or folded mark (`foldMarkSeat`) on one of the seats in `options.nameplateSeat` or `options.foldMarkSeat`. Pass `null` for **Auto**. `settings.nameplateSeat` and `settings.foldMarkSeat` report the chosen seat or `null` when automatic. CLI: `resident set --to --input '{"nameplateSeat":...}'` or `foldMarkSeat`.
### The right-click menu
Every item in a desk resident's right-click menu and its agent equivalent (automated tests fail if a menu item is added without an entry here).
Full right-click menu ledger (menu item ↔ agent operation)
| Menu item | Words on the menu | From an agent |
| --- | --- | --- |
| `settings` | `This resident's settings…` | Opens the settings paper (its rows: "The settings paper and resident.set" above) |
| `geometry` | `Position and size…` | `resident.place` |
| `conversation` | `Past conversation` | `conversation.read` (oldest first; the user's words carry text only through the resident's own `client:`) |
| `motion` | `Stop / Play` | `resident.set` (`motionEnabled: false` stops; the menu stops on `pose` (the resting frame) when it has pose choices; `motionEnabled: true` resumes) |
| `order` | `Order among residents` | Opens the order submenu |
| `orderMove` | `Bring to front / Bring forward / Send backward / Send to back` | `resident.set` (order) |
| `editNeighbour` | `Names of covered residents` | `resident.place` (name the covered resident in `to`; people need this row because the one on top takes their clicks) |
| `carry` | `Take to another desktop` | People only: it follows the person's own desktop switching until they put it down; an agent puts a resident on the current desktop with `onlyHere` |
| `duplicate` | `Duplicate` | `resident.duplicate` |
| `hide` | `Hide` | `resident.set` (hidden) |
| `desktop` | `On this desktop` | Opens the desktop submenu |
| `hideHere` | `Hide this resident / Hide all residents` | `resident.desktopVisibility` (hideHere; `everyone` is refused while any resident is bound to an agent, so name each resident the agent may write) |
| `onlyHere` | `Show only this resident here / Show all residents only here` | `resident.desktopVisibility` (onlyHere; `everyone` is refused while any resident is bound to an agent) |
| `showHidden` | `Show hidden residents` | `resident.desktopVisibility` (showHere for each hidden resident; `everyone` is refused while any resident is bound to an agent) |
| `stow` | `Put away` | `resident.stow` |
| `openStudio` | `Open Pixling Studio` | People only: opens the Studio window for the person; an agent already reaches the desk directly |
| `quit` | `Quit Pixling` | `app.quit` |
### Gravity
| Key | CLI | Values and default |
| --- | --- | --- |
| `gravity` | `--gravity` | `none` (default), `down`, `left`, `right`, or `up` (`null` / `default` restores `none`) |
| `gravityStrength` | `--input` / `call` | Pull strength for falls and throws: `25`–`400`% (`100` default, `50` half, `200` double) |
| `friction` | `--input` / `call` | Slide/glide deceleration for throws: `25`–`400`% (`100` default) |
| `gravityMenuBar` | `--input` / `call` | `avoid` (default) or `ignore` for the menu bar's reserved band |
| `gravityCameraArea` | `--input` / `call` | `avoid` (default) or `ignore` for the camera notch area |
| `displayBoundary` | `--input` / `call` | `both` (cross/bounce across displays) or `single` (stay on starting display) |
- **Falling and tuning**: setting `gravity` lets the resident fall along the same finite arc as the right-click menu and saves where it lands. Neither `gravityStrength` nor `friction` moves a resident at rest; they shape the next fall or throw. Passing `null` or CLI `default` restores each key's default.
- **Top edge**: `gravityMenuBar` and `gravityCameraArea` are independent and apply to every gravity direction across falls, throws, bounces, and wall light placement. `avoid` stops below the menu bar's reserved band, while `ignore` reaches the display's physical top; other edges follow the display's visible area.
- **Multi-display behavior (`displayBoundary`)**: with `both`, upward gravity crosses into an upper display wherever the physical top-edge connection is wide enough for the whole body (passing the reserved band and camera area), and throws bounce across displays. With `single`, every fall, throw, and bounce stays on its starting display; you can still move the resident to another display manually.
- **Display metadata**: `safeAreaTop: 0` is an observation, not a claim about the Mac model; Pixling never guesses a camera notch from display names. `resident.describe` returns `upBoundary`: `active`, `ownerDisplayUUID`, `ownerConnected`, `regions` (currently allowed area), `portals` (`{lowerDisplayUUID, upperDisplayUUID, minX, maxX, y}`), and `endpoint` (`{x, y}` or `null`).
- **Creation defaults**: `resident.ensure` accepts the same keys in creation-only `initial.settings` ([Resident binding](/docs/reference/resident-binding/)).
## Related
- [Residents](/docs/reference/residents/): list, place, follow, set temporary status, emote, throw, summon, stow, and read pixels.
- [App settings](/docs/reference/settings/): change app-wide speech paper defaults and global notification switches.
- [Resident binding](/docs/reference/resident-binding/): pass creation-only `initial.settings` with `resident.ensure`.
- [Sequences](/docs/reference/sequences/): apply temporary `look` overrides during a timed sequence without modifying saved settings.
- [Messages and questions](/docs/reference/messages-and-questions/): speech delivery, arrival sounds, and per-call notification overrides.
- [CLI commands](/docs/reference/cli-commands/): complete generated flag synopses for every `pixling` subcommand.
---
# Resident binding
> The resident.ensure contract that binds a client namespace/key to one resident, with its arguments, result, states and refusals.
`resident.ensure` binds a client-chosen `namespace`/`key` pair to one resident and returns that same resident on every subsequent call with the same pair. The MCP tool is `pixling_resident_ensure`; the CLI command is `pixling resident ensure`. Both invoke the same operation and return the same document.
For an end-to-end walkthrough of choosing, binding, writing, and receiving, see [Give your agent a resident](/docs/connect/own-a-resident/). For retry behavior, see [Effects and retries](/docs/connect/effects/).
## Arguments
| Argument | Required | Value |
| --- | --- | --- |
| `namespace` | Yes | 1–64 bytes of ASCII letters, digits, `.`, `_`, or `-`; case-sensitive. |
| `key` | Yes | 1–128 bytes of the same character set; case-sensitive. |
| `assetID` | For a new key | Field Guide resident (`No.N`, exact name, or `pack/asset` ID); at most 512 bytes. |
| `name` | No | Session label: 1–60 characters, at most 240 UTF-8 bytes, nonblank, no control characters. |
| `note` | No | Creation-only remarks for the session, at most 200 characters. |
| `initial` | No | Creation-only placement and settings (see [`initial`](#initial)). |
| `groupID` | No | Creation-only group UUID from `group.list` (see [`groupID`](#groupid)). |
`assetID` accepts a Field Guide `No.N`, an exact name, or a `pack/asset` ID from `zukan.list` (`entries[].id`). `No.N` and names resolve using the same rules as `resident.summon`'s `who`:
- A name shared by two or more Field Guide residents fails with `targetAmbiguous`, with a hint suggesting `No.N`.
- An unknown asset fails with `rejected` / `unknownResident`.
- A placed copy (`No.N#k`) or `everyone` fails with `invalidArguments` on `assetID`.
- Unknown arguments, wrong types, and invalid characters or lengths fail with `invalidArguments`.
`name` labels only this session's resident and never renames the shared asset. For `note` and `initial.note`, see [Notes](/docs/reference/notes/).
### `initial`
```json title="initial payload"
{"placement": {"size": 80}, "settings": {"gravity": "down"}}
```
- `placement`: `x`, `y`, `size`, `rotation`, `mirrored`. Same fields as `resident.place`, without `to`.
- `settings`: Closed patch accepted by `resident.set` without `to`. Omitted keys keep their values, `null` restores the default where allowed, and every value must appear under `options` in `resident.describe`.
- `note`: Creation-only remarks for the resident itself, at most 200 characters.
Unknown fields or wrong types refuse the whole call. `initial` runs only when the key is new:
- **Atomic transaction**: Settings resolve first, the resident is placed with its final representation, and gravity settles it. Creation, placement, and settings commit together; if any step fails, no binding is left behind.
- **Error details**: Settings or placement errors return the same closed `rejected` detail as `resident.set` or `resident.place`, such as `dotsUnavailable`, `poseUnknown`, or `offscreen`.
- **`settings.dots`**: Accepted with the same refusals, though the result omits `dotsWrite`. Dots whose picture the desk must render appear once ready, so inspect them with `resident.describe`.
- **Defaults without `initial`**: A new resident appears at the center of the display with motion off, at the default summon size (apparent idle body of about 160pt), on the floating layer so it can display questions. Explicit `initial.settings` can override both layer and motion.
### `groupID`
With `groupID`, the new resident joins that group in the same save and spawns beside an existing member on the desktop (macOS Space) where that member was last seen, even if another desktop is active now.
- **Target desktop**: Pixling prefers a member on the currently active desktop; otherwise it picks the first group member seen on any desktop.
- **Exclusions**: Hidden members and members shown on every desktop do not count.
- **Fallback**: If no member has been seen on a desktop, or if `initial.placement` specifies a position, the resident spawns as without `groupID`.
- **Unknown group**: Fails with `rejected` / `groupNotFound` and creates nothing.
## Result
```json title="resident.ensure result"
{
"binding": {"namespace": "…", "key": "…", "selector": "client:…/…", "entityID": "…", "assetID": "pack/asset", "name": "…", "note": "…"},
"state": "onDesk",
"resident": {}
}
```
- **`binding.selector`**: Always `client:/`. Use it to address your resident.
- **Ownership lock**: Writes to a bound resident by `entityID` or any other selector fail with `boundToAnotherClient`. Anyone may still move it with `resident.place` or `resident.desktopVisibility`.
- **Optional fields**: `name` and `note` appear in `binding` only when set.
- **Cross-references**: `residents.list` and `resident.describe` rows also include `clientBinding`.
`state` describes the bound resident's current presence:
| `state` | `resident` field | Meaning |
| --- | --- | --- |
| `onDesk` | Full `residents.list` row | The resident is in the scene. |
| `stowed` | `null` | The resident was put away. |
| `unavailable` | `null` | The binding exists, but the resident cannot be listed. |
- **`onDesk` does not guarantee visibility**: Check `visibility` and `conversation` before asking a question.
- **`stowed` stays stowed**: Calling `ensure` again does not restore a stowed resident unless the binding was evicted (see [Lifetime](#lifetime)).
- **`unavailable`**: Occurs when the resident's asset is missing or otherwise cannot be listed.
## Resending and conflicts
- Passing `namespace` and `key` alone returns the current binding. Key lookup runs before checking the Field Guide or display.
- Passing `assetID` or `name` on an existing key must match the stored binding; otherwise the call fails with `rejected` / `clientKeyConflict`.
- An `assetID` that no longer resolves uniquely (such as a name now shared by two assets) is not treated as a conflict.
- For an existing key, `initial`, `note`, and `groupID` are ignored, preserving the user's own placement and settings.
- A new key without `assetID` fails with `rejected` / `creationRequiresAsset`.
## Refusals
Beyond the argument and conflict refusals above, `ensure` returns these scene refusals as `rejected` details (shared with `place`, `set`, `duplicate`, `stow`, `summon`, and `sketch`):
| Detail | Meaning |
| --- | --- |
| `appNotReady` | Pixling is starting, stopping, or reloading the desk. |
| `saveFailed` | The desk could not be saved; nothing changed. |
| `sceneInvalid` | The change failed validation; nothing changed. |
| `packLoadFailed` | The resident's pack could not be read. |
| `noDisplay` | No display is available for placement. |
| `offscreen` | The requested placement is outside every display. |
| `unknownResident` | The `assetID` for a new key is not in the Field Guide. |
| `clientBindingLimit` | The 4096-binding limit is reached and every bound resident is currently on the desk. |
Any failure matching no typed refusal returns `internalFailure`, with only the error type's name in `detail`.
## Lifetime
- **Saved across restarts**: Bindings persist locally with the desk across restarts, even after the resident is stowed.
- **4096-binding limit**: Bindings do not expire. When a new key needs room at the limit, Pixling evicts the oldest binding whose resident is off the desk; that evicted key then counts as new again.
- **Stowing preserves the tombstone**: Stowing keeps the binding in `stowed` state until evicted as above.
- **Missing assets**: An existing binding whose asset is missing reports `unavailable`.
- **Starting fresh**: Use a new `key` to start a new session explicitly. Creating a new resident under a new key does not recover a lost key's resident.
- **Serialized mutations**: Concurrent CLI and MCP calls to one app execute one at a time.
> [!CAUTION]
> **`namespace` is a correlation scope, not authentication**
> `namespace` and `key` prevent accidental cross-writes between clients, not malicious access. Never store secrets in a key or a name.
## CLI
```sh title="Terminal"
pixling zukan --json
pixling resident ensure --namespace codex --key session-123 --asset-id No.7 --name Piko --initial '{"placement":{"size":80},"settings":{"gravity":"down"}}' --json
pixling resident ensure --namespace codex --key session-123 --json
```
| Flag | Argument |
| --- | --- |
| `--namespace` | `namespace` |
| `--key` | `key` |
| `--asset-id` | `assetID` (`No.N`, exact name, or ID) |
| `--name` | `name` |
| `--note` | `note` |
| `--initial JSON` | `initial` (a JSON object) |
| `--initial-note` | `initial.note` (pass this or `initial.note`, not both) |
| `--group-id` | `groupID` |
Pass `client:/` to `--to` in subsequent commands. When the user chooses to end the session, run `pixling resident stow --to client:/`; the key remains `stowed` as described in [Lifetime](#lifetime).
## Related
- [Inbox](/docs/reference/inbox/): Watch, wait for, and read user messages sent to your bound resident.
- [Residents](/docs/reference/residents/): Place, configure, describe, summon, duplicate, and stow residents.
---
# Inbox
> The inbox.watch and inbox.read contract for receiving what the user writes to your resident and late answers, and the CLI inbox commands.
Messages the user writes to a bound resident, along with answers to earlier questions that no call was waiting for, sit in the inbox for that resident's `namespace`/`key` (see [Resident binding](/docs/reference/resident-binding/)). Nothing is pushed to your agent. For the walkthrough, see [Give your agent a resident](/docs/connect/own-a-resident/); for retry behavior, see [Effects and retries](/docs/connect/effects/).
```text
User message / late answer / user stow
│
▼
Inbox (namespace/key)
│ │
│ IDs + kinds │ body + mark read
▼ ▼
inbox.watch inbox.read
(or inbox wait)
```
`namespace` and `key` are the same correlation keys used by `resident.ensure`, not authentication. You can still read the inbox of a stowed resident.
The user can write to a bound resident at any time, producing a `kind: message` entry. Connecting a receiver for that `namespace`/`key` tells Pixling your session hears messages right away. Without a receiver, the input area shows a line noting that the message will not be read until your session checks, naming the session just like the resident's nameplate. Only the CLI's [`inbox receive`](#inbox-receive) holds a receiver; MCP cannot.
## `pixling_inbox_watch`
| Argument | Required | Value |
| --- | --- | --- |
| `namespace` | Yes | Client namespace bound via `resident.ensure`. |
| `key` | Yes | Client key bound via `resident.ensure`. |
| `waitMs` | No | Milliseconds to wait for unread entries: `0`–`55000` (default `0`). |
```json title="inbox.watch call"
{"namespace": "codex", "key": "session-123", "waitMs": 50000}
```
Returns unread entry IDs and kinds (`message`, `answer`, `closed`), never bodies or previews:
```json title="inbox.watch result"
{"messages": [{"messageID": "…", "entityID": "…", "sequence": 12, "kind": "message"}]}
```
- **Waits once and returns**: An empty array means nothing new arrived before `waitMs` elapsed; `0` returns an immediate snapshot.
- **No cursor or acknowledgment**: Unread IDs reappear on every call until you read them with `inbox.read`.
- **Safe to repeat**: Read-only and idempotent.
- **Waiter limits**: At most 1 pending wait per key and 32 app-wide; exceeding either fails with `rejected` / `tooManyWaiters`.
- **EOF cancellation**: Keep the sending side of the connection open while waiting; closing it (EOF) cancels the wait.
- **Unbound keys fail immediately**: A `namespace`/`key` never bound via `resident.ensure` fails with `rejected` / `notBound` without waiting.
- **Does not wake your host**: Watching only reports unread IDs to the active caller.
## `pixling_inbox_read`
| Argument | Required | Value |
| --- | --- | --- |
| `namespace` | Yes | Client namespace bound via `resident.ensure`. |
| `key` | Yes | Client key bound via `resident.ensure`. |
| `messageID` | Yes | Entry UUID returned by `inbox.watch`. |
```json title="inbox.read call"
{"namespace": "codex", "key": "session-123", "messageID": "…"}
```
Returns one entry and saves its read status:
```json title="inbox.read result"
{"messageID": "…", "entityID": "…", "sequence": 12, "kind": "message", "text": "…", "read": true}
```
### Entry kinds
- **`kind: message`**: Text the user typed to the resident.
- **`kind: answer`**: The user's answer to an earlier question given while no call was waiting.
- `text` is empty, `messageID` equals `promptID`, and `answer` holds `{promptID, outcome: answered|cancelled, selectedChoiceID?, selectedChoiceIDs?, enteredText?}`.
- `answer.outcome` is authoritative, including `cancelled`. No reply is required, and these entries do not appear on the desk.
- **`kind: closed`**: Written once when the user puts the resident away from the desk, Studio, or stow all.
- `text` is empty, and `closed` holds `{reason: userStowed, closedAt}` (ISO 8601).
- The resident accepts no further messages, while earlier unread entries remain readable. Any relay holding a receiver sees it end at the same moment.
- Your own `resident.stow` does not create this entry. `inbox.watch` lists only the `closed` entry for the resident the key is currently bound to.
### Read rules and refusals
- A `messageID` belonging to another key, or one no longer retained, fails with `rejected` / `notFound`.
- If saving the read state fails, no body is returned. A response lost in transit may still have marked the entry read; reading the same `messageID` again returns the same body for as long as it is retained.
- Reading an entry does not mark it understood or completed. Reply using `message.send` to `client:/`, never to `auto`.
## Limits
| Limit | Value |
| --- | --- |
| A user message | 1–4000 characters, nonblank, at most 16000 UTF-8 bytes; line breaks and tabs allowed. |
| Unread entries per key | 32 (`closed` entries do not count toward this limit). |
| Total retained entries | 256 across the inbox. |
| Read entries | Kept up to 7 days, or dropped earlier when room is needed. |
**Retention eviction**: Unread entries for a resident still on the desk are never dropped. When room is needed at the 256-entry limit, unread entries for off-desk residents drop first, oldest first, with `closed` entries dropped before others.
## CLI
```sh title="Terminal"
pixling inbox watch --namespace codex --key SESSION_KEY --wait-ms 50000 --json
pixling inbox read MESSAGE_ID --namespace codex --key SESSION_KEY --json
```
- **`inbox watch`**: Maps to `inbox.watch`. In the CLI, `--wait-ms` defaults to `50000` (maximum `55000`; `0` for an immediate snapshot). Without `--json`, it prints one ID per line or `no unread messages`.
- **`inbox read MESSAGE_ID`**: Maps to `inbox.read`. Without `--json`, human output depends on the entry kind:
- `message`: Prints the message body.
- `answer`: Prints `answer to question PROMPT_ID: answered (CHOICE_ID)` or `answer to question PROMPT_ID: cancelled`, with `text: …` on the next line for a typed answer.
- `closed`: Prints `closed by the user: userStowed at TIME`.
### `inbox wait`
```sh title="Terminal"
pixling inbox wait --namespace codex --key SESSION_KEY [--since SEQ] [--timeout-ms N] --json
```
Waits until something new arrives, prints the unread IDs, and exits. This is the building block for waking your agent [without the plugin](/docs/connect/wake/#without-the-plugin).
- **Event-driven, no polling**: Subscribes first to the app's payload-free Darwin notification, reads `inbox.watch` with `waitMs` `0`, and re-reads on each notification.
- **No waiter slot usage**: Does not consume the app's 32 `inbox.watch` waiter slots, so any number of sessions can wait simultaneously.
- **`--since SEQ`**: Counts only unread entries with a strictly greater `sequence`. Pass the highest `sequence` you have already handled so it does not return immediately; omit it to return on any unread entry or if the inbox restarts from sequence `0`.
- **Unreachable tolerance**: While Pixling is not running, restarting, or has **CLI connection** turned off, `inbox wait` logs once to stderr and keeps waiting. Other errors, such as an unbound key, return immediately as usual.
- **`--timeout-ms`**: With a positive timeout, exits `0` with the last read document (empty `messages`), or exits `3` with an `unavailable` document if Pixling was unreachable on the final read. Without it, waits indefinitely.
- **Parent lifetime**: Exits automatically when its parent process exits, including after a crash or `SIGKILL`.
- **Output**: Same document shape as `inbox watch`, with `messages` filtered by `--since`. Read bodies with `inbox read`.
Darwin notification name
`inbox wait` subscribes to `user.uid..app.pixling.inbox.`.
### `inbox receive`
```sh title="Terminal"
pixling inbox receive --namespace codex --key SESSION_KEY --json
```
Holds a receiver open for the key so Pixling knows your session hears user messages right away, suppressing the "not read until your session checks" note in the input area. Prints nothing while active and exits when the receiver ends.
- **Prerequisites**: The resident must be bound by `resident.ensure` and on the desk, and **CLI connection** must be on.
- **Concurrency**: Multiple receivers may hold the same key (the session counts as hearing while at least one is connected), up to 32 receivers total across the app.
- **Lifetime**: No time limit, heartbeat, or polling. Ends when the process or its parent exits (including crash or `SIGKILL`), and the app removes the receiver; parent exit returns exit code `3`.
- **No auto-reconnect**: Run it again when you want to resume receiving, for example after Pixling restarts.
- **Pair with `inbox wait`**: `inbox receive` neither wakes your host nor reads the inbox. Run `inbox wait` alongside it to react to new entries.
Exit outcomes:
| Exit code | Result | Meaning |
| --- | --- | --- |
| `0` | `{"reason": "userStowed"}` | The user put the resident away. The inbox also gets a `kind: closed` entry. Do not hold it again. |
| `3` | `unavailable`, `detail: disconnected` | Connection ended while holding: Pixling quit or restarted, or **CLI connection** was turned off. |
| `3` | `unavailable`, other `detail` | Pixling was unreachable or not ready yet. |
| `5` | `rejected`, `detail: notBound` | No `resident.ensure` binding uses this `namespace`/`key`. |
| `5` | `rejected`, `detail: notOnDesk` | The resident is not on the desk (for example, the user put it away). |
| `5` | `rejected`, `detail: tooManyWaiters` | 32 receivers are already held. |
Without `--json`, a user stow prints `receiver ended: userStowed`.
Relaying a wake into your host is outside Pixling itself. See [Wake your agent](/docs/connect/wake/) for which hosts support waking and how to wire it up.
## Related
- [Resident binding](/docs/reference/resident-binding/): Create and inspect the namespace/key binding that owns an inbox.
- [Messages and questions](/docs/reference/messages-and-questions/): Reply to user messages and understand how late answers land in the inbox.
---
# Light (glow)
> The arguments, limits, result and refusals of resident.glow and pixling resident glow.
`resident.glow` plays a one-shot light effect across one resident, without speech. Specify which pixels to light, their color, and the shape as a single step or a chain of up to 8 steps totaling at most 10 seconds. Pixling plays the light once and forgets it: there is no loop, no saved state, and nothing to read back.
For when to use light alongside messages, states, and sequences, see [Build expression](/docs/connect/expression/).
## MCP: `pixling_resident_glow`
`to` is required and must resolve to exactly one resident on the desk (`auto` and `everyone` are refused).
Provide either one step with its keys flat at the root, or `steps` (an array of 1–8 step objects with the same keys, without `to`). Providing both fails with `invalidArguments`.
| Key | Values | Default |
| --- | --- | --- |
| `select` | `"all"`, `{"colors": [...]}`, `{"groups": [...]}`, or `{"points": [...]}` | `"all"` |
| `color` | `"source"` (brighten each pixel's color) or `#RRGGBB` | `"source"` |
| `shape` | `pulse`: soft swell; `sweep`: directed wave; `blink`: three short flashes | `sweep` |
| `direction` | `left-to-right`, `right-to-left`, `top-to-bottom`, `bottom-to-top`, or `center-out` | `left-to-right` |
| `durationMs` | Integer `334`–`10000` (`blink` minimum `1002`; list sum max `10000`) | `1010` |
### Selection and coordinate rules
- **`"all"`**: Lights every opaque pixel.
- **`colors`**: 1–16 `#RRGGBB` values. Lights pixels whose displayed color (after the resident's color settings) or source color matches any listed hex value.
- **`groups`**: 1–16 `#RRGGBB` values. Lights every color in each color group containing a listed source color. Nearby colors merge into at most 16 groups; `resident.describe` lists them in `sequence.palette` as `{color, share, colors}` (largest area first), and `resident sketch --colors` uses the same groups. Pass a group's `color`.
- **`points`**: 1–64 unique `{"x", "y"}` points. Source pixel coordinates with the origin at the canvas top-left. Use `resident.pixels` to inspect the palette and coordinates.
- **Strict hex colors**: Colors must be exact `#RRGGBB`, with no surrounding whitespace, no 3-digit shorthand, and no alpha channel.
- **Direction and duration**: `direction` is valid only with `sweep` and is refused with any other shape. `blink` requires `durationMs` of at least `1002` (at most three flashes per second), and steps in a `steps` list sum to at most `10000`.
- **Unmirrored canvas frame**: Directions and points refer to the canvas before mirroring and rotation.
```json title="Example payloads"
{"to":"No.7#1","select":"all","shape":"pulse","durationMs":800}
{"to":"No.7#1","select":{"colors":["#FF0000"]},"color":"#FFFFFF","shape":"sweep","direction":"top-to-bottom"}
{"to":"No.7#1","steps":[
{"select":{"points":[{"x":2,"y":3},{"x":8,"y":4}]},"shape":"blink","durationMs":1200},
{"select":"all","color":"#66CCFF","shape":"sweep","direction":"center-out","durationMs":1500}
]}
```
## Result and refusals
Success returns `{entityID, accepted: true}`. This confirms acceptance, not that the user saw the effect. Enabling Reduce Motion afterward, showing the full-color `original` representation, or an on-screen change can still hide it, so there is no `played` field.
When the light cannot play at call time, Pixling returns `rejected` with a `detail` code and a `hint`:
| `detail` | Cause |
| --- | --- |
| `notOnDesk` | The resident is not on the desk. |
| `wallpaperPinned` | The resident is pinned to the wallpaper. |
| `deskOff` | Pixling's desk is turned off. |
| `hidden` | The resident is hidden. |
| `sequenceRunning` | A sequence currently owns the resident. |
| `reduceMotion` | macOS Reduce Motion is turned on. |
| `asleep` | The Mac is asleep or locked, or the display is off. |
| `arranging` | The user is rearranging residents. |
| `held` | The user is holding or adjusting the resident. |
| `notVisible` | The resident is not visible right now (for example, on another desktop). |
| `notDrawn` | No pixel-art frame is currently on screen to light. |
- **Shared refusal vocabulary**: [`resident.emote` and `resident.throw`](/docs/reference/residents/#pixling_resident_emote-and-pixling_resident_throw) share these refusal codes. Unlike `resident.glow`, `resident.emote` plays a fade-only version under Reduce Motion and follows the body while a sequence runs.
- **No speech or saved state**: A light involves no speech and saves nothing (see [Effects and retries](/docs/connect/effects/)).
- **Compatible representations**: Works while an indexed animation or a volume look is showing. On a volume look, light appears on its front pixel face.
- **Binding rules**: Writes to a bound resident follow the standard [binding rules](/docs/connect/own-a-resident/).
## CLI: `pixling resident glow`
| Flag | Argument |
| --- | --- |
| `--to SELECTOR` | `to` |
| `--select all\|colors\|groups\|points` | `select` (omitted, inferred from `--color-of` or `--point`, or `all` when neither is given). |
| `--color-of '#RRGGBB'` (repeat 1–16 times) | Colors for `select.colors`, or for `select.groups` when combined with `--select groups`. |
| `--point X,Y` (repeat 1–64 times) | `select.points`. |
| `--color source\|'#RRGGBB'` | `color`. |
| `--shape pulse\|sweep\|blink` | `shape`. |
| `--direction …` | `direction` (`sweep` only). |
| `--duration-ms N` | `durationMs`. |
| `--steps-json ''` | `steps` (at most 8 steps and 64 KiB). |
Combining `--steps-json` with one-step flags, or `--color-of` with `--point`, is a usage error (exit `64`).
With `--json`, output is the `resident.glow` document, and a `rejected` refusal exits with `5`. Human output prints the document's `hint` when no dedicated message exists.
```sh title="Terminal"
pixling resident glow --to 'No.7#1' --shape pulse --duration-ms 800
pixling resident glow --to 'No.7#1' --color-of '#FF0000' --color '#FFFFFF' --direction top-to-bottom
pixling resident glow --to 'No.7#1' --point 2,3 --point 8,4 --shape blink
pixling resident glow --to 'No.7#1' --steps-json '[
{"select":{"points":[{"x":2,"y":3}]},"shape":"blink","durationMs":1200},
{"select":"all","color":"#66CCFF","shape":"sweep","direction":"center-out","durationMs":1500}]'
```
> [!NOTE]
> **No legacy arrival keys or flags**
> `resident.glow` refuses `glowMs`, `glowPoints`, `glowDirection`, and `glowColor` as unknown keys, and `pixling resident glow` does not accept `--glow-ms`, `--glow-point`, `--glow-direction`, or `--glow-color`. `message.send` (`pixling message send`) keeps its own `glowMs` / `--glow-ms` and `glowPoints` / `--glow-point` arrival options.
## Related
- [Sequences](/docs/reference/sequences/): Sync frame-timed lights with motion clips, movement, emotes, and bounces.
- [Residents](/docs/reference/residents/): Inspect pixel palettes, sketch frames, and trigger emotes or throws.
---
# Sequences
> The steps, limits, results and refusals of sequence.start, get, cancel, save, list and delete, and the pixling sequence commands.
A sequence is a finite, app-timed plan for one resident: motion-clip cuts paired with simultaneous movement, sizing, turns, lights, and temporary looks, plus actions, throws, repeats, and screen-edge state machines. You send the plan in one call, and Pixling keeps time. It plays once and stops; it is not autonomous. For when to use sequences and a short example, see [Build expression](/docs/connect/expression/).
```text title="Sequence run lifecycle"
sequence.start ─┬─ dryRun: true ──▶ validated (does not run)
└─ run ──▶ accepted ──▶ preparing ──▶ running (⇄ paused)
│
┌──────────────────────┴────────────────────┐
▼ ▼
committing ──▶ completed cancelled / failed / expired
```
## Before you plan
Call [`resident.describe`](/docs/reference/resident-settings/#pixling_resident_describe) with `sections: ["sequence"]` to inspect what a resident supports right now:
- **`animations[]`**: `id`, `name`, `motion`, `cycleMilliseconds`, and `frameCount`. Pass `id` as a cut's `animation`. `motion` holds the description the clip was generated from, when present. A cut's `from` and `to` span `0.. 0`), matching `resident.place` `size`. |
| `sizeAnchor` | Stationary point while resizing: `bottom` (default), `center`, or any corner. |
| `turn` | Degrees from current angle, `−1440` to `1440` (counter-clockwise positive; `360` is one full turn). |
| `mirror` | `true`, `false`, `"toggle"` (flip facing), or `"either"` (random facing) from cut start. |
| `easing` | Curve for move and size: `smooth` (default), `linear`, named easings, `cubicBezier`, or `steps`. |
| `turnEasing` | Same forms as `easing`; defaults to the cut's `easing`. |
- **`move` and `move.via`**: for `{dx, dy}`, `+x` is right, `+y` is up, and an omitted axis defaults to `0`. Prefer `dx`/`dy` in saved sequences. `move.curve` defaults to `catmullRom` (passes through waypoints); `bezier` takes 1–2 control points that are not touched. Speed along the path is constant.
- **`sizeAnchor`**: accepts `bottom` (feet stay put), `center`, `bottomLeft`, `bottomRight`, `topLeft`, or `topRight`. A `dx`/`dy` move (including `via`) moves that anchor; an absolute `x`/`y` move refuses any value other than `bottom`.
- **`easing` and `turnEasing`**: named easings combine `easeIn…`, `easeOut…`, or `easeInOut…` with `Sine`, `Quad`, `Cubic`, `Quart`, `Quint`, `Expo`, `Circ`, `Back`, `Elastic`, or `Bounce` (for example, `easeOutBack`). Custom curves accept `{"cubicBezier": [x1, y1, x2, y2]}` (`x` in `0`–`1`, `|y| <= 4`) or `{"steps": n}` (`1`–`60`). `turnEasing: "linear"` spins at constant speed.
#### Screen-edge motion modes
| Key | Value |
| --- | --- |
| `walk` | `{direction?, speed, maxMs?}`: walks at `10`–`400` pt/s until a screen edge or `maxMs`. |
| `drift` | `{vx?, vy?, reflect?, maxMs?}`: glides at `10`–`1200` pt/s until a screen edge or `maxMs`. |
| `climb` | `true`: rolls 90° onto the edge the previous walk met. |
- **`walk`**: loops `animation` at `speed` (`10`–`400` pt/s) until hitting a screen edge or `maxMs` (`100`–`30000`). Stopping on `maxMs` fires `done`, not `wall*`. `direction` is `forward` (default: body's right, or left when mirrored) or `back`. Requires `animation`, and cannot combine with `move`, `size`, `turn`, `cycles`, `glow`, `opacity`, or frame-timed `emote`/`bounce`.
- **`drift`**: glides at constant 2D screen-space velocity `(vx, vy)` (`hypot(vx, vy)` `10`–`1200` pt/s; `+x` right, `+y` up; omitted axis defaults to `0`) until a screen edge or `maxMs` (`100`–`30000`). `animation` is optional (omitting it glides on the current frame; `holdMs` is refused). Cannot combine with `move`, `size`, `turn`, `cycles`, `glow`, `opacity`, or frame-timed `emote`/`bounce`.
- **`drift.reflect`**: `reflect: true` reflects the current drift velocity across the edge(s) hit (`left`/`right` flips `vx`, `top`/`bottom` flips `vy`, a corner flips both). If no drift has run yet, it uses this cut's `vx`/`vy` as the initial velocity; if the previous drift stopped on `maxMs`, it continues unchanged.
- **`climb`**: rotates 90° onto the edge the previous walk met, rolling into the corner at the walk's speed at an even pace (looping the clip to fill it) so the feet land on that edge and `forward` runs along it. Valid only as the first step of a state entered exclusively by single-edge wall transitions (`wall`, `wallLeft`, `wallRight`, `wallTop`, `wallBottom`). Lights, emotes, and bounces fire only at its start.
#### Visual effects, look, and speech
| Key | Value |
| --- | --- |
| `shake` | `{amplitude, frequency?, decay?}`: `0.5`–`64` pt, `1`–`30` Hz (default `12`), `decay` default `true`. |
| `opacity` | Target opacity (`0`–`1`) at cut end, shaped by `easing`; returns to `1` when the run ends. |
| `glow` | 1–8 [light steps](/docs/reference/light/) with optional clip `frame`. |
| `look` | Temporary `resident.set` appearance keys active from this cut until changed or run end. |
| `say` | `{text, author?, font?, size?}`: emits a message at cut start. |
| `bounce` | 1–8 `{strength?, direction?, frame?}` squash effects from `resident.bounce`. |
| `emote` | 1–8 `{text, count?, color?, palette?, frame?}` head pops from `resident.emote`. |
- **`shake`**: deterministic across runs.
- **`glow`**: each item is a [light step](/docs/reference/light/) (`select`, `color`, `shape`, `direction`, `durationMs`) plus optional `frame`, firing each time that clip frame shows. Without `frame` (and always in a `holdMs` cut), it fires at cut start.
- **`look`**: accepts [`resident.set`](/docs/reference/resident-settings/#pixling_resident_set) values for `palette`, `cellStyle`, `tone`, `grain`, `block`, `shadow`, `sticker`, `reflection`, `reflectionDetail`, `outline`, `outlineWidth`, `reliefDetail`, `volumeDepth`, `volumeLight`, `volumeShadow`, `lightColor`, `seeThrough`, `motionTempo`, `motionFrameCount`, and `motionFrameOffset`. Persists until another cut changes it and reverts when the run ends; saved settings are never modified.
- **`say`**: follows `message.send` rules without `keep` or arrival signals. The card follows the body and remains after the run. Refused on wallpaper-pinned residents (`wallpaperPinned`).
- **`bounce`**: matches [`resident.bounce`](/docs/reference/residents/#pixling_resident_bounce), stacked at cut start or on each showing of clip `frame` (`holdMs` cuts reject `frame`). Silently skipped under Reduce Motion or while straddling two displays.
- **`emote`**: matches [`resident.emote`](/docs/reference/residents/#pixling_resident_emote-and-pixling_resident_throw), firing at cut start or on each showing of clip `frame` (`holdMs` cuts reject `frame`). A newer emote replaces one still floating. Plays under Reduce Motion, is skipped without failing if the resident is unseen, and is refused on wallpaper-pinned residents (`wallpaperPinned`).
### Randomness: a different run each time
`cycles`, `holdMs`, `walk.maxMs`, `drift.maxMs`, and `repeat.times` also take a range `{"min": a, "max": b}` (both ends included). `mirror: "either"` faces a random way, and a `walk` follows the facing. A `choose` step plays one of its options drawn by weight; a `repeat` may hold a `choose`, and an option holds `cut`, `action`, and `throw` steps.
Pick a motion at random, play it 1–3 times facing either way, then rest 2–6 seconds, three to five times:
```json title="Fidget"
{"steps": [
{"kind": "repeat", "times": {"min": 3, "max": 5}, "steps": [
{"kind": "choose", "options": [
{"weight": 3, "steps": [{"kind": "cut", "animation": "m2", "cycles": {"min": 1, "max": 3}, "mirror": "either"}]},
{"kind": "cut", "animation": "m3", "mirror": "either"}
]},
{"kind": "cut", "holdMs": {"min": 2000, "max": 6000}}
]}
]}
```
- **Options**: an option is either `{weight?, steps}` or a single step written bare (weight `1`), as `m3` above. Pixling writes an option back bare whenever it has weight `1` and one step; refusals still name it `options[1].steps[0]`.
- **No repeats in a row**: `{"kind": "choose", "avoidRepeat": true, ...}` never draws the option it drew last at that place; the other options keep their weights. This holds within a run and across laps of everyday motion.
- **Random drift direction**: a `drift` may take `"angle"` (degrees, `0` is right, counter-clockwise) and `"speed"` (`10`–`1200` pt/s), each a number or a range, instead of `vx`/`vy`, for example `{"angle": {"min": 0, "max": 360}, "speed": {"min": 80, "max": 160}}`. Drawn values are multiples of `0.1`, so `drawn` stays readable and pastes back exactly.
- **Draws**: each run draws afresh from its `requestID`, and the same `requestID` always draws the same run. Calling `dryRun` with a `requestID` returns in `drawn` the exact steps `start` will play ([Dry run](#dry-run)). Every lap of everyday motion and every hook trigger draws anew.
- **Worst-case validation**: both ends of every range and every option are checked before anything plays, so a draw never fails a run. A plan that only fits some draws is refused, naming the offending field:
- **Cut cap**: each cut must fit 10 seconds at its maximum draw.
- **Start light**: a light firing at a cut's start must fit inside that cut's shortest draw.
- **Plan cap**: a plan without walks or drifts must fit 30 seconds at its longest draw (with each `repeat` at its max and each `choose` at its largest option).
- **Everyday motion**: a sequence with ranges or `choose` can be pinned or marked `occasional`, drawing anew each lap. Picture-and-light sequences are usually flattened afresh each lap; others play like a moving sequence with a rest between laps. `sequence.save` reports which path applies in `occasionalPlayback`, and its length is not shown in advance.
- **Size**: a plan writes out at most 128 steps, counting every option.
### States: react to the screen edge
When every top-level step is a `state`, the plan acts as a finite state machine starting at the first state and unrolled from the resident's starting position. Each state contains ordinary `steps` and up to 7 transitions in `on`:
```text title="Wall event fallback order"
Two edges at once ──▶ wallCorner ──▶ wallLeft/Right/Top/Bottom ──▶ wall ──▶ stop step, continue state
Single edge ──▶ wallLeft / wallRight / wallTop / wallBottom ──▶ wall ──▶ stop step, continue state
```
| `event` | Fires when | Without a transition |
| --- | --- | --- |
| `done` | All of the state's steps finish. | The run ends. |
| `wallCorner` | A `walk` or `drift` hits both a horizontal and a vertical edge together. | Falls back to the specific edge event, then `wall`. |
| `wallLeft`, `wallRight`, `wallTop`, `wallBottom` | A `walk` or `drift` hits that specific edge. | Falls back to `wall`. |
| `wall` | A `walk` or `drift` reaches any edge (no more specific match); remaining steps are skipped. | The step stops at the edge and the state continues. |
A plan can hold at most 16 states, with one transition per event, and every `to` must name a state in the plan.
Bounce diagonally across all four walls like a DVD logo until the 30-second budget expires (or continuously when saved, pinned as `idleAnimation: "sequence:"`, and set to `motionFeel: 0`):
```json title="Bounce across all four walls"
{"steps": [
{"kind": "state", "name": "dvd",
"steps": [{"kind": "cut", "drift": {"vx": 160, "vy": 110, "reflect": true}}],
"on": [{"event": "wall", "to": "dvd"}]}
]}
```
Walk to the edge, climb onto it, and keep circling the screen (to turn back instead, replace the second state's steps with `[{"kind": "cut", "animation": "m2", "mirror": "toggle"}]`):
```json title="Walk and climb around the screen"
{"steps": [
{"kind": "state", "name": "walk",
"steps": [{"kind": "cut", "animation": "m2", "walk": {"speed": 40}}],
"on": [{"event": "wall", "to": "climb"}]},
{"kind": "state", "name": "climb",
"steps": [{"kind": "cut", "animation": "m2", "climb": true}],
"on": [{"event": "done", "to": "walk"}]}
]}
```
- **Screen edges**: edges match the visible area of the resident's current display, respecting its gravity menu-bar and camera settings. A seam with another display counts as an edge, and walks and drifts never leave the display.
- **Termination**: runs stop when the 30-second or 128-step budget runs out, or when a transition returns to a state with no elapsed time and no change in facing, rotation, drift velocity, or pending reflections. If nothing can play from the starting position, the call fails with `invalidPlan`.
- **Position-dependent counts**: `totalSteps`, step indices, and `nominalMs` reflect the steps unrolled from the current position, so a dry run from another spot can differ.
- **Weighted branches**: `to` also accepts 1–8 `{"state": "…", "weight": 1–100}` entries drawn by weight. The same `requestID` always draws the same branch; each lap of everyday motion draws fresh.
- **Gravity and climbing**: residents with gravity do not climb; they turn around at the edge instead. Without gravity, `restore` turns back upright while `onSuccess` keeps the resident standing on the climbed edge. Grabbing ends the run and picks the body up upright.
#### Everyday motion and continuous chaining
Walks, drifts, climbs, and state machines can be marked `occasional` or pinned as usual motion when every `walk` and `drift` lives in a state whose wall transitions cover every edge it can hit.
- Each lap ends in place (saved like `onSuccess`), and the next lap resumes from there.
- When pinned with `motionFeel: 0` (**Always**, outside Low Power Mode), walks, drifts, and cyclic state machines chain 30-second laps with no rest.
- Chained laps carry their state, step, drift velocity, and temporary `look` across lap boundaries until the resident is touched or interrupted.
### Limits
- **Step counts**: up to 32 steps as submitted, 128 after `repeat` expansion. Step numbers in results count expanded steps (or unrolled steps for walks and states).
- **Durations**: at most 30 seconds total and 10 seconds per cut. Any run still unfinished after 60 seconds terminates as `expired`.
- **Side-effect caps**: at most 8 `say`, 32 `emote`, and 32 `bounce` per run after expansion.
- **Light rules**: lights never overlap, fire at most three flashes per second (`glowTooFrequent`), and must finish inside their cut (`glowOutsideCut`).
- **Screen boundaries**: paths may leave the screen or cross onto another display mid-run (like dragging by hand), and a move may finish off-screen. `crossDisplayPathUnsupported` is returned if a `commit: onSuccess` run would end outside every display, or if a `throw` step begins off every display or would leave its display under upward gravity.
- **Floor hopping**: a floor-standing resident that would dip below the display bottom while turning automatically hops high enough and lands within the same cut (`hoppedSteps`) without changing cut length.
- **Concurrency and ownership**: 1 run per resident (`busy`) and 4 active runs app-wide (`capacityExceeded`). `busy` also fires if another `sequence.start` on that resident is still validating; retry immediately. To coordinate multiple residents, send parallel `sequence.start` calls, which start within roughly one frame of each other. Residents bound to another client refuse writes (`boundToAnotherClient`).
- **Interaction with `resident.status`**: status updates during a run do not interrupt it; the resident reverts to the latest status when the run ends. A status's `enter` sequence uses the same admission rules and limits, is skipped (never queued) if blocked, and is stopped by an explicit `sequence.start`.
Clip frames, drifts, turns, shakes, actions, throws, and lights require motion and are refused when motion is unavailable:
| Condition | Refusal |
| --- | --- |
| The resident's **Motion** is off | `motionOff` |
| Motion is off for every resident | `appMotionOff` |
| macOS Reduce Motion is on | `reduceMotion` |
Moves, size changes, and holds still run. Under Reduce Motion, they apply at the start of their cut while preserving its duration (`reducedSteps` lists those steps). Enabling Reduce Motion mid-run cancels the run with `reduceMotion`.
### Dry run
`dryRun: true` executes every validation check (resident, frames, final geometry, lights) without running or recording anything:
```json title="Dry run result"
{"entityID":"…","state":"validated","totalSteps":2,"nominalMs":2400,"stepMs":[1200,1200],"ending":null,"hoppedSteps":[],
"drawn":[{"kind":"cut","animation":"m2","cycles":2,"mirror":true},{"kind":"cut","holdMs":1200}]}
```
- **`nominalMs`**: planned duration excluding the glide back.
- **`stepMs`**: duration of each expanded step after the cut's `motionTempo`, useful for aligning lights or emotes. Inspect clip key frames (such as jump apexes) with `resident.sketch`.
- **`hoppedSteps`**: 0-based expanded step indices of cuts that hop to clear the floor while turning.
- **`drawn` and `drawnMs`**: the concrete steps drawn for this `requestID` in the same schema as `steps` (`repeat` opened, `choose` resolved, ranges and `"either"` replaced by drawn values). Pasting `drawn` back as `steps` plays the same run, and `drawnMs` gives each entry's duration.
- A walk or drift longer than 10 s is one entry in `drawn` but several 10 s pieces in `stepMs`.
- A walk or drift already at its edge appears with `drawnMs` `0`; it still turned the resident and set the drift.
- A state machine returns `"drawn": null` with a `drawnNote`, because events pick each next state as it runs.
- **`ending`**: `null` when end matches start; otherwise `{distance, turnBack, scale, opacity, mirrored, lookChanged, returnMs, turnAtRelease}`. `distance` is in points, `turnBack` is in `−180` to `180°`, `scale` is the size ratio, and `returnMs` is the glide duration or `null` when it does not glide.
## Run receipt: `start`, `get`, `cancel`
`sequence.start` (without `dryRun`), `sequence.get {runID, waitMs}`, and `sequence.cancel {runID}` return the same receipt shape:
```json title="Run receipt"
{"runID":"…","entityID":"…","requestID":"greeting-1","totalSteps":2,"state":"running","completedSteps":0,"stepIndex":0,"reducedSteps":[],"reason":null,"survivesRestart":false}
```
- **`state`**: `accepted`, `preparing`, `running`, `paused`, `committing`, then terminal `completed`, `cancelled`, `failed`, or `expired`.
- **Waiting for completion**: a `start` receipt confirms acceptance, not completion. Call `sequence.get` with `waitMs` (up to `55000`) to wait until the run finishes or time runs out; omit `waitMs` for an immediate snapshot.
- **Progress fields**: `stepIndex` is the currently executing expanded step (or `null`, including during the glide back). `completedSteps` counts finished expanded steps.
- **`reason`**: explains non-`completed` endings: `cancelled`, `userInteraction` (touching the resident always wins), `lifecycle` (sleep, lock, or display off), `displayChanged`, `stateChanged`, `targetRemoved`, `reduceMotion`, `expired`, `executionFailed`, or `commitFailed`.
- **Idempotent cancel**: canceling an already ended run returns its receipt unchanged.
- **App-owned execution**: runs continue if the HTTP connection closes, and `get` returns promptly without holding a stream open. Runs do not survive an app restart. `get` and `cancel` only see your own active runs and your most recent ended run per resident; any other `runID` (including another caller's) returns `notFound`.
- **`requestID` retries**: resending the same `requestID` with identical content while the run is active returns the same receipt. Different content fails with `requestConflict` naming the active `runID` in `reason`. After the run finishes, reusing `requestID` starts a fresh run (see [Effects and retries](/docs/connect/effects/)).
## Saved sequences: `save`, `list`, `delete`
Saved sequences belong to an asset rather than an individual copy, so `to` accepts any selector identifying the asset (`No.7` does not need to be on the desk).
#### MCP
```json title="Save an occasional sequence (pixling_sequence_save)"
{
"to": "No.7",
"name": "fidget",
"occasional": true,
"steps": [
{"kind": "cut", "animation": "m2", "cycles": {"min": 1, "max": 2}, "mirror": "either"},
{"kind": "cut", "holdMs": {"min": 1000, "max": 2500}}
]
}
```
#### CLI
```sh title="Terminal"
pixling sequence save --to No.7 --name fidget --steps @fidget.json --occasional
```
- **`sequence.save {to, name, steps, occasional?}`**: saves steps without a target, `requestID`, or `commit`. Names are 1–64 UTF-8 bytes without leading or trailing spaces or control characters. Reusing a name replaces it in place. Limit: 32 saved sequences per asset (`capacityExceeded`). Steps validate against the asset's clips at save time.
- **`sequence.list {to, name?}`**: returns all saved sequences for the asset, or only `name` (`sequenceNotFound` if absent).
- **`sequence.delete {to, name}`**: removes one saved sequence (`sequenceNotFound` if absent).
### Marking a sequence `occasional`
Pass `occasional: true` to mix the sequence into everyday motion for that asset's residents, `false` to remove it, or omit it to keep the existing setting (CLI: `--occasional` / `--no-occasional`). Set `occasional: true` only when the user asks.
- Sequences containing `say`, `emote`, `bounce`, or `throw` cannot be marked occasional (`invalidPlan`, path `occasional`).
- Residents pinned to one motion, residents with no rest between cycles, and smooth (non-pixel) residents do not rotate.
- A moving occasional sequence plays at most once every 3 minutes per resident and yields to any explicit request.
### Save, list, and delete results
`save` returns only what it saved:
```json title="Save result"
{"asset":"pack/hero","name":"fidget","occasional":true,"replaced":false,"count":3,"remaining":29,
"occasionalPlayback":{"path":"runner","reason":"two waits in a row at steps[2]"}}
```
`count` and `remaining` are this asset's saved sequences and what is left of 32. On marked sequences, `occasionalPlayback` reports how everyday motion plays it, with `reason` naming the first thing that kept it off the lighter paths (such as `steps[1] moves the body`):
| `occasionalPlayback.path` | How everyday motion plays it |
| --- | --- |
| `drawnPerLap` | Picture-only with ranges or `choose`: drawn and flattened afresh each lap. |
| `loop` | Picture-only and fixed: one flattened loop. |
| `runner` | Played like a run, at most once every 3 minutes per resident. |
`list` and `delete` return `{asset, sequences: [{name, steps, occasional?, occasionalPlayback?}]}` in saved order (`occasional: true` and `occasionalPlayback` appear only on marked entries); `delete` returns the list that remains.
Play a saved sequence with `sequence.start {…, "name": "…"}`. Pixling revalidates it against what the resident currently shows; a missing clip fails with `animationUnknown`. Saved sequences also appear in the **Sequences** section of the asset's Field Guide page in Pixling Studio, where the user can play and edit them.
## Refusals
Sequence refusals return `rejected` with structured diagnostic fields:
| Field | Value |
| --- | --- |
| `error.detail` | The refusal code word. |
| `error.path` | Location using expanded step indices (for example, `steps[2].to`). |
| `error.reason` | One sentence naming the offending value. |
| `error.hint` | Actionable fix. |
When argument decoding rejects a request before it reaches the app, the same location and reason come back as `invalidArguments` with `field` and `problem`.
### Defined `error.detail` codes
| Category | Codes |
| --- | --- |
| Plan structure | `invalidPlan`, `invalidRequestID`, `unsupportedAction` |
| Assets and looks | `animationUnknown`, `unsupportedRepresentation`, `lookUnavailable`, `sequenceNotFound` |
| Timing and budgets | `durationExceeded`, `capacityExceeded` |
| Motion and physics | `invalidGeometry`, `crossDisplayPathUnsupported`, `throwDisabled`, `motionOff`, `appMotionOff`, `reduceMotion` |
| Light (glow) | `glowTooFrequent`, `glowOutsideCut` |
| Target and visibility | `singularTargetRequired`, `targetNotFound`, `notVisible`, `hidden`, `wallpaperPinned` |
| State and ownership | `boundToAnotherClient`, `busy`, `lifecycle`, `unavailable`, `resourceDenied`, `requestConflict`, `notFound` |
## CLI: `pixling sequence`
| Command | Operation |
| --- | --- |
| `sequence start` `--to SELECTOR` `(--steps JSON\|@file.json \| --name NAME)` `[--commit restore\|onSuccess]` `[--request-id KEY]` `[--dry-run]` `[--wait]` | `sequence.start` |
| `sequence get` `--run RUN_ID` `[--wait-ms MS]` | `sequence.get` |
| `sequence cancel` `--run RUN_ID` | `sequence.cancel` |
| `sequence save` `--to SELECTOR` `--name NAME` `--steps JSON\|@file.json` `[--occasional\|--no-occasional]` | `sequence.save` |
| `sequence list` `--to SELECTOR` `[--name NAME]` | `sequence.list` |
| `sequence delete` `--to SELECTOR` `--name NAME` | `sequence.delete` |
- `steps` uses the same JSON schema documented above. See [CLI](/docs/reference/cli/#sequence-start) for `--help` and refusal formatting.
- Without `--request-id`, each invocation generates a fresh key, so re-running starts a new run.
- `--dry-run` prints `ok: N steps, about S s (nothing ran)`, followed by `ends: …` when end differs from start (for example `ends: 110pt from home, turned 180°, look differs — glides back in 0.4 s`), `hops off the floor to turn: step N` (1-based), and `drawn: […]` as one line of JSON.
- `--wait` waits via `sequence.get` (`waitMs`) and prints the terminal state. If the run can no longer be read (because a later run on that resident ended or the app restarted), it reports that and exits `0` without claiming success or failure.
## Related
- [Light (glow)](/docs/reference/light/): Standalone pixel light syntax shared with sequence glow steps.
- [Residents](/docs/reference/residents/): Inspect animation clips, sketch frames, and run standalone actions.
- [Resident settings](/docs/reference/resident-settings/): Configure motion tempo, rest interval, reaction hooks, and appearance keys used by look.
---
# Groups and relations
> Organize individual residents with several group tags and define relationships within each group through CLI and MCP.
Groups tag *individual residents on the desk*, not Field Guide assets or saved sets. One resident can belong to multiple groups. Each relation definition belongs to one group, and its links connect two distinct members of that group (there are no group-to-group links).
Groups and relations are local metadata only. They never grant control permissions or make residents move or act on their own.
```text title="Data model"
Desk Resident ──M:N── Group (max 256)
│ 1:N
▼
Relation (max 1,024) ──1:N── Link: from → to (max 16,384)
```
## See memberships
Residents in at least one group show a group mark and count at the right end of their nameplate. Residents with no groups keep the single-line nameplate.
- **Inspect on the desk:** Click the group mark to view all group names. Press `Esc`, click `×`, or click outside to return to the desk. Reading groups works even without a session, while the name row keeps its usual conversation action for session-bound residents.
- **Inspect in Studio:** Studio's desk shelf and selected resident inspector show the same memberships.
- **Identical names:** Residents with identical names can belong to different groups and stay distinct entries. Membership edits and group renames appear once the scene is saved.
## Create a group and a relation
Address residents by individual ID or singular selector from `pixling residents`. Bound residents must be addressed via their own `client:namespace/key` selector.
#### CLI
```sh title="Terminal"
GROUP_ID=$(uuidgen)
RELATION_ID=$(uuidgen)
pixling call group.create "{\"groupID\":\"$GROUP_ID\",\"name\":\"Development\"}"
pixling call group.add "{\"groupID\":\"$GROUP_ID\",\"to\":\"client:codex/lead\"}"
pixling call group.add "{\"groupID\":\"$GROUP_ID\",\"to\":\"client:codex/member\"}"
pixling call relation.define "{\"groupID\":\"$GROUP_ID\",\"relationID\":\"$RELATION_ID\",\"name\":\"Leads\"}"
pixling call relation.link "{\"relationID\":\"$RELATION_ID\",\"from\":\"client:codex/lead\",\"to\":\"client:codex/member\"}"
pixling call relation.links "{\"relationID\":\"$RELATION_ID\"}"
```
#### MCP
MCP exposes the same operations using flat argument objects:
```json title="Create a group (pixling_group_create)"
{
"name": "pixling_group_create",
"arguments": {
"groupID": "11111111-1111-4111-8111-111111111111",
"name": "Development"
}
}
```
```json title="Define a relation (pixling_relation_define)"
{
"name": "pixling_relation_define",
"arguments": {
"groupID": "11111111-1111-4111-8111-111111111111",
"relationID": "22222222-2222-4222-8222-222222222222",
"name": "Leads"
}
}
```
- **Preconditions:** Both residents must already exist on the desk. Adding memberships does not create links automatically.
- **Join at creation:** A new resident can join a group immediately using `resident ensure --group-id` or `resident summon --group-id`. This saves the membership with the new resident and spawns it on the desktop where a member was last seen ([Resident binding](/docs/reference/resident-binding/#groupid)).
- **Multiple relations:** The same pair of residents can hold multiple relation types or separate relationships in different groups.
- **Idempotent creation IDs:** Creation accepts optional `groupID`, `relationID`, or `linkID`. Repeating the same explicit ID with identical content is a no-op; reusing it with different content is rejected. Omitting the ID generates a new group or definition on every call.
- **Safe link retries:** Links are keyed by their endpoint pair. Linking an already linked pair (with or without `linkID`) changes nothing and returns the saved link, making lost `relation.link` responses safe to retry.
## Operations
CLI calls use `pixling call ''` (or `pixling rpc`). MCP tools use `pixling_group_` and `pixling_relation_`.
| Operation | Arguments |
| --- | --- |
| `group.list` | `limit?`, `offset?` |
| `group.create` | `name`, `groupID?` |
| `group.rename` | `groupID`, `name` |
| `group.delete` | `groupID`, `clients?` |
| `group.members` | `groupID`, `limit?`, `offset?` |
| `group.add` | `groupID`, `to` |
| `group.remove` | `groupID`, `to`, `clients?` |
| `relation.list` | `groupID`, `limit?`, `offset?` |
| `relation.define` | `groupID`, `name`, `relationID?`, definition fields below |
| `relation.update` | `relationID`, `name`, definition fields below, `clients?` |
| `relation.delete` | `relationID`, `clients?` |
| `relation.links` | `relationID`, `limit?`, `offset?` |
| `relation.link` | `relationID`, `from`, `to`, `linkID?` |
| `relation.unlink` | `relationID`, `from`, `to` |
| `relation.fire` | `relationID`, `from`, exactly one of `to` or `all: true`, `clients?` |
`to` and `from` must resolve to exactly one existing individual (`auto` and `everyone` are rejected). Group and relation IDs are UUIDs from their list operations; names are display labels and need not be unique.
## Definition fields
| Field | Default | Meaning |
| --- | --- | --- |
| `name` | Required | Label for the relationship (nonblank single line, at most 60 graphemes and 240 UTF-8 bytes). |
| `symmetric` | `false` | Whether both endpoint orders represent the same relationship. |
| `color` | None | `#RRGGBB` for the cord and its pulse; omitted renders a neutral cord and white pulse. |
| `width` | `normal` | Cord width: `thin`, `normal`, `thick`, or `heavy`. |
| `glow` | `normal` | Pulse size: `small`, `normal`, or `large`. |
A directed relation preserves `from` and `to`: `A→B` and `B→A` are distinct links, and the cord draws an arrow. A symmetric relation treats `A—B` and `B—A` as one link with no arrow. Individuals have no per-resident link count cap and need not participate in any link. Relations carry no rank or roles.
> [!CAUTION]
> **`relation.update` replaces the entire definition**
> Omitted fields reset to the defaults above. For example, renaming a colored relation without re-sending `color` resets it to neutral. Switching a relation to `symmetric: true` while both `A→B` and `B→A` exist fails with `duplicateLink`; no links are silently merged or dropped.
## Bound residents and cascades
Direct endpoint writes require matching `client:` selectors. Listing a key in `clients` never bypasses a direct selector's binding check.
Cascades and definition edits can touch multiple bound residents. Pass up to 32 `namespace/key` strings in `clients` to authorize all affected bound endpoints before anything changes. Results never expose binding keys.
For example, removing a lead's membership also removes its links to bound members:
```sh title="Terminal"
pixling call group.remove "{\"groupID\":\"$GROUP_ID\",\"to\":\"client:codex/lead\",\"clients\":[\"codex/member\"]}"
```
Deleting a group affects all of its members; updating or deleting a relation affects both endpoints of all its links. Memberships and relations never authorize unrelated resident operations.
## Lifetime and persistence
- **Removing a membership:** Drops only that resident's incident links within that group; other groups stay intact.
- **Deleting a relation or group:** Deleting a relation drops its links. Deleting a group drops its memberships, definitions, and links while leaving the residents untouched.
- **Stowing a resident:** Drops its memberships and incident links while keeping existing client-binding tombstones and empty groups or definitions. Stowing keeps its normal target authorization, and incident links disappear without requiring counterpart keys because the endpoint is gone.
- **Visibility and display changes:** Hiding, minimizing, switching displays or Spaces, disconnecting displays, and unavailable asset packs all preserve memberships and links.
- **Duplicating, summoning, and overlays:** Duplicating a resident copies its memberships and *no links or bindings*. Newly summoned residents and residents added via set overlay start with no memberships.
- **Set replacement:** Retains the graph for retained resident IDs. One-step undo restores residents and the graph together, including links to residents outside the replacement target; any subsequent graph edit invalidates that undo.
Storage and atomicity guarantees:
- **Single transaction:** Graph edits validate, save, and publish the scene atomically. Failed validation or saving leaves the previous valid snapshot intact.
- **Shared revision:** Graph edits share the scene's revision with position saves, so an in-flight position save cannot overwrite a newer relation edit.
- **Local and fail-safe:** No polling, background reconciliation, or network activity occurs. The scene requires the graph field; a malformed document is preserved without resetting.
## Results, limits and refusals
Responses include `revision`, `changed`, and `total`, plus only the collection relevant to the call: reads return one bounded page (`groups`, `memberships`, `relations`, or `links`, empty if none); mutations return touched records; deletes and `relation.unlink` return no collection with `changed: true`.
```json title="group.list response (result)"
{
"revision": 3,
"changed": false,
"total": 1,
"groups": [
{
"id": "11111111-1111-4111-8111-111111111111",
"name": "Reviewers",
"memberCount": 2
}
]
}
```
```json title="relation.links response (result)"
{
"revision": 5,
"changed": false,
"total": 1,
"links": [
{
"id": "33333333-3333-4333-8333-333333333333",
"relationID": "22222222-2222-4222-8222-222222222222",
"from": "0194e1a2-7b3c-7000-8000-000000000001",
"to": "0194e1a2-7b3c-7000-8000-000000000002"
}
]
}
```
- **Row shapes:**
- Group row: `id`, `name`, `memberCount` (empty groups are visible without querying members).
- Membership row: `groupID`, `entityID`.
- Relation row: `id`, `groupID`, `name`, `symmetric`, `width`, `glow`, and optional `color`.
- Link row: `id`, `relationID`, `from`, `to`.
- **`relation.unlink`:** Fails with `linkNotFound` if no saved link joins the pair in that order; directed links must match their saved `from` and `to`.
- **Pagination:** List pages sort by stable UUID, default to `100` records (`limit` `1`–`200`, `offset` default `0`), and return `nextOffset` when more records follow. Compare `revision` across pages if concurrent edits matter, because pages are not a locked snapshot.
| Resource | Limit |
| --- | --- |
| Groups | 256 |
| Memberships | 8,192 |
| Relation definitions | 1,024 |
| Links | 16,384 |
| Entire scene document | 16 MiB |
Limits reject changes before publication; a failed save is never reported as success.
Domain refusals return `rejected` with a closed `detail` code and recovery hint:
| `detail` | Cause |
| --- | --- |
| `groupNotFound` | No group exists with `groupID`. |
| `relationNotFound` | No relation exists with `relationID`. |
| `entityNotFound` | Target resident does not exist on the desk. |
| `notGroupMember` | Resident is not a member of the relation's group. |
| `selfLink` | `from` and `to` resolve to the same resident. |
| `duplicateID` | Explicit `groupID`, `relationID`, or `linkID` was reused with different content. |
| `duplicateLink` | Conflict with an existing link (such as switching to `symmetric: true` with both directions present). |
| `linkNotFound` | No saved link connects the given endpoints in that order. |
| `limitExceeded` | Operation would exceed one of the resource limits above. |
| `boundToAnotherClient` | Caller lacks `client:` or `clients` authorization for a bound resident. |
Malformed arguments return `invalidArguments`. Unavailable graph storage disables graph capabilities.
## Pulse a saved relation
`relation.fire` sends a short train of transient lights along saved links: `count` lights (`1`–`10`, default `3`) depart one after another. Each light renders as a glow in `color` (`#RRGGBB`, defaulting to the relation's color or white) around a thin white core that stays legible on any wallpaper.
Pulsing never mutates scene data or revision, sends no message, wakes no agent, and does not propagate past direct links. Directed links fire from `from` to `to`; symmetric links accept either endpoint as origin.
#### CLI
```sh title="Terminal"
pixling call relation.fire "{\"relationID\":\"$RELATION_ID\",\"from\":\"client:codex/lead\",\"to\":\"client:codex/member\",\"color\":\"#7FD4FF\",\"count\":5}"
pixling call relation.fire "{\"relationID\":\"$RELATION_ID\",\"from\":\"client:codex/lead\",\"all\":true,\"clients\":[\"codex/member\"]}"
```
#### MCP
```json title="MCP tool call (pixling_relation_fire)"
{
"name": "pixling_relation_fire",
"arguments": {
"relationID": "22222222-2222-4222-8222-222222222222",
"from": "client:codex/lead",
"to": "client:codex/member",
"color": "#7FD4FF",
"count": 5
}
}
```
### Arguments and authorization
`pixling_relation_fire` arguments:
| Argument | Meaning |
| --- | --- |
| `relationID` | UUID of the saved relation. |
| `from` | Origin resident selector. |
| `to` or `all: true` | Exactly one: a target selector or `all: true` for all outgoing links (up to 32). |
| `clients` | Optional list of up to 32 `namespace/key` strings for bound indirect targets. |
| `color` | Optional strict `#RRGGBB` glow color; any other format fails with `invalidArguments`. |
| `count` | Optional light count: `1`–`10` (default `3`). |
- **Strict target rules:** Omitting both targets, combining `to` and `all`, `all: false`, unknown fields, `auto`, and `everyone` are rejected. `--all` selects every direct outgoing link in that relation; requests exceeding 32 links are rejected in full.
- **Direct endpoint bindings:** Direct bound endpoints require matching `client:` selectors. Passing UUIDs plus `clients` never bypasses direct binding protection.
- **Indirect targets (`all`):** `clients` authorizes bound targets reached indirectly via `all`. Every target (including hidden or filtered targets) is checked before any pulse begins; one missing authorization rejects the entire request with `boundToAnotherClient`.
### Pulse result and refusals
The response returns `relationID`, `graphRevision`, `startedCount`, `suppressedCount`, `remainingMilliseconds`, and `results`. Each row contains `linkID`, individual UUIDs `from` and `to`, and `state: started|suppressed`.
```json title="relation.fire response (result)"
{
"relationID": "22222222-2222-4222-8222-222222222222",
"graphRevision": 5,
"startedCount": 1,
"suppressedCount": 0,
"remainingMilliseconds": 1800,
"results": [
{
"linkID": "33333333-3333-4333-8333-333333333333",
"from": "0194e1a2-7b3c-7000-8000-000000000001",
"to": "0194e1a2-7b3c-7000-8000-000000000002",
"state": "started"
}
]
}
```
- An all-suppressed request still succeeds with `startedCount: 0`.
- Binding keys never appear in results.
- `started` confirms the effect was installed and its native owners passed immediate checks, not that anyone saw it or that it finished. Residents are never summoned, moved, or brought forward for a pulse.
Suppressed rows include `reason`:
| `reason` | Cause |
| --- | --- |
| `displayDisabled` | Relation cords or pulses are off on the target display. |
| `filtered` | Relation is excluded by the current display filter. |
| `displayLimit` | Display's static relation display capacity is full. |
| `notVisible` | Resident or endpoint is not currently visible on screen. |
| `ownerUnavailable` | Native desk presentation owner is not available. |
| `lifecycleSuspended` | Desk presentation lifecycle is suspended (for example, paused or inactive). |
| `carried` | An endpoint resident is currently being dragged or carried. |
| `editing` | An endpoint is in an editing state that suppresses pulses. |
Request-level refusals:
| Code | Cause |
| --- | --- |
| `relationNotFound` | No relation exists with `relationID`. |
| `notGroupMember` | `from` or `to` is not a member of the relation's group. |
| `selfLink` | `from` and `to` resolve to the same resident. |
| `linkNotFound` | No saved link connects `from` and `to` in this relation. |
| `invalidDirection` | Directed link exists only in the opposite direction. |
| `noLinks` | `all: true` found no direct outgoing links from `from`. |
| `boundToAnotherClient` | Caller lacks authorization for a direct or indirect bound endpoint. |
| `tooManyLinks` | `all: true` matched more than 32 outgoing links. |
| `busy` | Presentation layer is temporarily busy; may include `retryAfterMilliseconds`. |
| `capacityExceeded` | Active-effect capacity reached; may include `retryAfterMilliseconds`. |
| `rateLimited` | Pulse rate limit reached; may include `retryAfterMilliseconds`. |
Static display capacity has no retry time; narrow the display selection in Studio instead. Hidden or filtered targets never retry automatically.
> [!CAUTION]
> **Do not auto-retry a lost pulse response**
> Every call starts a fresh pulse. There is no deduplication, queue, delayed receipt, or replay when a Space becomes active again. The capability is advertised only when graph, binding, selector, and presentation services are installed, and unavailable graph or binding reads fail closed.
## Related
- [Resident binding](/docs/reference/resident-binding/): Join a group at creation time with groupID and manage client: selectors.
- [Light (glow)](/docs/reference/light/): Play standalone pixel lights directly on an individual resident.
---
# Import
> The import.prepare and import.adopt contract for bringing the user's own picture, GIF or video in as a resident, and the CLI import commands.
`import.prepare` builds a draft resident from a user's own picture, GIF/APNG/WebP, or video, and `import.adopt` saves that draft into the Field Guide. Nothing is saved before `adopt`, and nothing is uploaded.
The MCP tools are `pixling_import_prepare` and `pixling_import_adopt`; the CLI commands are `pixling import prepare` and `pixling import adopt`. Both return the same JSON documents.
```text title="Import flow"
copy source(s) to importFolder (CLI does this automatically)
│
▼
import.prepare ──▶ inspect preview PNG & warnings ──▶ adjust scale / foot / motions
│
▼
import.adopt ──▶ Field Guide (No.N) ──▶ resident.summon
```
> [!NOTE]
> **One character at a time**
> Prepare and adopt one character completely before starting the next.
## The import folder
Pixling reads source files only from its own import folder. `capabilities.get` returns it as `importFolder` (`{path, previews}`), and the CLI prints it as the last line (`import folder: …`).
In the App Store build, the folder is:
```text title="App Store import folder"
~/Library/Group Containers/group.app.pixling.studio/imports/
```
Other builds and apps reached with `--socket` use their own location, so read `importFolder` instead of hardcoding it. The app creates the folder when it reports it, so it exists before you copy files into it.
- **MCP callers:** Copy each file into `importFolder.path` under an unused filename, then pass the bare filename as `file`. Keep the file there unchanged until `adopt`, because videos are read from it.
- **CLI callers:** The CLI copies files into the import folder for you, so it never receives `pathNotInImportFolder`.
- **Path restrictions:** A `file` or `files[].file` containing `/` or equal to `~` is refused without being read (`pathNotInImportFolder`), with `error.importFolder` and `error.hint`. `fileNotFound` also carries `error.importFolder`.
- **Disallowed names and links:** Hidden files and names containing `:` fail with `invalidArguments`. Symlinks and aliases are not followed.
## `pixling_import_prepare`
Builds a new draft, adds or edits motions on an existing draft, or reopens an already imported resident.
```json title="MCP request (pixling_import_prepare)"
{
"file": "walk.gif",
"motionName": "walk",
"dotMode": "grid"
}
```
```json title="MCP result (abbreviated)"
{
"draftID": "8b4c9e12-3f4a-4b6c-9d1e-000000000001",
"dotMode": "grid",
"availableDotModes": ["grid", "as-is"],
"width": 32,
"height": 32,
"colors": 18,
"frames": 6,
"suggestedName": "walk",
"motions": [
{
"motionID": "8b4c9e12-3f4a-4b6c-9d1e-000000000002",
"name": "walk",
"role": "idle",
"keptFrames": 6,
"reason": "grid",
"footOnCanvas": { "x": 16, "y": 31 }
}
],
"preview": { "path": "imports/.previews/8b4c9e12-3f4a-4b6c-9d1e-000000000001.png", "width": 512, "height": 512, "zoom": 16 }
}
```
| Argument | Value |
| --- | --- |
| `draftID` | Draft to edit; omit to start a new one. |
| `file` | Bare filename in the import folder; starts the draft or adds a motion. |
| `files` | 1–8 items `{file, motionName?, startMs?, endMs?, scale?, foot?}` in order, instead of `file`. |
| `motionID` | Motion to change or remove (from a previous result). |
| `startMs`, `endMs` | Clip span for a moving source, at most 5 s (default: first 5 s). |
| `motionName` | Motion name (defaults to the filename). |
| `dotMode` | `grid` or `as-is` (see below). |
| `scale` | Motion size (see below). |
| `foot` | Motion foot point (see below). |
| `remove` | `true` removes `motionID` from the draft. |
| `assetID` | Reopen an imported resident as a new draft (passed alone). |
GIF clip cuts (`startMs`, `endMs`) snap to frames; videos are sampled at 24 fps.
How calls combine:
- **Start a draft:** Omit `draftID` and pass `file` (or `files`).
- **Add a motion:** Pass `draftID` and `file` to add another motion, up to **8 motions**.
- **Edit or remove a motion:** Pass `draftID` and `motionID` to change its span, name, `scale`, or `foot`, or pass `remove: true` to drop it.
- **Inspect without changing:** Pass `draftID` alone to fetch the current report and preview again.
The first motion is the one the desk plays (`role: idle`). One character holds up to **132 frames** and **one palette**.
### Several files at once
`files` adds each file as a motion, in order. Without `draftID`, the first file starts the draft and the rest are added; with `draftID`, all are added to it. Only `draftID` and `dotMode` may accompany `files`.
All files are read, added in one edit, and built once, returning a single report and preview. The batch is **all-or-none**: if any file is refused, the whole call fails and the draft stays unchanged. A refused call that would start a new draft does not drop any other draft.
- **Per-file errors:** `error` carries `fileIndex` (counting from `0`) and `file` only when a single file causes the refusal.
- **Combination errors:** Refusals of the combined draft (`tooManyMotions` against the draft's motions, `tooMuchInOneCharacter`, and `tooLargeForDots`) omit `fileIndex` and `file`.
- **Shared limits:** Limits on motions (8), frames (132), and the canvas budget match adding files one at a time.
### Reopening an imported resident
Pass only `assetID` to reopen an earlier imported resident as a new draft, with its motions preserved at one dot per pixel.
`assetID` accepts the full ID (`pixling.imported.…/resident.…`), the Field Guide `No.N`, or the exact name. Names resolve like `resident.summon`'s `who`, and desk placement selectors (`No.N#k`) are not accepted. Imported residents are searched before built-in residents with the same name; any string not shaped like an imported ID is tried as a name first.
- `assetAmbiguous`: Multiple imported residents share the name; pass `No.N`.
- `assetNotImported`: The name or ID matches a resident that was not imported.
- `assetNotFound`: No matching resident is installed.
- `assetID` cannot be combined with `draftID`, `file`, `files`, or `motionID`.
The result includes `replacesAssetID` (the resolved full ID). Edit the draft with `draftID` as usual; `adopt` then replaces that resident in place with `replaced: true` and the same `assetID` and `No.` number. If `sourceChanged` is returned, the resident changed after the draft was opened, so reopen it.
### Size: `dotMode` and `scale`
`dotMode` applies to the whole draft, and only when `availableDotModes` offers both values. A reopened draft starts as `as-is`; adding a motion with a detected grid makes `grid` available too, while reopened motions stay one dot per pixel.
- **`grid`:** Folds each detected cell of enlarged pixel art back to one dot. A low-confidence grid (`grid.confident: false`) folds only when no motion has a confident grid, or when that motion sets `scale: "dots"` (beside a confident grid, it is likely art at its own size).
- **`as-is`:** Keeps one dot per source pixel, shrinking only past the 1280 edge or the character's budget.
`scale` applies to the motion added by `file`, each item in `files`, or `motionID` (including reopened motions), and persists across later edits:
- **`auto` (default):** Pixel art (detected grid, or at most 128 colors and 512 px) and reopened motions stay one dot per pixel. Everything else height-matches the anchor motion.
- **`dots`:** One source pixel per dot (or one grid cell per dot with `dotMode: grid`).
- **`match`:** Height-matches the anchor motion and never enlarges. The anchor is the first one-dot-per-pixel motion, or otherwise the first motion. Reopened motions ignore `match` and stay 1:1 with `reason: dotArtOneToOne`.
- **Number (`0.01`–`1` or integer `2`–`8`):** Dots per source pixel. Integers `2`–`8` enlarge by nearest neighbor. Below `1`, pixel art shrinks by nearest neighbor to preserve exact colors, while photos and videos are averaged. Use `dotMode: grid` to undo enlargements cleanly. Passing a number other than `1` on a reopened motion redraws it from its dots.
Passing `scale` without `file` or `motionID`, or alongside `remove` or `assetID`, fails with `scaleNeedsMotion`. An out-of-range number fails with `invalidScale`.
Sources over 2048 px and canvas budget shrinking
- **Over 2048 px:** A source longer than 2048 px on a side is decoded smaller, so `scale` and `foot` use decoded pixels. When that shifts the result by more than 1% per original pixel, `warnings` includes `scaleAdjusted` (`motionID`, `requested`, `applied`).
- **Canvas limits:** Past the 1280 edge or the `canvas × frames` budget, motions that are not grid-folded shrink to fit. Frame count alone never causes shrinking; frames beyond 132 are thinned. The shrink rate is shared across motions, except whole-number enlargements stay whole, so effective rates can differ per motion.
### Foot point: `foot`
Each motion's foot point lands on one shared point of the character canvas rather than aligning box bottom centers. The canvas is the smallest rectangle containing all motions. The 1280 edge and budget apply to this aligned canvas, emitting `shrunkToFitLimits` if motions had to shrink.
- **Default detection:** Measured on the first frame within the bottom `N` rows, where `N = max(2, 3% of opaque height)`. The foot is the midpoint between the leftmost and rightmost opaque pixels on the lowest row. Pictures without transparency (such as photos) use the bottom center with `high` confidence.
- **Reopened motions:** All reopened motions share one point to keep their relative positions: the first reopened motion's explicit `foot`, or its detected foot. Removing that motion moves the shared point to the next reopened motion. New motions align to the idle motion's foot.
- **Low confidence:** `confidence` is `low` when any of the following hold:
- The first frame is empty.
- The first frame's lowest row sits more than 8% of opaque height above the median lowest row across frames (it starts in the air).
- The foot is more than 20% of height sideways from the core center of mass, measured across the rows at 20–80% of height.
The detected point is still used, and `warnings` includes `{kind: footUncertain, motionID}`. A draft with only reopened motions does not warn about them.
- **Overriding the foot:** Pass `foot: {x, y}` with `file`, or with `draftID` and `motionID`, in source pixels from top-left inside `sourceSize`. Pass `foot: "auto"` to revert to detection. The choice persists with the motion.
- **Refusals:** `foot` without `file` or `motionID`, or with `remove` or `assetID`, returns `footNeedsMotion`. A negative point or one outside the source returns `invalidFoot`.
### Result
`import.prepare` returns draft metadata without raw pixels.
Top-level fields:
| Field | Meaning |
| --- | --- |
| `draftID` | Handle for follow-up `prepare` edits and `adopt`. |
| `replacesAssetID` | Present when reopening an imported resident; its resolved full ID. |
| `evictedDraftIDs` | Present when older drafts were evicted past the 4-draft limit. |
| `dotMode`, `availableDotModes` | Active dot mode and modes selectable for this draft. |
| `anchorMotionID` | Motion used as the height-match anchor, when present. |
| `width`, `height`, `canvas` | Combined character dimensions on the shared canvas. |
| `colors`, `frames` | Shared palette color count and total kept frames. |
| `suggestedName`, `notes` | Default character name and build notes. |
| `motions` | Per-motion source, scale, bounds, and foot report. |
| `warnings` | Advisory warning objects, when present. |
| `preview` | Preview PNG path, dimensions, zoom, and tile coordinates. |
| `dots` | Adopt-time dot-look options (omitted when source long side is 8 dots or fewer). |
`dots` uses the same schema as `resident.describe`'s `options.dots`: `min`, `max`, `quick`, `rules`, and `source` (`{width, height}`). `min` and `max` give the long side in dots where `max` is the source's own count, and `quick` lists number buttons under `max`.
Each entry in `motions` includes source identity fields and its size and foot report:
| Field | Meaning |
| --- | --- |
| `motionID`, `name`, `role` | Motion handle, display name, and role (`idle` or `named`). |
| `source`, `sourceSize` | Source metadata (`{kind, width, height, durationMs}`) and decoded pixel size. |
| `keptFrames` | Number of frames kept in the draft for this motion. |
| `range` | Active clip window `{startMs, endMs}`, when applicable. |
| `grid` | Detected pixel grid `{cellWidth, cellHeight, columns, rows, confident}`, when present. |
| `scale` | `{requested, factor}` requested setting and applied factor. |
| `dotSize` | Source pixels per dot. |
| `visibleDotSize` | Pixel art only: canvas dots per source pixel (e.g., `3` for 3× enlarged `as-is`). |
| `limitFactor` | Shrink rate applied to fit limits; omitted if unshrunk. |
| `box` | `{x, y, w, h}` opaque bounds on the shared canvas, top-left origin. |
| `reason` | `dotArtOneToOne`, `heightMatched`, `anchor`, `grid`, `explicit`, or `shrunkToFitLimits`. |
| `foot` | `{x, y, source, confidence}` in source pixels (or installed canvas if reopened). |
| `footOnCanvas` | `{x, y}` shared foot coordinate on the canvas (identical across all motions). |
`visibleDotSize` uses a confident grid when present, else the scale factor. `foot.source` is `auto`, `explicit`, or `reopened`.
`warnings` entries:
| `kind` | Extra fields | Meaning |
| --- | --- | --- |
| `mixedDotSizes` | `motionIDs`, `hint?` | Pixel-art motions differ in `visibleDotSize`; lists motions larger than the smallest. |
| `shrunkToFitLimits` | `factor?` | Motions shrank to fit limits; `factor` appears only when all share one rate. |
| `scaleAdjusted` | `motionID`, `requested`, `applied` | Source > 2048 px decoded smaller and shifted effective scale by > 1%. |
| `footUncertain` | `motionID` | Automatic foot detection had `low` confidence. |
| `frameDropout` | `motionID`, `frames` | Listed 0-based frames have under 75% of median opaque dots, causing flicker. |
| `opaqueEdge` | `motionID`, `edge` | One edge (`top`, `bottom`, `left`, `right`) has a solid single-color strip ≥ 2 dots deep in every frame. |
- For `mixedDotSizes`, `hint` appears when `dotMode: grid` is available but not chosen; photos and videos are not compared.
- For `frameDropout`, motions under 32 dots are not judged, and indices match sequence cut indices.
- For `opaqueEdge`, motions with no transparent dot inside their box are not judged.
> [!NOTE]
> **Warnings are advisory**
> Warnings change nothing and refuse nothing; inspect the preview before adopting. Intentional effects such as a fade or a flat-bottomed tank can trigger warnings you can safely ignore. A single-frame picture is inspected through its one frame.
### Preview
Every `prepare` call overwrites `imports/.previews/.png` and returns `preview`:
- `path` (relative to the import folder's parent), `absolutePath`, `width`, `height`, `zoom`, and `scaleDown`.
- `tiles`: one entry per motion in order (`motionID`, `name`, `x`, `y`, `w`, `h`). No text is drawn on the PNG.
Previews are deleted by `adopt`, by discarding the draft, and by cleanup. An orphaned preview for a gone draft is removed on the next import call. Nothing is written outside the import folder.
Preview PNG layout and foot markers
- Each motion's first frame is laid out on the shared canvas left to right, top to bottom, at the largest whole zoom fitting within 1600×1600. If even 1× does not fit, it is shrunk by a whole factor returned as `scaleDown`.
- Each tile has a 1-pixel border and a transparency checkerboard.
- The common foot row is a 2 px magenta line with a dark edge below, slightly wider than the tile frame.
- Each motion's foot is marked with a cyan `+` (or a yellow `×` when `confidence` is `low`): 9×9 px with 2 px lines and a dark outline, kept at the same PNG size at every zoom and clipped to the frame.
## `pixling_import_adopt`
Saves a prepared draft into the Field Guide as one resident, then forgets the draft and removes its files from the import folder.
```json title="MCP request (pixling_import_adopt)"
{
"draftID": "8b4c9e12-3f4a-4b6c-9d1e-000000000001",
"name": "Piko",
"dots": { "count": 24, "rule": "median", "thicken": true }
}
```
```json title="MCP result"
{
"assetID": "pixling.imported.piko/resident.1",
"name": "Piko",
"motions": 2,
"canvas": { "width": 32, "height": 32 },
"number": 235,
"who": "No.235"
}
```
| Argument | Value |
| --- | --- |
| `draftID` | Required draft handle from `import.prepare`. |
| `name` | Display name (defaults to the first motion's filename). |
| `note` | Optional note stored on the resident. |
| `dots` | `{count?, rule?, thicken?}` (at least one field) for the initial desk dot look. |
Rules for `dots`:
- Uses the same spelling as `resident.set`'s `dots`. `count` is the long side from `dots.min` to `dots.max` of the `prepare` result (`max` keeps source dots); `rule` defaults to `recommended` and `thicken` to `false`.
- Stored with the adoption for the next summon (not inside the pack) and changeable later via `resident.set`.
- Omit `dots` to choose none. For a reopened resident, its remembered look stays, fitted to the new picture.
- An out-of-range `count` returns `invalidValue`; passing `dots` when the draft result has no `dots` returns `dotsUnavailable`.
**Result:** Returns `assetID`, `name`, `motions` as the motion count, `canvas` as `{width, height}`, `number`, and `who` as `No.N`, plus `replaced` and `warnings` when applicable. Place the new resident on the desk with `resident.summon` (`who: No.N`).
- **Idempotent retries:** Adopting the same draft again within 30 minutes in the same app session returns the same result. After the pack is installed (for example, if the response was lost), a retry returns the original resident under its originally adopted name regardless of `name`, and never creates a duplicate.
- **Reopened drafts:** Return `replaced: true`. Omitting `name` keeps the current name; a custom name the user set in Field Guide settings continues to be shown.
- **Live desk copies:** Copies already on the desk keep their settings, switch to the new motions, and shift so their idle body's feet stay on the same screen point as the canvas resizes. Any previously chosen motion or pose that no longer exists reverts to the default.
- **Adopt warnings** (string array, unlike `prepare`'s objects):
- `warnings: ["placementNotSaved"]`: Screen-point shifts for live desk copies could not be saved.
- `warnings: ["dotsNotSaved"]`: Resident was adopted, but its `dots` choice could not be stored; it summons in source dots and `resident.set` can set them again.
## Drafts
- **In-memory lifetime:** Drafts live only in app memory. At most **4 drafts** exist at once; starting a fifth evicts the oldest idle draft and lists it in `evictedDraftIDs`. Drafts expire after **30 idle minutes**, and none survive an app restart.
- **`draftNotFound`:** Returned for both gone drafts and unknown IDs; the app does not track why a draft disappeared (idle expiry, eviction, adoption, source change, or restart). Follow `hint`: prepare again, or reopen an adopted resident via `assetID`.
- **File cleanup:** Files in the import folder are deleted on the next import call after their draft ends, or after 24 hours. There is no background timer.
## Refusals
All import refusals return `rejected` with one of these `detail` codes and usually a `hint`.
### Import folder and files
| `detail` | Cause |
| --- | --- |
| `fileNotFound` | File is missing in the import folder (includes `error.importFolder`). |
| `pathNotInImportFolder` | `file` contains `/` or is `~` (includes `error.importFolder` and `error.hint`). |
| `unreadableFile` | File exists but could not be read or decoded. |
| `unsupportedFormat` | File format is not a supported image, animation, or video. |
| `tooLarge` | Source exceeds maximum file or decode size. |
| `tooShort` | Moving source has no usable clip duration. |
| `nothingVisible` | Decoded frames contain no opaque pixels. |
### Drafts and reopening
| `detail` | Cause |
| --- | --- |
| `draftNotFound` | Draft ID is unknown, expired, evicted, or already adopted. |
| `draftBusy` | Another operation is currently modifying this draft. |
| `motionNotFound` | `motionID` does not exist in this draft. |
| `assetNotFound` | `assetID` matches no installed resident. |
| `assetAmbiguous` | Multiple imported residents share the given name; pass `No.N`. |
| `assetNotImported` | Matched resident is built-in or not an imported resident. |
| `sourceChanged` | Reopened resident changed after the draft opened; reopen it. |
### Limits and build
| `detail` | Cause |
| --- | --- |
| `tooManyMotions` | Draft would exceed the 8-motion limit. |
| `tooLargeForDots` | Combined character cannot fit within the dot-art limits. |
| `tooMuchInOneCharacter` | Foot-aligned canvas exceeds the character budget. |
| `cannotBuild` | Draft could not be compiled into a character pack. |
| `adoptionFailed` | Saving the built pack into the Field Guide failed. |
### Arguments and options
| `detail` | Cause |
| --- | --- |
| `scaleNeedsMotion` | `scale` passed without `file` or `motionID`, or with `remove` or `assetID`. |
| `invalidScale` | `scale` number is outside `0.01`–`1` or integers `2`–`8`. |
| `footNeedsMotion` | `foot` passed without `file` or `motionID`, or with `remove` or `assetID`. |
| `invalidFoot` | `foot` coordinate is negative or outside `sourceSize`. |
| `invalidValue` | `adopt` `dots.count` is out of range (or another option value is invalid). |
| `dotsUnavailable` | `adopt` received `dots`, but the draft has no `dots` options. |
> [!CAUTION]
> **Fixing `tooMuchInOneCharacter`**
> `tooMuchInOneCharacter` means the foot-aligned canvas exceeds the character budget. Reopened and grid-folded motions do not shrink, so only newly added motions shrink. If it still does not fit, pass a smaller `scale` for the new motions.
## CLI
```sh title="Terminal"
pixling import prepare < walk.gif
pixling import prepare idle.gif walk.gif jump.gif --name idle --name walk --name jump
pixling import prepare --draft DRAFT --motion MOTION --from 0.5 --to 2 --name walk
pixling import prepare - --draft DRAFT --scale dots < jump.gif
pixling import prepare --asset No.235
pixling import adopt --draft DRAFT --name Piko
pixling import adopt --draft DRAFT --dots 48 --dots-rule median --dots-thicken true
```
The CLI copies each file into the import folder and sends its bare filename to the app. Pass a readable `PATH`, or pass standard input via `-` (or omit `PATH` when `--draft` is not given). On standard input, the format is sniffed from the leading bytes; `--type` (`gif`, `png`, `mp4`, `mov`, …) overrides detection.
| Flag | Maps to |
| --- | --- |
| `PATH` or `-` | `file` (multiple `PATH`s: `files`) |
| `--draft` | `draftID` |
| `--asset` | `assetID` (alone) |
| `--motion` | `motionID` |
| `--from`, `--to` (seconds; span at most 5 s) | `startMs`, `endMs` |
| `--name` | `motionName` (`name` for `import adopt`) |
| `--dots grid\|as-is` | `dotMode` (`import prepare`) |
| `--dots N`, `--dots-rule RULE`, `--dots-thicken true\|false` | `dots.count`, `dots.rule`, `dots.thicken` (`import adopt`) |
| `--scale auto\|dots\|match\|N` | `scale` |
| `--foot X,Y\|auto` | `foot` |
| `--remove` | `remove` |
CLI rules and output:
- **With `--draft` (edit or inspect):** A file is added only if you pass a `PATH` or `-`. Otherwise stdin is not read, and the call edits (`--motion` or `--dots`) or returns the current report and preview. In that mode, `--scale`, `--foot`, `--name`, and `--from`/`--to` require `--motion` (the CLI refuses before sending).
- **Without `--draft`:** Omitting `PATH` reads standard input.
- **Mutually exclusive flags:** `--asset` cannot be combined with a file, `--draft`, or `--motion`. `--scale` and `--foot` cannot be combined with `--remove` or `--asset`.
- **Multiple `PATH`s (all-or-none `files` batch):**
- Without `--draft`, the first `PATH` starts the draft.
- Pass `--name` once per `PATH` in the same order, or omit it completely. Pass `-` at most once.
- Only `--draft`, `--dots`, and `--type` (applies to `-` only) may accompany multiple `PATH`s; `--motion`, `--remove`, and `--asset` are refused. Set `--scale`, `--foot`, or `--from`/`--to` afterwards with `--draft ID --motion ID`.
- If any file fails to read while copying, all copies made by that call are deleted.
- Refusals number files starting from 1 as typed, such as `pixling: rejected (unsupportedFormat) in file 2 (walk.gif)`. `--json` preserves the MCP document (`fileIndex` from `0` and the copied `file` name).
- **Cleanup on error:** On `rejected`, the CLI deletes the files copied by that call. When the app is unreachable or times out, the CLI leaves them in place in case the app is still reading; 24-hour cleanup removes them later.
- **Human output (in order):**
- Per motion: `scale requested→factor dot Npx box x,y w×h (reason) foot x,y source[ uncertain] → canvas x,y`
- `warnings:` listing `footUncertain` with the motion ID, `frameDropout` with the motion ID and frames, and `opaqueEdge` with the motion ID and edge
- `evicted drafts: …` when older drafts were evicted
- Preview path: `preview /…/imports/.previews/.png (×zoom)`, or `(1/N)` when shrunk
- On `draftNotFound`, prints a `hint:` line; `fileNotFound` and `pathNotInImportFolder` print `import folder: …`; reopened drafts print `replaces` with the resolved full ID.
- **`--json` and timeout:** `--json` prints the raw MCP documents. Both `import prepare` and `import adopt` wait up to **180 seconds** for the app so video and large image decoding can finish.
## Related
- [Residents](/docs/reference/residents/): Summon imported residents, adjust their dots, and inspect shapes or pixels.
- [CLI commands](/docs/reference/cli-commands/): Full command list and flag synopsis for the bundled pixling CLI.
---
# Notes
> Local notes on an asset, a resident or a session through note.get and note.set, their limit, and where they can be set at creation.
Notes are optional local remarks attached to an asset, a desk resident, or an agent session. Users view and edit them in Pixling under **Notes**, grouped into **This one**, **Field Guide**, and (when a session is bound) **Conversation**.
> [!NOTE]
> **Notes are remarks, not prompts**
> Pixling never treats notes as instructions or generation input. They stay local on your Mac.
## Scopes
Every `note.get` and `note.set` call targets one of three scopes:
| `scope` | `to` | Belongs to |
| --- | --- | --- |
| `asset` | A library `No.N` or exact name | The asset, shared by every copy of it |
| `entity` | One resident (not `auto` or `everyone`) | That individual resident on the desk |
| `session` | Only `client:/` | The `resident.ensure` binding, including retained and stowed bindings |
Any other `scope`/`to` combination is refused with `invalidArguments` on `to`.
## MCP: `pixling_note_get` and `pixling_note_set`
```json title="MCP request (pixling_note_set)"
{
"scope": "session",
"to": "client:my-agent/conversation-1",
"note": "Reviews pull requests"
}
```
```json title="MCP result"
{
"scope": "session",
"target": "client:my-agent/conversation-1",
"note": "Reviews pull requests"
}
```
- **`note.get`**: Requires `scope` and `to`.
- **`note.set`**: Requires `scope`, `to`, and `note` (a string). Passing an empty string clears the note. Because `note.set` replaces the entire note, it is annotated as destructive.
- **Return shape**: Both return `{scope, target, note}`, where `target` is the resolved identifier: the asset ID, the resident's entity ID, or `client:/`.
**Limits and permissions:**
- **Length limit**: Up to **200 characters**, counted as extended grapheme clusters rather than bytes or Unicode code points. A Japanese character or composed emoji counts as 1.
- **Characters**: Newline and tab are allowed; other control characters are refused.
- **Errors and ownership**: An unknown target returns `targetNotFound`. Writing the `entity` note of a resident bound by another client follows the standard [binding rules](/docs/connect/own-a-resident/).
## Setting a note at creation
You can also attach a note when summoning, binding, or adopting:
| Operation field | Sets | CLI flag |
| --- | --- | --- |
| `resident.summon.note` | The new resident's `entity` note | `resident summon --note` |
| `resident.ensure.note` | The `session` note | `resident ensure --note` |
| `resident.ensure.initial.note` | The new resident's `entity` note | `resident ensure --initial-note`, or `initial.note` in `--initial` JSON (not both) |
| `import.adopt.note` | The `asset` note, on first adoption | `import adopt --note` |
> [!CAUTION]
> **Creation-only fields never overwrite later edits**
> Both `resident.ensure` note fields apply only when the binding is created; a replay or lookup leaves later edits intact. Likewise, retries of `import.adopt` and reopened replacements keep the saved asset note. To edit or clear any note afterwards, call `note.set`.
## CLI: `pixling note`
```sh title="Terminal"
pixling note get --scope entity --to 'No.7#1'
pixling note set --scope session --to 'client:my-agent/conversation-1' --note 'Reviews pull requests'
pixling note set --scope asset --to No.7 --note ''
```
`--scope` and `--to` map directly to `scope` and `to`; `note set` requires `--note`. Human output prints one line (`SCOPE TARGET: NOTE`), and `--json` prints the `{scope, target, note}` document.
## Related
- [Resident binding](/docs/reference/resident-binding/): Attach session notes and initial entity notes with resident.ensure.
- [Import](/docs/reference/import/): Attach an asset note when adopting a custom resident with import.adopt.
---
# App settings
> Read and change the app-wide settings through settings.get and settings.set, and what stays read only.
`settings.get` reads the app-wide settings shown on Studio's **Settings** page and the **All residents** side of the speech paper. `settings.set` writes them the same way a person does there. Every key in a `settings.set` call is validated first, so one call is one atomic save and a refusal saves nothing.
## `settings.get`
Returns three top-level objects: `settings` for writable values, `readOnly` for observable values, and `options` for the valid vocabulary accepted by `settings.set`.
```json title="MCP result (abbreviated)"
{
"settings": {
"menuBarIcon": true,
"motionEnabled": true,
"longPressToMove": false,
"refoldAfterAnswer": true,
"motionPlayback": "smooth",
"notify": true,
"textScale": 100,
"appearance": "system",
"avoid": true,
"speechWindow": null,
"loginItem": "enabled"
},
"readOnly": {
"cli": true,
"mcp": true,
"mcpProtected": false,
"notificationPermission": "allowed"
},
"options": {}
}
```
### Writable `settings` keys
| Category | Key | Values and notes |
| --- | --- | --- |
| General | `menuBarIcon` | **Show menu bar icon** (default `true`). |
| Interaction & playback | `motionEnabled` | **Animate residents** across the desk (default `true`). |
| Interaction & playback | `longPressToMove` | Boolean toggle. |
| Interaction & playback | `refoldAfterAnswer` | **Fold again after answering** (default `true`). |
| Interaction & playback | `motionPlayback` | `smooth` or `economy`. |
| Notifications & sound | `notify`, `notifyQuestion`, `notifyMessage` | Master and per-kind notification switches. |
| Notifications & sound | `sound`, `soundQuestion`, `soundMessage` | Master and per-kind arrival sound switches. |
| Appearance | `textScale` | Whole percent, `100`–`130`. |
| Appearance | `appearance` | `system`, `light`, or `dark`. |
| Speech paper defaults | `speech` | All-residents look; `own` lists axes changed from factory. |
| Speech paper defaults | `avoid` | Speech paper **No overlap** row (keeps nearby windows clear). |
| Speech paper defaults | `speechWindow` | Starting frame for new residents' windows, or `null` for automatic. |
| Login item | `loginItem` | **Show residents at login**: `enabled`, `requiresApproval`, `notRegistered`, or `notFound`. |
`speech` uses the shape of [`resident.describe`'s `settings.speech`](/docs/reference/resident-settings/#speech-paper-speech). `avoid` places nearby residents' speech windows clear of each other and their bodies. `loginItem` reflects the status macOS reports.
### Observable `readOnly` keys
| Key | Meaning |
| --- | --- |
| `cli`, `mcp`, `mcpProtected` | Connection and bearer-token switches. |
| `mcpTools` | Each MCP tool group a person can turn off. |
| `wallet` | Wallet row balance `{state, usdMicrounits?, seenAt?}`. |
| `notificationPermission` | macOS permission: `allowed`, `denied`, or `notDetermined`. |
- **`wallet` privacy:** `state` is `current`, `lastSeen`, `unknown`, or `stopped`. The bearer token, wallet owner, and purchase history are never returned, and reading never contacts the server for a balance.
- **Notification permission:** Turning `notify` on does not grant permission; only the person can allow notifications in Studio or **System Settings**.
> [!NOTE]
> **Fields supplied by Pixling Studio**
> `loginItem` and `wallet` come from Pixling Studio, so they are populated only while Studio is open. Otherwise they are `null`, accompanied by `loginItemUnavailable` and `walletUnavailable` explaining why: `studioNotRunning` or `studioNotAnswering` (Studio did not answer within 5 seconds). `loginItemUnavailable` alone means this build has no login switch.
## `settings.set`
Omitted keys stay unchanged; `null` resets a key to its default. Unknown keys fail with `invalidArguments` naming the field. On success, returns `{settings}` reflecting the updated values.
```json title="MCP request (pixling_settings_set)"
{
"notifyMessage": false,
"speech": { "kit": "timber-plaque", "size": 16 }
}
```
### Switches, appearance, and speech defaults
- **Switches and display rows:** The boolean switches plus `motionPlayback`, `textScale`, and `appearance` write the same values as Studio's **Settings** page.
- **`speech`:** Accepts the same axes as [`resident.set`'s `speech`](/docs/reference/resident-settings/#speech-paper-speech) and writes the **All residents** side of the speech paper. Pass `null` for one axis to restore its factory value, or `speech: null` to reset the entire paper. A kit the desk does not offer is refused with `path: "speech.kit"`, and nothing in the call is saved.
- **`avoid`:** `true`, `false`, or `null` (default).
- **`speechWindow`:** `{corner, dx, dy, width, height}`, matching `resident.set`. Sets where new residents' speech windows start (like placing a window by hand), while existing desk residents keep theirs. New residents take the pinned width and height as they are. Pass `null` to restore automatic placement.
### Login item (`loginItem`)
Pass `true`, `false`, or `null` (off) to toggle **Show residents at login** through Pixling Studio. Returns the status macOS reports, including `requiresApproval` (the person approves it in **System Settings**). Calls that omit `loginItem` never contact Studio and omit `loginItem` from the result.
- **Execution order:** Other keys validate first, Studio updates the login item, then the remaining keys save against current settings. A validation refusal leaves everything untouched. If saving fails after Studio changed the login item, `reason` reports the login item's current status.
| Refusal (`rejected`) | Cause |
| --- | --- |
| `studioNotRunning` | Studio is closed; nothing was saved. |
| `studioNotAnswering` | No reply within 5 seconds or Studio closed. Read `settings.get` before retrying, as the change may have happened. |
| `loginItemFailed` | macOS refused the change; `reason` gives its status. |
| `loginItemUnavailable` | This build has no login switch. |
> [!CAUTION]
> **Person-only settings cannot be changed by agents**
> Attempting to write `cli`, `mcp`, `mcpProtected`, `mcpTools`, or `wallet` is refused with `rejected` / `personOnly`, and nothing in the call is saved. An agent can never open or widen its own access; a person changes those rows in **Settings** › **Connect**.
### MCP groups and `app.quit`
In MCP, `pixling_settings_get` belongs to the **View** group, while `pixling_settings_set` lives in its own **App settings** group that a person can turn off; the CLI keeps both.
The **App settings** group also includes `pixling_app_quit` (`app.quit`, CLI `pixling app quit`), which quits Pixling and Studio like **Quit Pixling** in the resident menu. It replies `{quitting: true}` first and Pixling exits a moment later.
## CLI
```sh title="Terminal"
pixling settings get
pixling settings set --notify false --appearance dark
pixling settings set --input '{"notifyMessage":false,"speech":{"kit":"timber-plaque","size":16}}'
pixling call settings.set '{"speechWindow":{"corner":"bottomLeft","dx":40,"dy":30,"width":320,"height":240}}'
```
Everyday shorthand flags on `settings set`:
| Flags | Values |
| --- | --- |
| `--menu-bar-icon`, `--motion-enabled`, `--login-item`, `--notify`, `--sound` | `true`, `false`, or `default` |
| `--appearance` | `system`, `light`, `dark`, or `default` |
Pass `--input ` (exclusive with shorthand flags) or use `pixling call settings.set` for any other key, including `speech`, `avoid`, `speechWindow`, `textScale`, `longPressToMove`, `motionPlayback`, `refoldAfterAnswer`, and per-kind notification/sound switches.
## Related
- [Resident settings](/docs/reference/resident-settings/): Per-resident speech papers, windows, notification overrides, and settings.
- [MCP tools](/docs/reference/mcp-tools/): Tool groups, destructive hints, and how users turn groups off.
---
# Speech kits
> List, describe, change, preview, copy, delete, export, import and manage prop images for speech bubble outfits (kits) through kit.*.
A speech kit is a pictured outfit for the speech bubble: its paper, tail, controls and ornaments drawn as pixel art. Residents wear one through `speech.kit` (one resident with `resident.set`, all residents with `settings.set`). The `kit.*` operations read, edit, preview, export and import the kits themselves. They are in the **Library** MCP group.
```sh title="Terminal"
pixling kit list
pixling kit describe steam
pixling kit set steam '{"for":"app","parts":{"gauge":{"visible":false}}}'
pixling kit preview steam.mine
```
The third line copies the built-in `steam` kit to the user's `steam.mine`, hides its `gauge` ornament there, and wears `steam.mine` for every resident. The last line writes a preview PNG under `importFolder.previews`.
## Kits and where they live
| `origin` | Kits | Changed by `kit.set` | `kit.delete` |
| --- | --- | --- | --- |
| `builtIn` | Shipped with Pixling (`note`, `quiet-card`, `steam`, `steam-metal`, `pocket-meter`, `postage-stamp`, `timber-plaque`, `glass-case`) | Copied to `.mine` on the first change | Refused (`kitNotYours`) |
| `user` | The user's own: copies, duplicates and imports (the id holds a `.`) | In place | Deleted |
- **One copy per kit.** Every change made from a built-in kit lands in the same `.mine`. A further copy comes from `kit.duplicate`.
- **A copy follows its kit.** `.mine` stores only its changes (`derivedFrom` names the kit). When `kit.delete` removes a user kit that others were copied from, each copy first becomes a standalone kit that looks the same; if one cannot, nothing is deleted (`kitInUse`).
- **Stored locally.** Kits stay on the Mac. No call reaches the network.
## List and describe
`kit.list` takes no arguments and returns `{kits}`, one row a kit:
| Field | Meaning |
| --- | --- |
| `id` | What `kit`, `speech.kit` and `kit.*` name |
| `title` | The name the outfit tiles show |
| `origin` | `builtIn` or `user` |
| `derivedFrom` | The kit a copy changes, else `null` |
| `revision` | Changes whenever the kit or the kit it changes does |
| `motion` | `lively`, `reactive` (nothing loops at rest) or `still` (nothing moves) |
| `glassMax` | The most see-through the kit allows, else `null` |
| `notes` | Present only when the kit is read with something left out |
`kit.describe {kit}` returns the kit as it is drawn now:
| Field | Meaning |
| --- | --- |
| `parts` | One row a part: `id`, `role`, `takes`, `sheet`, `sheets`, `scale`, `visible`, `hidable`, plus placement fields where present |
| `colours` | Editable colors: `key`, `title`, `colour` (`#RRGGBB` or `null`) and `kitColour` |
| `textColour` | Effective text color (`#RRGGBB`) used for contrast checks |
| `sheets` | Sprite sheets in the kit: `name`, `width`, `height`, `frames`, `slicing` and `animations` |
| `presets` | Named sets of changes: `name`, `title` |
| `motion`, `forms`, `derivedFrom`, `revision` | As drawn; `forms` lists the kit's shapes for short or lone bubbles |
| `notes` | What reading it left out and why (empty when whole) |
A part hidden by a change is still listed, with `visible: false`, so it can be shown again. Each part's optional placement fields include `shown`, `anchor`, `pivot`, `x`, `y`, `layer`, `order`, `host`, `side` and `offset`.
## Change a kit
```json title="MCP request (pixling_kit_set)"
{
"kit": "steam",
"for": "app",
"parts": {
"gauge": { "visible": false },
"valve": { "anchor": "topLeft", "x": 4, "y": -2, "layer": "top", "order": 30 }
},
"colours": { "brass": "#8FA3B0" }
}
```
```json title="MCP result"
{ "kit": "steam.mine", "forked": true, "worn": true }
```
| Argument | Takes |
| --- | --- |
| `kit` | Required. A kit id from `kit.list` |
| `parts` | Part id → part fields below, or `null` to drop that part's changes |
| `colours` | Color key → `#RRGGBB`, or `null` for the kit's own |
| `motion` | `lively`, `reactive` or `still` |
| `preset` | A preset name from `kit.describe`, applied before the rest of the call |
| `frameSpec` | Frame layout override (`nineSlice` or `modular`), or `null` to clear |
| `props` | Prop id (`a-z`, `0-9`, `.`, `-`, 1–32 chars) → prop object, or `null` to remove |
| `clearProps` | When `true`, removes all custom props before applying `props` |
| `surfaceMaterials` | Pixel-PBR finish per slot (`plate`, `frame`, `part:`, `prop:`), or slot `null` to clear |
| `for` | Where the kit written is worn: `app` (all residents' `speech.kit`) or one resident selector |
Give at least one field besides `kit` and `for`. The result is `{kit, forked, worn}`: `kit` is the kit written (the copy's id when the call copied a built-in kit), `forked` is `true` on that first change, and `worn` is `true` when the copy was worn where `for` says. A change to a user kit wears nothing new. Without `for`, the call only edits; wear the kit with `settings.set` or `resident.set`.
Over MCP, `for: app` needs the **App settings** group and `for: ` the **Placement** group: with that group turned off, the call is refused with `toolFamilyOff` and `path: "for"`, and the same call without `for` still goes through.
### Part fields
| Field | Value | Parts that take it |
| --- | --- | --- |
| `visible` | `true` or `false` | Ornaments; `body`, `header`, `seat`, `tail` |
| `shown` | `always`, `hover` or `never` | Slots (`fold` is never hidden) |
| `sheet`, `scale` | A sheet name of the kit, a whole number | Every part but a painted `tail` |
| `anchor`, `pivot` | `topLeft`, `top`, `topRight`, `left`, `centre`, `right`, `bottomLeft`, `bottom`, `bottomRight` | Ornaments and slots |
| `x`, `y` | Dots from the anchor | Ornaments and slots |
| `layer`, `order` | `behind`, `paper`, `content` or `top`; a whole number (higher stands above) | Ornaments and slots |
| `side` | `wanted`, `top`, `left`, `bottom` or `right` | `tail` |
| `offset` | `wanted`, `centre`, `{"start": n}` or `{"end": n}` (dots from that end of the edge) | `tail` |
| `host` | `paper`, `header`, `history` or another slot's id | Slots |
Which fields a part takes is its `takes` in `kit.describe`. A field the part does not take, a part the kit does not have, a color that fails contrast checks, a reserved prop id, or a missing preset refuses the whole call with `kitRefused`, `path` naming it, and `reason` giving the rule or measured ratio. Nothing is written.
### Frame, props and materials
- **`frameSpec`** overrides how the paper frame is sliced (`nineSlice` with `insets`, or `modular` with corner/edge/center sheets). The tool input schema lists every field.
- **`props`** places custom prop art (`visual.sheet` referencing a `speech-props/.png` asset imported via `kit.propImport`), with normalized `placement.anchor` (`{u, v}`), `layer` (`behindCard`, `onBackdrop`, `onFrame`, `overChat`), `zIndex`, `pointer`, `visibleWhen` conditions, and `hooks`. Reserved fixed part ids (such as `badge`, `paper`, `tail`) are refused.
- **`surfaceMaterials`** applies Pixel-PBR finishes per slot (`texture`, `metalness`, `roughness`, `bevel`, `lightMode`, `sampling` and rim settings), matching the schema of `kit.set`.
## Preview and prop images
- **`kit.preview {kit, mode?, text?, residentName?, width?, scale?, for?}`** renders a one-shot offscreen PNG of the kit into `importFolder.previews` (`kit--.png`) and returns `{kit, revision, mode, path, relativePath, width, height, logicalSize, paperRect, dot, propRects}`. `mode` is `message` (default) or `question`; `width` is `160`–`480` pt (default `248`); `scale` is `1` or `2` (default `2`).
- **`kit.propList`** lists imported prop images stored in `speech-props/` with their `sheet` (`speech-props/.png`), `sha256`, `label`, `width`, `height` and `bytes`.
- **`kit.propImport {file, label?}`** copies a PNG from `importFolder.path` (bare file name, never a path; max 512×512 px, 65,536 dots) into the content-addressed prop store and returns `{sheet, sha256, label, width, height, bytes}`. Use `sheet` in `kit.set`'s `props` or `frameSpec`.
## Copy, delete, export and import
- **`kit.duplicate {kit, name?}`** copies any kit as a user kit and returns `{kit}` with the new id (`steam.copy`, then `steam.copy-2`). `name` is 1 to 60 characters. Without it, a copy of a built-in kit is named ` (copy)` and a copy of a user kit keeps its name.
- **`kit.delete {kit}`** deletes one user kit and returns `{kit, deleted: true}`. Residents that wore it keep the stored name and draw the plain speech bubble. It is annotated as destructive. If a copy made over it cannot stand alone looking the same, nothing is deleted (`kitInUse`).
- **Long ids.** A generated id (`.mine`, `.copy`, `.import`, `-2`) longer than 64 characters keeps the start of the kit's id and a short hash of it, the same every time.
- **`kit.export {kit, folder?, overwrite?, flatten?}`** writes any built-in (including `note`) or user kit into `importFolder.path/` (default ``) with `kit.json`, `parts/*.png` and any referenced `speech-props/.png`. Use it to inspect a working `kit.json` before authoring a custom kit. Set `flatten: true` to materialize a derived copy as a standalone kit, or `overwrite: true` to replace an existing folder.
- **`kit.import {folder, replace?}`** imports a kit folder (`kit.json` and `parts/`) from `importFolder.path` by bare folder name, never a path. `sheets.*.bytes`/`sha256` and `sheets.*.attachment.bytes`/`sha256` may be omitted (Pixling computes them from the PNGs while enforcing size limits), and colors in `kit.json` accept `#RRGGBB`, `#RRGGBBAA` or `{red, green, blue, alpha?}` (0–255 integers). Pass `replace: true` to update an existing user kit atomically in place (`replaced: true`) instead of creating `.import-2`.
## CLI: `pixling kit`
```sh title="Terminal"
pixling kit set steam.mine '{"colours":{"brass":"#8FA3B0"},"motion":"still"}'
pixling kit set steam.mine '{"parts":{"gauge":{"visible":false},"valve":null}}'
pixling kit preview steam.mine --mode message --text 'Hello!'
pixling kit export quiet-card quiet-card-src --flatten
pixling kit import quiet-card-src --replace
pixling kit prop-import badge.png
pixling kit prop-list
pixling kit duplicate steam --name 'Brass days'
pixling kit delete steam.copy
```
`kit set [input]` takes the same JSON patch object as MCP (`parts`, `colours`, `motion`, `preset`, `frameSpec`, `props`, `surfaceMaterials`, `for`) inline, from `@file.json`, or from standard input (`-` or piped), allowing multi-part edits in one call. `--json` prints the result document.
## Refusals
| `detail` | `code` | When |
| --- | --- | --- |
| `kitNotFound` | `targetNotFound` | No kit of that id |
| `kitNotYours` | `rejected` | `kit.delete` of a built-in kit |
| `kitRefused` | `rejected` | The kit refuses the change; `path` names the field, `reason` gives the rule or contrast ratio |
| `kitInUse` | `rejected` | `kit.delete` or `kit.import --replace` would break a copy derived from this kit |
| `residentNotFound` | `targetNotFound` | The resident in `for` left the desk during the call; nothing was written |
| `toolFamilyOff` | `rejected` | Over MCP, `for` names a group turned off (`path: "for"`) |
| `kitUnreadable` | `rejected` | The kit or imported folder cannot be read; `reason` names the field or file |
| `tooManyKits` | `rejected` | The user already has 64 kits |
| `folderNotFound`, `pathNotInImportFolder` | `rejected` | `kit.import`/`kit.export`/`kit.propImport` could not find the item, or received a path |
| `folderExists` | `rejected` | `kit.export` target folder already exists and `overwrite` is `false` |
| `fileNotFound`, `propInvalid`, `tooManyProps` | `rejected` | `kit.propImport` file is missing, not a valid PNG within limits, or prop store is full |
| `notReady` | `unavailable` | The desk is starting, or this build keeps no kits |
| `cannotWrite` | `internalFailure` | Writing failed; nothing changed |
Every refusal carries a `hint`. A resident named in `for` follows the usual selector and [binding rules](/docs/connect/own-a-resident/).
## Related
- [Resident settings](/docs/reference/resident-settings/): Wear a kit on one resident with resident.set speech.kit.
- [App settings](/docs/reference/settings/): Wear a kit on every resident with settings.set speech.kit.
---
# MCP server
> The pixling MCP endpoint, its HTTP transport, protocol profiles, result and error shapes, and trust boundary.
Pixling exposes a loopback Streamable HTTP MCP server directly inside the app while **MCP connection** is turned on in **Settings** › **Connect**.
```text title="MCP endpoint"
http://127.0.0.1:48271/mcp
```
If you are connecting an existing coding agent, start with [Connect an agent](/docs/connect/). For the tool list and underlying vocabulary, see [MCP tools](/docs/reference/mcp-tools/) and [Operations](/docs/reference/operations/).
## Connection
There is no stdio transport and no separate helper process. Pixling never binds to `0.0.0.0`, a LAN interface, or the IPv6 wildcard.
- **Fixed port (`48271`)**: If another app already holds port `48271`, Pixling does not open MCP and shows a notice at the bottom of **Settings** › **Connect** (the CLI keeps working). Quit the other app, then toggle **MCP connection** off and on.
- **Optional bearer token**: **Protect MCP connection** is off by default. Turning it on generates a 256-bit base64url token and requires `Authorization: Bearer ` on every request. **Copy** in Studio includes the header in its snippets ([Set up your agent](/docs/connect/agent-setup/#with-protection-on)).
- **Token lifecycle**: Toggling **MCP connection** or **Protect MCP connection** off deletes the stored token, and turning it back on generates a new one. Tokens never appear in URLs, MCP messages, tool results, or logs.
## Transport
Pixling implements Streamable HTTP per the [Streamable HTTP 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http) and [Streamable HTTP 2025-11-25](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports) specifications and the [Codex MCP setup](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).
```sh title="Minimal tool call (2026-07-28 profile)"
curl -s http://127.0.0.1:48271/mcp \
-H 'Accept: application/json, text/event-stream' \
-H 'Content-Type: application/json' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: tools/call' \
-H 'Mcp-Name: pixling_residents_list' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"curl","version":"1.0"},"io.modelcontextprotocol/clientCapabilities":{}},"name":"pixling_residents_list","arguments":{}}}'
```
| Method | Behavior |
| --- | --- |
| `POST` | Sends one JSON-RPC message; returns one `application/json` object. Notifications return `202 Accepted` with no body. |
| `GET` | Returns `405 Method Not Allowed` (Pixling does not use SSE streams). |
| `DELETE` | Ends the session in `MCP-Session-Id` and returns `204 No Content`. |
### Limits and HTTP checks
| Check or limit | Rule |
| --- | --- |
| Sessions | Up to **200** in memory, with no idle timeout. Creating a 201st drops the oldest-created session, even if still active. |
| Request size & concurrency | Headers **32 KiB**, body **1 MiB**, **200** concurrent connections. No chunked transfer or HTTP pipelining; each connection handles one request and closes. |
| Caching | Every response sets `Cache-Control: no-store`. |
| `Host` header | Must be `127.0.0.1:` or `localhost:` (case-insensitive). Missing or mismatched `Host` gets HTTP `403` before protocol parsing to block DNS rebinding. |
| `Origin` header | When present, must be `http://127.0.0.1[:PORT]` or `http://localhost[:PORT]`; anything else gets HTTP `403`. |
| Bearer token | When protection is on, verified before protocol parsing. |
Under RFC 9110, a `Host` header without a port implies port `80` and passes only if the listening port is `80`.
## Protocol versions
Pixling serves two MCP protocol profiles on the same endpoint:
| Profile | Revisions | Session model | Metadata headers |
| --- | --- | --- | --- |
| Negotiated | `2025-11-25`, `2025-06-18` | Stateful (`MCP-Session-Id`) | `MCP-Session-Id`, `MCP-Protocol-Version` |
| Per-request metadata | `2026-07-28` | Stateless | `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name` |
### Negotiated (`2025-11-25`, `2025-06-18`)
Used by Codex and clients targeting the 2025 specifications.
- Follows `initialize` → `notifications/initialized` and returns a cryptographically random `MCP-Session-Id`. Subsequent requests must send both `MCP-Session-Id` and `MCP-Protocol-Version`.
- Holds up to 200 sessions in memory and clears them when MCP stops.
- **Automatic rebinding**: If an unknown `MCP-Session-Id` arrives with a negotiated `MCP-Protocol-Version` (for example after an app restart), Pixling rebinds that ID as ready so the client continues without re-initializing.
- **Handshake edge cases**: An `initialize` on an unknown ID or a rebound session redoes the handshake under that ID. A second `initialize` on an already-initialized session fails with `-32600`.
- **Unknown session or version**: An unknown session without a version header returns HTTP `404` and JSON-RPC `-32001` (`Session not found`). An unrecognized `MCP-Protocol-Version` returns HTTP `400`.
- Tool results keep the standard shape of that protocol generation and omit `ttlMs` and `cacheScope`.
### Per-request metadata (`2026-07-28`)
- Stateless transport: no session is created, and each `POST` validates `_meta.io.modelcontextprotocol/*` (`protocolVersion`, `clientInfo`, and `clientCapabilities`).
- `MCP-Protocol-Version`, `Mcp-Method`, and (for `tools/call`) `Mcp-Name` headers must match the request body; mismatches return HTTP `400` with JSON-RPC `-32020`.
- Notifications (`POST` with no `id`) return HTTP `202` with no body. Their headers and `_meta` are not checked because the revision defines none for notifications.
- Unimplemented methods return HTTP `404` with JSON-RPC `-32601` (the negotiated profile uses the standard JSON-RPC response shape).
- `server/discover` and `tools/list` return [Caching](https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/caching) (SEP-2549) metadata:
- `ttlMs: 0`, because `tools/list` is filtered per request by live capabilities and user-toggled groups ([Core and groups](/docs/reference/mcp-tools/#core-and-groups)), and `listChanged` is never sent.
- `cacheScope: "private"`, because this is a personal loopback server.
### Shared rules for both profiles
- Every tool's input schema is a closed root object (`additionalProperties: false`). Per-tool contracts live in [Messages and questions](/docs/reference/messages-and-questions/), [Residents](/docs/reference/residents/), [Resident settings](/docs/reference/resident-settings/), and the other reference pages.
- Only the `tools` capability is advertised. Resources, prompts, Tasks, subscriptions, and server-initiated requests are not offered.
- Every call runs as the fixed identity `mcp:local-mcp`. Requester identity is never read from the HTTP payload or `clientInfo` (`clientInfo` is only used to validate the protocol peer).
## Results and errors
Every tool result places the same control document as CLI `--json` in `structuredContent` and mirrors that JSON as text content for compatibility. Tools declare no output schema. The `2026-07-28` profile also adds `resultType: "complete"` and `_meta`.
```json title="Successful tools/call response (2026-07-28 profile)"
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"resultType": "complete",
"content": [
{
"type": "text",
"text": "{\"invocationID\":\"mcp-01234567-89ab-cdef-0123-456789abcdef\",\"ok\":true,\"operation\":\"residents.list\",\"protocolVersion\":1,\"result\":{\"displays\":[...],\"residents\":[...]}}"
}
],
"structuredContent": {
"ok": true,
"operation": "residents.list",
"invocationID": "mcp-01234567-89ab-cdef-0123-456789abcdef",
"protocolVersion": 1,
"result": {
"displays": [
{
"id": "display-1",
"name": "Built-in Retina Display",
"isMain": true,
"backingScaleFactor": 2,
"frame": { "x": 0, "y": 0, "width": 1512, "height": 982 },
"visibleFrame": { "x": 0, "y": 0, "width": 1512, "height": 945 },
"displayUUID": null,
"safeAreaTop": 37,
"auxiliaryTopLeftArea": null,
"auxiliaryTopRightArea": null
}
],
"residents": [
{
"entityID": "11111111-2222-3333-4444-555555555555",
"selector": "No.7#1",
"name": "Moku",
"number": 7,
"layer": "floating",
"visibility": "visible",
"presence": "everywhere",
"displayID": "display-1",
"footprint": { "x": 1180, "y": 48, "width": 160, "height": 160 },
"size": 160
}
]
}
},
"isError": false,
"_meta": {
"io.modelcontextprotocol/serverInfo": {
"name": "Pixling",
"version": "1.0.0"
}
}
}
}
```
Results evolve additively: ignore unknown fields and enum values. Calls using a deprecated form include `deprecations` beside `result` (see [CLI: Compatibility](/docs/reference/cli/#compatibility)). `tools/list` does not mark deprecated tools.
| Case | Returned as |
| --- | --- |
| Unknown tool or malformed JSON-RPC / params / metadata | JSON-RPC protocol error (`-32602` and others) |
| Refused tool argument | Tool result (`isError: true`) with `error.code: "invalidArguments"` |
| App unavailable, target not found, or domain rejection | Typed tool result (`isError: true`) |
| Rate limit (1000 req/s per ingress) | Tool result (`isError: true`) with `error.code: "rateLimited"` |
| Internal server failure (such as encoding) | JSON-RPC `-32603` |
### Refused tool arguments
An unreadable value, unknown key, or missing required key never reaches the app. Pixling returns it as a tool result (`isError: true`) rather than a JSON-RPC error because many hosts hide JSON-RPC errors from the model:
```json title="invalidArguments tool result"
{
"ok": false,
"operation": "sequence.start",
"invocationID": "...",
"protocolVersion": 1,
"error": {
"code": "invalidArguments",
"field": "steps[2].to",
"problem": "...",
"hint": "..."
}
}
```
### Other error behaviors
- **Unknown tool**: Tells the client to refresh `tools/list` or reconnect when the cached tool list disagrees with the running app build.
- **Runaway fence (`rateLimited`)**: Caps each ingress at **1000 requests/second** to stop infinite loops, not as a quota. It is distinct from domain `rejected` so hosts can back off and retry.
- **Build identification**: `capabilities.get` returns each operation's `{id, access}` (with `deprecated` when scheduled for removal) and `app {version, build, commit, protocolVersion}` (`commit` is `unknown` when unavailable). Compare this against the caller's build (CLI: `pixling --version`) after an unknown tool or `unknownOperation`.
- **Per-resident message receipts**: `message.send` succeeds per resident, so the call stays `ok`; unshown entries carry `rejection`, `heldBecause`, and `hint` inside their receipt ([Messages and questions](/docs/reference/messages-and-questions/)).
- **Unbound or stowed clients**: `inbox.watch` on an unbound namespace/key returns `rejected` / `notBound` immediately without waiting ([Inbox](/docs/reference/inbox/)). Targeting an unbound or stowed `client:/` returns `targetNotFound` with a hint to check `resident.ensure` for `onDesk` vs. `stowed` ([Resident binding](/docs/reference/resident-binding/)).
- **Opaque `promptID`**: Pass `promptID` only from `question.ask` to `question.result` or `question.cancel` ([Messages and questions](/docs/reference/messages-and-questions/)).
See [Read refusals](/docs/connect/errors/) for recovery patterns.
## Trust boundary
```text title="Defense-in-depth layers"
1. Explicit opt-in in Settings (nothing listens when CLI & MCP are off)
2. Loopback-only binding (127.0.0.1:48271)
3. Origin validation + Host validation (anti-DNS-rebinding)
4. Optional 256-bit bearer token
5. Fixed client identity (mcp:local-mcp)
6. Closed allowlist of operations + user-toggleable tool groups
7. Limits: 200 concurrent connections, 1000 req/s runaway fence per ingress
```
> [!NOTE]
> **Annotations are hints, not permissions**
> MCP tool annotations are UX hints, not security boundaries. Pixling never reads global input, the cursor, other apps, or TOML files you own. With both **CLI connection** and **MCP connection** off, nothing listens.
## Related
- [MCP tools](/docs/reference/mcp-tools/): Full generated catalog of every MCP tool, its access hints, and groups.
- [Operations and failure codes](/docs/reference/operations/): The closed operation list and failure code vocabulary shared with the CLI.
---
# MCP tools
> Every tool the pixling MCP server lists, with its operation, access and required arguments.
The `pixling` MCP server speaks Streamable HTTP at `http://127.0.0.1:48271/mcp` ([Connect an agent](/docs/connect/)). `tools/list` preserves the order below and omits any tool whose operation the running app does not offer.
| Column | Meaning |
| --- | --- |
| `access` | The tool's `readOnlyHint` and `destructiveHint` annotations: `read-only`, `write`, or `write, destructive` |
| `idempotent` | The tool's `idempotentHint` |
| `required` | Arguments required by the input schema |
See [Effects and retries](/docs/connect/effects/) for what each access kind changes, and call `tools/list` for each tool's full input schema.
## Core and groups
Six core tools carry `_meta: {"anthropic/alwaysLoad": true}` so hosts that load tools on demand still expose them from the start: `pixling_resident_ensure`, `pixling_message_send`, `pixling_question_ask`, `pixling_inbox_watch`, `pixling_inbox_read`, and `pixling_resident_requestClose`. Server instructions map the remaining tools by group.
| Group | Tools | Can be turned off |
| --- | --- | --- |
| **Conversation** | The core six, `question.result`, `question.cancel`, `capabilities.get`, `conversation.read` | No |
| **View** | `residents.list`, `zukan.list`, `resident.describe`, `resident.sketch`, `resident.pixels`, `settings.get` | No |
| **Motion** | `resident.emote`, `resident.bounce`, `resident.glow`, `resident.throw`, `resident.status`, `status.define`, `sequence.*` | Yes |
| **Placement** | `resident.place`, `resident.set`, `resident.desktopVisibility`, `resident.summon`, `resident.duplicate`, `resident.stow` | Yes |
| **Graph** | `group.*`, `relation.*` | Yes |
| **Library** | `note.*`, `import.*`, `kit.*` | Yes |
| **App settings** | `settings.set`, `app.quit` | Yes |
> [!NOTE]
> **Turning off a tool group**
> Optional groups are on by default and can be toggled in Studio under **Connect** › **Actions given over MCP**. Turning a group off removes its operations from MCP's `capabilities.get` and `tools/list`, and calls to its tools fail with `rejected` / `toolFamilyOff`. The setting applies to all MCP connections without affecting the CLI, and connected agents see the update on their next `tools/list`.
## Tool catalog
The table below is generated from the app's tool catalog.
| tool | operation | access | idempotent | required | title |
| --- | --- | --- | --- | --- | --- |
| `pixling_capabilities_get` | `capabilities.get` | read-only | idempotent | — | Get Pixling capabilities |
| `pixling_residents_list` | `residents.list` | read-only | idempotent | — | List desktop residents |
| `pixling_resident_glow` | `resident.glow` | write | non-idempotent | `to` | Light a resident |
| `pixling_resident_emote` | `resident.emote` | write | non-idempotent | `to`, `text` | Pop an emote above a resident |
| `pixling_resident_bounce` | `resident.bounce` | write | non-idempotent | `to` | Squash a resident's body |
| `pixling_resident_throw` | `resident.throw` | write | non-idempotent | `to`, `velocity` | Throw a resident |
| `pixling_resident_status` | `resident.status` | write | idempotent | `to` | Set your resident's status |
| `pixling_message_send` | `message.send` | write | non-idempotent | `to`, `text` | Send a resident message |
| `pixling_question_ask` | `question.ask` | write | non-idempotent | `to`, `question`, `choices` | Ask the user a question |
| `pixling_question_result` | `question.result` | write | non-idempotent | `promptID` | Read or wait for a question result |
| `pixling_question_cancel` | `question.cancel` | write | idempotent | `promptID` | Cancel your own question |
| `pixling_resident_requestClose` | `resident.requestClose` | write | non-idempotent | `to` | Ask to close your session |
| `pixling_resident_place` | `resident.place` | write | idempotent | `to` | Place a resident |
| `pixling_resident_describe` | `resident.describe` | read-only | idempotent | `to` | Describe a resident's settings |
| `pixling_resident_desktopVisibility` | `resident.desktopVisibility` | write | idempotent | `to`, `action` | Show or hide residents on this desktop |
| `pixling_resident_set` | `resident.set` | write | idempotent | `to` | Change a resident's settings |
| `pixling_zukan_list` | `zukan.list` | read-only | idempotent | — | List the zukan (library) |
| `pixling_note_get` | `note.get` | read-only | idempotent | `scope`, `to` | Read a local note |
| `pixling_note_set` | `note.set` | write, destructive | idempotent | `scope`, `to`, `note` | Replace a local note |
| `pixling_settings_get` | `settings.get` | read-only | idempotent | — | Read the app settings |
| `pixling_settings_set` | `settings.set` | write | non-idempotent | — | Change the app settings |
| `pixling_conversation_read` | `conversation.read` | read-only | idempotent | `to` | Read a resident's conversation |
| `pixling_app_quit` | `app.quit` | write, destructive | idempotent | — | Quit Pixling |
| `pixling_resident_ensure` | `resident.ensure` | write | idempotent | `namespace`, `key` | Create or recover a session resident |
| `pixling_resident_summon` | `resident.summon` | write | non-idempotent | `who` | Summon a resident to the desk |
| `pixling_resident_duplicate` | `resident.duplicate` | write | non-idempotent | `to` | Duplicate a resident |
| `pixling_resident_stow` | `resident.stow` | write, destructive | non-idempotent | `to` | Stow a resident |
| `pixling_resident_sketch` | `resident.sketch` | read-only | idempotent | `to` | Sketch a resident in ASCII |
| `pixling_resident_pixels` | `resident.pixels` | read-only | idempotent | `to` | Read exact resident pixels |
| `pixling_import_prepare` | `import.prepare` | write | non-idempotent | — | Bring in a picture, GIF or video |
| `pixling_import_adopt` | `import.adopt` | write, destructive | non-idempotent | `draftID` | Adopt a brought-in resident |
| `pixling_inbox_watch` | `inbox.watch` | read-only | idempotent | `namespace`, `key` | Wait for user messages |
| `pixling_inbox_read` | `inbox.read` | write | idempotent | `namespace`, `key`, `messageID` | Read a user message |
| `pixling_sequence_start` | `sequence.start` | write | non-idempotent | `schemaVersion`, `requestID`, `to` | Run a finite resident sequence |
| `pixling_sequence_get` | `sequence.get` | read-only | idempotent | `runID` | Read sequence state |
| `pixling_sequence_cancel` | `sequence.cancel` | write | idempotent | `runID` | Cancel a sequence |
| `pixling_sequence_save` | `sequence.save` | write, destructive | idempotent | `to`, `name`, `steps` | Save a named sequence |
| `pixling_sequence_list` | `sequence.list` | read-only | idempotent | `to` | List saved sequences |
| `pixling_sequence_delete` | `sequence.delete` | write, destructive | idempotent | `to`, `name` | Delete a saved sequence |
| `pixling_status_define` | `status.define` | write, destructive | idempotent | `to`, `name` | Define a status look |
| `pixling_group_list` | `group.list` | read-only | idempotent | — | List groups |
| `pixling_group_create` | `group.create` | write | non-idempotent | `name` | Create a group |
| `pixling_group_rename` | `group.rename` | write, destructive | idempotent | `groupID`, `name` | Rename a group |
| `pixling_group_delete` | `group.delete` | write, destructive | idempotent | `groupID` | Delete a group |
| `pixling_group_members` | `group.members` | read-only | idempotent | `groupID` | List group members |
| `pixling_group_add` | `group.add` | write | idempotent | `groupID`, `to` | Add a group member |
| `pixling_group_remove` | `group.remove` | write, destructive | idempotent | `groupID`, `to` | Remove a group member |
| `pixling_relation_list` | `relation.list` | read-only | idempotent | `groupID` | List relations |
| `pixling_relation_define` | `relation.define` | write | non-idempotent | `groupID`, `name` | Define a relation |
| `pixling_relation_update` | `relation.update` | write, destructive | idempotent | `relationID`, `name` | Update a relation |
| `pixling_relation_delete` | `relation.delete` | write, destructive | idempotent | `relationID` | Delete a relation |
| `pixling_relation_links` | `relation.links` | read-only | idempotent | `relationID` | List relation links |
| `pixling_relation_link` | `relation.link` | write | idempotent | `relationID`, `from`, `to` | Link group members |
| `pixling_relation_unlink` | `relation.unlink` | write, destructive | idempotent | `relationID`, `from`, `to` | Unlink group members |
| `pixling_relation_fire` | `relation.fire` | write | non-idempotent | `relationID`, `from` | Pulse a relation |
| `pixling_kit_list` | `kit.list` | read-only | idempotent | — | List speech kits |
| `pixling_kit_describe` | `kit.describe` | read-only | idempotent | `kit` | Describe a speech kit |
| `pixling_kit_set` | `kit.set` | write, destructive | non-idempotent | `kit` | Change a speech kit |
| `pixling_kit_duplicate` | `kit.duplicate` | write | non-idempotent | `kit` | Duplicate a speech kit |
| `pixling_kit_delete` | `kit.delete` | write, destructive | non-idempotent | `kit` | Delete a speech kit |
| `pixling_kit_import` | `kit.import` | write, destructive | non-idempotent | `folder` | Import a speech kit |
| `pixling_kit_export` | `kit.export` | write, destructive | non-idempotent | `kit` | Export a speech kit |
| `pixling_kit_preview` | `kit.preview` | read-only | idempotent | `kit` | Preview a speech kit |
| `pixling_kit_propList` | `kit.propList` | read-only | idempotent | — | List speech prop assets |
| `pixling_kit_propImport` | `kit.propImport` | write | idempotent | `file` | Import a speech prop PNG |
Capabilities without a tool: none.
---
# CLI
> How the bundled pixling CLI connects, where it lives, what it prints, its exit codes, doctor, and command notes.
`pixling` is a thin client that sends typed operations to the running Pixling app over a local Unix socket. It never edits settings files directly and keeps no separate state.
```sh title="Terminal"
pixling residents
pixling call residents.list '{"detail":"brief"}'
pixling schema resident.set
```
See [CLI commands](/docs/reference/cli-commands/) for the full subcommand list, [Connect an agent](/docs/connect/) to enable the connection, and [Read refusals](/docs/connect/errors/) for error handling.
## Key behaviors
- **No listener when off**: While **CLI connection** is off, Pixling creates neither a socket listener nor a background helper.
- **Structured envelope**: The app returns a JSON document that the CLI maps to stdout, stderr, and an exit code.
- **Program-first and human commands**: `call`, `rpc`, and `schema` always output one-line JSON and take the exact JSON schemas used by MCP. Everyday subcommands print human-readable text by default and accept `--json` or `PIXLING_FORMAT=json`.
- **Fixed identity**: Every invocation runs as `cli:local-cli`, with no pairing, login, or Keychain credentials.
- **Script-friendly**: The root command and every subcommand support `--help`. Free-text and signed-number options accept leading hyphens (such as `- item` or `-120`) as values rather than flags. The root supports `--version`, `--timeout-ms`, standard usage errors, and never prompts interactively.
## Programmatic interface
Use `call`, `rpc`, and `schema` from scripts, tools, and agents when you want machine-readable JSON without flag translation.
### `pixling call`
Sends one request/response operation by its capability ID and prints one JSON document on stdout:
```sh title="Terminal"
pixling call residents.list '{"detail":"brief"}'
pixling call resident.set @patch.json
printf '{"to":"No.7#1","hidden":true}\n' | pixling call resident.set -
```
- Pass arguments as inline JSON, `@path/to/file.json`, `-` for standard input, or piped standard input (up to 64 KiB). Omitting input on a terminal sends `{}`.
- Arguments follow the exact JSON schema returned by `pixling schema ` and MCP `tools/list`.
- Streaming operations (`inbox.receive`, `resident.follow`, `resident.events`) are refused with exit code `64` and a hint naming their dedicated subcommand.
### `pixling rpc`
Runs a persistent NDJSON worker over standard input and standard output so callers avoid spawning a new process per request:
```sh title="Terminal"
printf '{"id":1,"op":"capabilities.get"}\n{"id":2,"op":"residents.list","args":{"detail":"brief"}}\n' | pixling rpc
```
- Each input line is a JSON object: `{"id"?: string|number, "op": "", "args"?: {...}, "timeoutMs"?: 100...300000}`.
- Each response is one JSON line on stdout matching the common envelope, echoing `id` when provided.
- `--concurrency <1...16>` sets in-flight request parallelism (default `1`, FIFO response order). Higher concurrency may return responses out of order; correlate with `id`.
- Malformed input lines emit a structured JSON error line and keep the worker running until stdin EOF (exit `0`).
### `pixling schema`
Prints machine-readable JSON schemas for all public operations (or one named operation) without connecting to Pixling:
```sh title="Terminal"
pixling schema
pixling schema resident.set
```
The result includes `operations`: every public capability (`id`, `access`, `streaming: false`, `inputSchema`) plus CLI-only streaming commands (`inbox.receive`, `resident.follow`, and `resident.events` with `streaming: true`, `command`, `summary`, and `inputSchema`).
## Install the binary
Every build bundles the binary inside `Pixling.app`:
- Real binary: `Pixling.app/Contents/Helpers/PixlingCLI.app/Contents/MacOS/pixling`
- Bundled symlink: `Pixling.app/Contents/MacOS/pixling`
Put either path on your `PATH`. Because the App Store build runs inside the App Sandbox, it cannot write outside its container, so you create the symlink yourself:
```sh title="Terminal"
mkdir -p ~/.local/bin && ln -sf '/Applications/Pixling.app/Contents/Helpers/PixlingCLI.app/Contents/MacOS/pixling' ~/.local/bin/pixling
```
With **CLI connection** turned on in **Settings** › **Connect**, **Copy** puts the exact binary path and one-line setup command on your clipboard.
> [!NOTE]
> **App Sandbox boundary**
> The distributed CLI runs inside the App Sandbox and can reach only its own container and the shared group container. You cannot use `--socket` to target another app's socket.
### Socket locations
The desk helper (`app.pixling.studio.desk`, always sandboxed) serves both CLI and MCP. The CLI checks two socket paths in order and connects to the first one that exists:
| Order | Location | Path |
| --- | --- | --- |
| 1 | Shared group container (`group.app.pixling.studio`) | `~/Library/Group Containers/group.app.pixling.studio/pixling.sock` |
| 2 | Desk container fallback | `~/Library/Containers/app.pixling.studio.desk/Data/.pixling/pixling.sock` |
If neither exists, the CLI fails immediately with `socketMissing`. Before listening, Pixling verifies the socket owner, symlinks, file type, parent directory mode (`0700`), and socket mode (`0600`).
When the fallback or `--socket` is used
- **Desk container fallback**: Used for ad-hoc or other-Team signed builds, or when a long macOS username pushes the group container path to 104 bytes or longer.
- **Development builds (`--bundle-id`)**: Test builds place their socket under `.desk`. Pass `--socket /absolute/path/to/.pixling/pixling.sock` or set `PIXLING_SOCKET` (development builds only) for non-standard layouts.
## Output
- **Default (human)**: Everyday subcommands write results to stdout and diagnostics to stderr. Failure hints print on a `hint:` line.
- **`--json` and `PIXLING_FORMAT=json`**: Writes one JSON document per invocation on stdout for both success and failure. Logs never mix into stdout. `call`, `rpc`, and `schema` always output JSON.
- **`--timeout-ms <100...300000>`**: Overrides the per-request socket deadline in milliseconds.
```json title="Common JSON envelope"
{"invocationID":"...","ok":true,"operation":"question.result","protocolVersion":1,"result":{}}
{"error":{"code":"targetNotFound"},"invocationID":"...","ok":false,"operation":"message.send","protocolVersion":1}
```
### Usage errors
With `--json`, argument parser and codec refusals also print a single JSON line on stdout with exit code `64`. Because the request never reached the app, `invocationID` is omitted:
```json title="Usage error with --json"
{"error":{"code":"invalidArguments","field":"limit","hint":"…","problem":"`limit` must be 1...500"},"ok":false,"operation":"zukan.list","protocolVersion":1}
```
Without `--json`, parser messages and usage go to stderr.
### Connection failures
When the CLI cannot reach Pixling, `error.code` is `unavailable` and `error.detail` names the cause:
| `error.detail` | Meaning |
| --- | --- |
| `socketMissing` | Pixling is not running, or **CLI connection** is off (fails without waiting). |
| `connectionFailed` | The socket exists, but refused the connection. |
| `timedOut` | Pixling did not answer in time. |
| `invalidResponse` | Pixling closed the connection or sent an unreadable response. |
| `invalidPath` | No candidate socket path fits within the 104-byte Unix socket limit. |
| `disconnected` | Connection ended while holding `inbox receive` ([Inbox](/docs/reference/inbox/#inbox-receive)). |
For the first three details, human output prints a `hint:` line suggesting `pixling doctor`, and `--json` puts the same text in `error.hint`.
## Exit codes
| Exit code | Meaning | Error codes |
| --- | --- | --- |
| `0` | Success | — |
| `3` | Unreachable, disallowed, busy, or build mismatch | `unavailable`, `unauthorized`, `busy`, `rateLimited`, `unknownOperation` |
| `4` | Target could not be resolved | `targetNotFound`, `targetAmbiguous`, `targetMustBeSingular` |
| `5` | Domain refusal | `rejected` |
| `64` | Usage error (`EX_USAGE`) | `invalidArguments` |
| `70` | Internal or encoding error | `internalFailure` |
`unknownOperation` means the CLI and the running app are different builds; the failure document includes a `hint`.
## Diagnose with doctor
`pixling doctor` runs four read-only checks in one command without changing app state or leaving processes behind. It sends one `capabilities.get` over the socket and one `ping` to MCP.
```sh title="Terminal"
pixling doctor
PIXLING_MCP_TOKEN="..." pixling doctor --json
```
Pass an MCP bearer token only through the `PIXLING_MCP_TOKEN` environment variable, never as a CLI argument.
| Check `id` | What it verifies |
| --- | --- |
| `cli` | Reads the CLI build metadata from `PixlingCLI.app` (works through symlinks). |
| `socket` | Checks candidate paths in search order, verifying existence, file type, 104-byte limit, owner, and modes (`0600` / parent `0700`). |
| `app` | Calls `capabilities.get` and checks whether the CLI and app commits and protocol versions match. |
| `mcp` | Sends a sessionless `POST` `ping` to `127.0.0.1:48271/mcp`. Skipped (`skip`) on the sandboxed distributed CLI. |
Each check outputs a `status` (`ok`, `warn`, `fail`, or `skip`), a closed-set `code`, a one-line `summary`, and a `next` step. Human output prints `status id summary`, an indented `→` line for `next`, and a final `all ok` or `N fail, M warn`.
```json title="pixling doctor --json"
{"ok":true,"operation":"doctor","protocolVersion":1,"result":{"checks":[{"code":"identified","details":{},"id":"cli","status":"ok","summary":"…"}],"counts":{"fail":0,"ok":4,"skip":0,"warn":0}}}
```
`ok` is `true` and exit code is `0` when no check fails (`warn` and `skip` pass). Any failure returns exit code `3`.
Doctor status codes and diagnostic details
App refusal words and socket details never become `code`; they appear inside `details` (`appCode`, `detail`).
| `id` | Possible `code` values |
| --- | --- |
| `cli` | `identified` |
| `socket` | `found`, `socketMissing`, `pathTooLong`, `unsafePermissions` |
| `app` | `reachable`, `buildMismatch`, `cliConnectionOff`, `appNotRunning`, `socketMissing`, `connectionRefused`, `timedOut`, `invalidResponse`, `invalidPath`, `unreachable`, `rateLimited`, `appRefused` |
| `mcp` | `answering`, `tokenRequired`, `tokenRejected`, `unexpectedStatus`, `notListening`, `timedOut`, `probeFailed`, `sandboxed` |
- **Build mismatch (`app`)**: Warns `buildMismatch` (`"CLI and app builds differ"`) if commit or protocol version disagrees. When either commit is `unknown`, only the protocol version is compared and `details.sameBuild` is `null`.
- **MCP `401` (`mcp`)**: HTTP `401` reports `tokenRequired` ("answering") without `PIXLING_MCP_TOKEN`, and `fail` (`tokenRejected`) when a token was provided. The sandboxed distributed CLI cannot access the network and reports `skip` (`sandboxed`, `"unknown (sandboxed CLI)"`).
- **Stale sockets and timeouts**: `connectionFailed` on an existing socket is reported as a stale socket or a listener being recreated; `timedOut` indicates the app is busy.
**Off vs. not running**: When no socket exists, doctor checks whether the bundled desk helper inside the same `Pixling.app` (`Pixling.app/Contents/Library/LoginItems/PixlingDesk.app`) is running as your user. Desk helpers from other `Pixling.app` bundles (such as test builds) are ignored.
| Situation | What `pixling doctor` reports | What to do |
| --- | --- | --- |
| Bundled desk helper is running as your user | `cliConnectionOff` (**CLI connection** is off) | Turn on **CLI connection** in **Settings** › **Connect**. |
| Bundled desk helper is not running | `appNotRunning` (Pixling is not running) | Launch Pixling. |
Unbundled CLIs, explicit `--socket` runs, and sandboxed CLIs cannot identify a counterpart desk and report `unknown` with both causes.
## Compatibility
- **Closed schema**: Every setting or placement change is a typed operation listed by `capabilities.get` and `pixling schema`, validated by the shared control codec. There is no generic `set`, arbitrary file write, or untyped back door.
- **No leaked internals**: Operation results never include secrets, raw exceptions, or local paths. `doctor` is the single exception, reporting the socket paths it inspected.
- **CLI guidelines**: Follows the [Command Line Interface Guidelines](https://clig.dev/).
- **Additive changes**: New operations, optional inputs, result fields, and output enum values can arrive in any release. Ignore unknown output fields and values.
- **Breaking-change grace period**: Removing or renaming anything, requiring a previously optional input, changing a meaning or unit, or narrowing accepted values keeps working until the release after the next one, and for at least **90 days**.
### Deprecation notices
During a grace period, successful `--json` calls that use a deprecated form include `deprecations` beside `result`:
```json title="Response with deprecations"
{"deprecations":[{"instead":"…","removeAfter":{"date":"2027-06-01","release":"1.3.0"},"what":"…"}],"invocationID":"...","ok":true,"operation":"…","protocolVersion":1,"result":{}}
```
- `what` names the old form; `instead` names its replacement.
- The old form may stop working in `removeAfter.release` or later, and never before `removeAfter.date` (ISO 8601 date).
- Absence of `deprecations` means nothing deprecated was used. Failure documents and human output never show `deprecations`.
- A fully deprecated operation also adds `"deprecated": {"instead", "removeAfter": {"release", "date"}}` to its `capabilities.get` row; deprecating an input leaves the operation row unchanged.
- After removal, the refusal `hint` still names the replacement.
## Notes per command
Details that `--help` and usage lines do not cover.
### Selectors
- `SELECTOR` accepts a UUID, a Field Guide number (`No.N`), a placement number (`No.N#ORDINAL`), a resident's current exact name, or `everyone` (`*` also works).
- A number or name targets every copy of that asset on the desk; a placement number targets one copy. A name shared by two assets on the desk fails as ambiguous.
- Questions must resolve to exactly one resident.
- Built-in starters follow the app language (`Moku`, `モク`, `木木`, `모쿠`), so portable scripts should use `No.N`.
- `prompt-id` is an opaque handle returned by `question ask`. Never construct it or pass it as a resident ID.
### `--version` and `capabilities`
`--version` prints `VERSION (build N, commit HASH, protocol P)` (`commit` is `unknown` when unavailable). It reads `Info.plist` from the `PixlingCLI.app` containing the binary's real path, so it stays accurate through symlinks.
The running app's build appears on the `app: …` line of `pixling capabilities`, or in `result.app` with `--json`.
### `sequence start`
Run `pixling sequence start --help` for step syntax. On refusal, the failing item's `reason` prints on the line after `at `. See [Sequences](/docs/reference/sequences/).
### Command reference map
| Command or flag | Details |
| --- | --- |
| `residents` | [Residents: `pixling_residents_list`](/docs/reference/residents/#pixling_residents_list) |
| `--to auto` | [Messages and questions: `auto` target](/docs/reference/messages-and-questions/#the-auto-target) |
| `question ask`, `result`, `cancel` | [Messages and questions: `pixling_question_ask`](/docs/reference/messages-and-questions/#pixling_question_ask) |
| `resident place` | [Residents: `pixling_resident_place`](/docs/reference/residents/#pixling_resident_place) |
| `resident describe`, `set` | [Resident settings](/docs/reference/resident-settings/) (including [gravity](/docs/reference/resident-settings/#gravity)) |
| `resident follow` | Reads window frames from stdin until EOF ([Residents](/docs/reference/residents/#resident-follow-cli-only), [Follow a window](/docs/connect/follow-a-window/)). |
| `resident events` | Streams one JSON line per click on your resident until stowed; nothing is saved ([Residents](/docs/reference/residents/#resident-events-cli-only), [Hear clicks](/docs/connect/hear-clicks/)). |
| `resident glow` | Pass one step with `--select`, or `--steps-json` ([Light (glow)](/docs/reference/light/)). |
| `zukan`, `resident summon`, `duplicate`, `stow` | [Residents: summon, duplicate, and stow](/docs/reference/residents/#summon-duplicate-and-stow) |
| `resident ensure --asset-id` | Accepts `No.N`, exact name, or ID ([Resident binding](/docs/reference/resident-binding/)). |
| Shapes and `resident sketch` | [Residents: shapes and sketch](/docs/reference/residents/#shapes-and-pixling_resident_sketch) |
| `import prepare` | [Import](/docs/reference/import/) |
| `doctor` | Pass the MCP token in `PIXLING_MCP_TOKEN` ([Diagnose with doctor](#diagnose-with-doctor)). |
## Related
- [CLI commands](/docs/reference/cli-commands/): Complete generated list of subcommands and flag synopses.
- [MCP server](/docs/reference/mcp/): Streamable HTTP endpoint, protocol profiles, and trust boundary.
---
# CLI commands
> The commands of the bundled pixling CLI.
Most `pixling` subcommands connect to the running app, run one operation, and exit. Five long-lived commands stay open instead:
- `rpc`: keeps one connection open, reading NDJSON request lines from stdin and printing one JSON response line per request until EOF.
- `inbox wait`: blocks until unread IDs arrive, and keeps waiting while the app is down.
- `inbox receive`: holds a receiver until the user puts the resident away or the connection ends.
- `resident follow`: reads window rectangles from stdin until EOF to keep a resident against a window edge.
- `resident events`: prints one JSON line per click on your resident until it is put away.
> [!TIP]
> **JSON output, exit codes, and per-command help**
> `pixling call`, `pixling rpc`, and `pixling schema` always print JSON. For all other commands, pass `--json` or set `PIXLING_FORMAT=json` to print one JSON document on stdout for both success and failure, matching MCP's `structuredContent`. See [Read refusals](/docs/connect/errors/) and [CLI exit codes](/docs/reference/cli/#exit-codes) for exit codes, and run `pixling schema` or `pixling --help` for full arguments and values.
## Quick index by task
| Task | Commands | Reference |
| --- | --- | --- |
| Programmatic RPC & schema | `call`, `rpc`, `schema` | [CLI](/docs/reference/cli/) |
| Session & inbox | `resident ensure`, `resident request-close`, `inbox wait`, `inbox receive`, `inbox watch`, `inbox read` | [Resident binding](/docs/reference/resident-binding/), [Inbox](/docs/reference/inbox/) |
| Speech & questions | `message send`, `question ask`, `question result`, `question cancel`, `conversation read` | [Messages and questions](/docs/reference/messages-and-questions/) |
| Residents & layout | `residents`, `resident place`, `resident follow`, `resident desktop-visibility`, `resident summon`, `resident duplicate`, `resident stow`, `resident events`, `call resident.pixels` | [Residents](/docs/reference/residents/) |
| Settings & appearance | `resident describe`, `resident set`, `resident sketch`, `settings get`, `settings set` | [Resident settings](/docs/reference/resident-settings/), [App settings](/docs/reference/settings/) |
| Speech kits | `kit list`, `kit describe`, `kit set`, `kit duplicate`, `kit delete`, `kit import` | [Speech kits](/docs/reference/speech-kits/) |
| Motion & sequences | `resident glow`, `resident emote`, `resident bounce`, `resident throw`, `resident status`, `status define`, `sequence *` | [Light (glow)](/docs/reference/light/), [Sequences](/docs/reference/sequences/), [Residents](/docs/reference/residents/) |
| Groups & relations | `call group.*`, `call relation.*` | [Groups and relations](/docs/reference/groups-and-relations/) |
| Library & import | `zukan`, `note get`, `note set`, `import prepare`, `import adopt` | [Residents](/docs/reference/residents/#pixling_zukan_list), [Notes](/docs/reference/notes/), [Import](/docs/reference/import/) |
| Diagnostics & app | `capabilities`, `doctor`, `app quit` | [CLI](/docs/reference/cli/), [App settings](/docs/reference/settings/) |
## Command catalog
The table and usage block below are generated from the built command tree (hidden developer commands and `help` are omitted).
| command | summary |
| --- | --- |
| `pixling call` | Send one typed operation as JSON and print one JSON document to stdout. |
| `pixling rpc` | Run a persistent NDJSON request/response worker on stdin and stdout. |
| `pixling schema` | Print the JSON input schema for one operation or all operations. |
| `pixling capabilities` | List operations supported by the app. |
| `pixling doctor` | Diagnose why the CLI or MCP cannot reach Pixling (read-only). |
| `pixling inbox wait` | Block until unread IDs newer than --since exist, waking on the app's notification. Keeps waiting while the app is down. |
| `pixling inbox receive` | Hold a receiver: it tells the app your session hears what the user writes at once. Exits 0 when the user puts it away, 3 when Pixling is unreachable or the connection ends, 5 when refused. |
| `pixling inbox watch` | Wait once for unread IDs, without reading bodies. Repeats unread IDs until read. |
| `pixling inbox read` | Read a message body and persist its read status. |
| `pixling residents` | List residents on the desktop, per display from front to back. |
| `pixling resident place` | Move, resize, rotate, or mirror exactly one resident. Omitted axes stay as they are. |
| `pixling resident follow` | Keep one resident against a window's edge, following rectangles read from stdin until it ends. |
| `pixling resident describe` | Show one resident's current settings and the values it can take. |
| `pixling resident set` | Change one resident's settings. Use shorthand flags for common fields, or --input JSON / `pixling call resident.set` for all fields. |
| `pixling resident desktop-visibility` | Hide here, show here, or show only here; keeps position and physical display. |
| `pixling resident ensure` | Create or recover one resident by stable client namespace/key. Stowed keys stay stowed while bound. |
| `pixling resident summon` | Bring one resident from the zukan to the desk as a new copy. |
| `pixling resident duplicate` | Duplicate exactly one placed resident, settings included. |
| `pixling resident stow` | Put exactly one placed resident back into the zukan. |
| `pixling resident sketch` | Print a coarse ASCII sketch of a resident (its resting frame, or frames of one motion) plus the shape of each stored size of its picture. |
| `pixling resident glow` | Light one resident once: what (all, colors, color groups, points), which color, and how (pulse, sweep, blink). Success means accepted, not confirmed playback. |
| `pixling resident emote` | Pop an emoji or short text above one resident's head. Success means accepted, not confirmed playback. |
| `pixling resident bounce` | Squash one resident against a side and spring back, like hitting a wall. Calls stack. Success means accepted, not confirmed playback. |
| `pixling resident throw` | Throw one resident with an initial velocity (pt/s, +x right, +y up). The endpoint is saved before it moves. |
| `pixling resident status` | Give your own resident a temporary status (a name, idle motion or pose) until replaced, cleared or expired. Nothing is saved. |
| `pixling resident request-close` | Ask the user on your own resident whether to close this session; yes puts the resident away. |
| `pixling resident events` | Print one JSON line per click on your own resident until it is put away. Nothing is kept. |
| `pixling note get` | Read a local note. |
| `pixling note set` | Replace a local note; empty text clears it. |
| `pixling settings get` | Read the app-wide settings, the read-only connection values and the options. |
| `pixling settings set` | Change app-wide settings in one save; pass --input JSON (or `pixling call settings.set`) for all fields. |
| `pixling conversation read` | Read one resident's conversation, oldest first, in pages. The user's words carry text only through your client: selector. |
| `pixling app quit` | Quit Pixling, as the resident menu's Quit Pixling does (Studio quits too). |
| `pixling zukan` | List the residents in the zukan (library), with how many copies are on the desk, in pages. |
| `pixling import prepare` | Start a draft from a file (or add it to --draft as another motion), change a motion, or reopen --asset. |
| `pixling import adopt` | Save a prepared draft into the zukan as one resident, once; a reopened draft replaces its resident. |
| `pixling kit list` | List the speech kits: built in, and the user's own. |
| `pixling kit describe` | Read one kit as drawn: its parts, colours, motion, presets, forms and notes. |
| `pixling kit set` | Change a kit from a JSON patch object (inline, @file, or stdin). Built-in kits copy to .mine on first change. |
| `pixling kit duplicate` | Copy a kit as one of the user's; prints its id. |
| `pixling kit delete` | Delete one of the user's kits; copies over it stay as standalone kits. Built-in kits are refused. |
| `pixling kit import` | Import a kit folder copied into the import folder (`pixling capabilities` shows it), by its bare name. |
| `pixling kit export` | Export a built-in or user kit into the import folder as kit.json + parts/*.png. |
| `pixling kit preview` | Render a static offscreen PNG preview of a speech kit into the import previews folder. |
| `pixling kit prop-list` | List registered prop PNGs (`speech-props/.png`) usable in frameSpec and props. |
| `pixling kit prop-import` | Register a PNG inside the import folder as a speech prop asset (`speech-props/.png`). |
| `pixling message send` | Show a speech bubble on residents, or with --keep leave a letter that waits for the user. |
| `pixling question ask` | Ask one resident a question and wait for the answer. |
| `pixling question result` | Read, or wait for, the answer to a question asked earlier. |
| `pixling question cancel` | Take back your own pending question (it closes as cancelled; nothing goes to the inbox). |
| `pixling sequence start` | Run steps, or a saved sequence by --name, on exactly one resident. |
| `pixling sequence get` | Read a run's state. |
| `pixling sequence cancel` | Cancel a run and its remaining steps. |
| `pixling sequence save` | Save steps under a name for a resident's asset (the same name replaces it). |
| `pixling sequence list` | List the sequences saved for an asset. |
| `pixling sequence delete` | Delete one saved sequence by name. |
| `pixling status define` | Save or remove a status name's look: a saved sequence to enter with and/or an idle motion or pose to hold (the same name replaces it). |
## Full usage synopsis
Show full CLI flag synopses for all subcommands
```text
pixling [--json] call []
pixling [--json] rpc [--concurrency ]
pixling [--json] schema []
pixling [--json] capabilities
pixling [--json] doctor
pixling [--json] inbox wait [--namespace ] [--key ] [--since ]
[--timeout-ms ] [--multiplex]
pixling [--json] inbox receive [--namespace ] [--key ] [--multiplex]
pixling [--json] inbox watch --namespace --key [--wait-ms ]
pixling [--json] inbox read --namespace --key
pixling [--json] residents [--layer ] [--client ] [--detail ]
[--query ]
pixling [--json] resident place --to [--x ] [--y ] [--size ] [--scale ]
[--rotation ] [--mirrored ]
pixling [--json] resident follow --to [--edge ] [--at ] [--offset-x ]
[--offset-y ] [--layer ]
pixling [--json] resident describe --to [--section ...]
pixling [--json] resident set [--to ] [--input ] [--layer ]
[--presence ] [--gravity ] [--click-through ]
[--throw ] [--hidden ] [--pose ] [--motion ]
[--idle-animation ] [--order ]
pixling [--json] resident desktop-visibility --to --action
pixling [--json] resident ensure --namespace --key [--asset-id ]
[--name ] [--note ] [--initial-note ] [--group-id ]
[--initial ]
pixling [--json] resident summon --who [--x ] [--y ] [--size ] [--note ]
[--group-id ]
pixling [--json] resident duplicate --to
pixling [--json] resident stow --to
pixling [--json] resident sketch --to [--columns ] [--animation ]
[--frame ...] [--colors]
pixling [--json] resident glow --to [--select