# Capture from anywhere

Capture puts a card on your board without opening it: share a link or a screenshot from your phone, say "add to
board" to Siri, or press a hotkey on your Mac. In the [desktop app](https://andon-docs.pages.dev/guide/desktop-app.md), ⌃⌥⌘Space (Ctrl+Alt+Space on Windows and Linux)
opens quick add from any app. Every capture becomes a card in the Backlog, owned by you, and its
recipe is picked for you unless you name one.

Captures go to the board's capture endpoint with a personal **capture token**. The endpoint's fields and replies are
in [the capture endpoint reference](https://andon-docs.pages.dev/reference/capture-api.md); this page sets up the common ways to call it.

## Make a capture token

1. Open **Settings → Connections**, then **Developer**, and choose **Capture tokens**.
2. Press **New token** and give it a label, such as "iPhone Share Sheet".
3. Copy the token (`andon_cap_…`). It is shown once.

Make one token per device, so you can revoke a lost phone without breaking your Mac.

Your **capture URL** depends on where your board runs:

| Board | Capture URL |
|---|---|
| Self-hosted (`andon up`, Docker, Vercel with Postgres) | `https://<your board>/functions/v1/capture` |
| Supabase | `https://<project-ref>.supabase.co/functions/v1/capture` |

Each capture is a `POST` to that URL with the header `Authorization: Bearer <token>`.

## iPhone and iPad

The Shortcuts app calls the capture URL for you. Apple ties a shared `.shortcut` file to the account that exported
it, so build it once (about three minutes), then send it to your other devices with **Share → Copy iCloud Link**.

### Share text, links and screenshots

1. In Shortcuts, press **+** and name the shortcut **Add to Andon**.
2. Press **ⓘ**, turn on **Show in Share Sheet**, and accept **URLs**, **Images** and **Text** (and **Files**).
3. Add **If** *Shortcut Input* **is** *URL*, and inside it **Get Contents of URL**: the capture URL, Method **POST**,
   Header `Authorization` = `Bearer andon_cap_…`, Request Body **JSON** with `url` = *Shortcut Input*.
4. Add **Otherwise, If** *Shortcut Input* **is** *Image*, and inside it:
   - **Ask for Input** "Title?" (Text). Left empty, the card gets a dated title.
   - **Get Contents of URL**: POST, the same header, Request Body **Form** with `title` = *Provided Input* (Text) and
     `file` = *Shortcut Input* (File).
5. Add **Otherwise**, and inside it **Get Contents of URL**: POST, the same header, Request Body **JSON** with
   `title` = *Shortcut Input*.
6. After **End If**, add **Show Notification** "Added to Andon".

Sharing a link makes a card about that link: a GitHub, Linear or Jira issue or pull request becomes one of the card's
links. Sharing a screenshot makes a card with the image attached. Shared text becomes the title.

### "Hey Siri, add to board"

1. Make a shortcut named **Add to board**: that name is the phrase Siri listens for.
2. Add **Dictate Text**, then **Get Contents of URL** (POST, the same header, Request Body **JSON** with `title` =
   *Dictated Text*).
3. Add **Show Notification** "Added".

## Mac

The two scripts below read your capture URL and token from one file. Create `~/.config/andon/capture.env`:

```sh
ANDON_CAPTURE_URL=<your capture URL>
ANDON_CAPTURE_TOKEN=andon_cap_…
```

then `chmod 600 ~/.config/andon/capture.env`.

### Raycast

1. Copy `scripts/capture/andon-capture.sh` from Andon's repository into your Raycast script commands folder.
2. In Raycast, search **Add to Andon**, type a title (and notes if you like), and press Enter.

### Screenshot to board

`scripts/capture/andon-screenshot.sh` lets you select part of the screen, asks for a title, and makes a card with the
image attached. Run it from a Shortcuts **Run Shell Script** action and give that shortcut a keyboard shortcut, or
add it to Raycast.

### A hotkey without Raycast

In the Shortcuts app, make a shortcut with **Ask for Input** (Title), then **Get Contents of URL** as on the iPhone,
with a JSON body. In the shortcut's settings, choose **Add Keyboard Shortcut**.

## From a terminal

On a machine with the Andon agent, `andon add` sends the same capture:

```sh
andon add "Checkout 500s" -t Web -a shot.png -a server.log
```

It needs no capture token: it captures as the person who enrolled the machine. To capture as someone else, save a
token with `andon capture-token`, which reads it from a hidden prompt or a pipe (`pbpaste | andon capture-token`),
never from the command line. Every flag is in
[`andon add`](https://andon-docs.pages.dev/reference/cli.md#andon-add); reading and changing cards from the terminal is under
[Cards](https://andon-docs.pages.dev/reference/cli.md#cards).

Without the agent, `scripts/capture/andon-capture.sh "title" "notes"` works from any shell.

## From a coding agent

The Andon agent gives every coding agent on the machine (Claude Code, Codex, Gemini CLI and others) a skill that
knows these commands, so you can say "log this as a card on team Web" in any repository: see
[The use-andon skill](https://andon-docs.pages.dev/machines/use-andon-skill.md).

## What a capture can say

Besides a title, a capture can carry notes, a link, files, and the team, project, PR group, recipe or card template
the card should use. For example, `{"title": "Login fails", "team": "Web", "template": "Bug"}` makes the card from the
Web team's *Bug* template. The [reference](https://andon-docs.pages.dev/reference/capture-api.md#fields) lists every field, the limits (10
files, 25 MB each, 30 MB a capture, 30 captures a minute per token) and the error replies.
