# Install Duet (instructions for an AI agent)

You are an AI agent and your user wants **Duet** on this computer. Duet runs WhatsApp Web for their accounts and gives agents a local MCP server and CLI to read chats, prepare drafts, send messages, and watch chats for replies.

Source: https://github.com/gvridi/duet

Follow these steps in order. Tell the user what you are doing as you go. Stop and ask when a step needs them.

## 0. Before you start, tell the user this

- Duet automates **WhatsApp Web**, which WhatsApp does not officially support for automation. Accounts that send spam or bulk messages can be banned. Duet is meant for one person's own chats, at human pace.
- Agents with access can read and send messages on the linked numbers. Each number has an **access switch** in Duet's sidebar; when it is off, agents cannot touch that number.
- Ask whether they want to continue.

## 1. Requirements

- Windows 10/11 or macOS (Apple Silicon). Git and Node.js 22.12 or newer (`node -v`). Install them with the system's normal installer if missing, after asking.

## 2. Get and build Duet

```sh
git clone https://github.com/gvridi/duet.git
cd duet
npm ci
npm test
npm run package          # Windows build into release/
# macOS: follow MAC_SETUP.md instead of the line above
```

Choose a permanent folder for the clone (for example the user's code or projects folder) and tell the user where it is.

## 3. Link WhatsApp (the user does this)

Start the app from `release/` (Windows: `release\WhatsApp-Duet-win32-x64\WhatsApp-Duet.exe`). Ask the user to scan the QR code with WhatsApp on their phone (Settings → Linked devices → Link a device). Wait until the sidebar shows **Linked**. For additional numbers, use **+ Add account** in the sidebar and repeat the linking step for each number the user wants.

## 4. Connect yourself

In Duet, open the account menu → **Copy MCP config**, and add that MCP server to your own configuration (Claude Code: `claude mcp add` or `.mcp.json`; Codex: `~/.codex/config.toml` under `[mcp_servers.duet]`; other agents: their MCP settings). Then ask the user to turn on **MCP access** for the numbers you may use.

Check: call `list_accounts`, then `account_status` for an enabled account. It should report `ready: true`.

## 5. Install the skill (recommended)

Copy `skill/duet/` from the repository into your skills folder (Claude Code: `~/.claude/skills/duet`; agents that read `~/.agents/skills`: there). In the copied folder, copy `location.example.json` to `location.json` and replace `<absolute path to the clone>` with the real path. Check it with `node <skill folder>/scripts/duet.mjs doctor`. The skill explains safe sending, drafts, and how to babysit a chat (watch it and get woken when the person replies).

## 6. Done

Tell the user: where Duet is installed, which numbers are linked, that drafts and watches appear in Duet's **Agent activity** drawer on the right, and that the access switch per number is theirs to turn off at any time.
