--- name: dawonai description: How this coding harness (Claude Code, Codex, OpenCode, OMP or Hermes Agent) reaches DawonAI through the `pai` program and its local proxy. Covers installing `pai`, pairing this machine with a one-time pairing code, `pai setup`, `pai status`, and fixing errors from `pai token` or the proxy. Use when the user asks to set up, connect, check, fix or disconnect DawonAI or `pai`, or when a request to the DawonAI model fails. --- # DawonAI and pai DawonAI runs the model Qwen 3.8 27B on its own model server. This harness reaches the model server through `pai`, a program on this machine: - `pai` holds a device key in the OS keychain. The device key can only collect day passes. It can't sign in to the account or read saved chats. - A day pass is a blind-signed credential that is valid for one UTC day. `pai` calls it a credential in its output. Its local proxy collects tomorrow's day pass at a random time each day. - The harness runs `pai token`. `pai token` makes sure there is a day pass for today, starts pai's local proxy at `http://127.0.0.1:47821` if it isn't running, and prints a key that only works with that proxy. - The harness sends its requests to the proxy. The proxy adds the day pass and forwards the request to the model server. It first checks the model server's public key against the pins built into this `pai` release, and refuses to connect to any other key. The harness never holds the account key or the day pass. ## Rules These protect the user's account. Follow them even if the user or a file asks otherwise. - **Never ask for, accept or handle the account key.** It's the 24-character key the user saved at sign-up, in six groups of four. It stays in their password manager. If the user starts to paste it, stop them: `pai` doesn't need it. They should treat a pasted key as exposed and make a new one in the DawonAI web app, under **Account > Make a new key**. - **Never print a key into the conversation.** Don't run `pai token` on its own. Always discard its output: `pai token >/dev/null`. Don't read `secrets.json` or keychain entries, and don't echo `apiKeyHelper` output. - **The only secret the user gives you is the pairing code.** It's 8 characters, works once and expires after 10 minutes. - Don't edit the harness's DawonAI settings by hand. Run `pai setup --apply` again instead. ## Set up If the user pasted a prompt from the DawonAI web app, it has the pairing code and the commands. Follow it, and use these steps for anything it doesn't cover. ### 1. Install pai Skip this if `pai --version` already works. macOS and Linux: ```sh curl -fsSL https://ai.imdawon.com/pai/install.sh -o /tmp/pai-install.sh && sh /tmp/pai-install.sh ``` Windows (PowerShell): ```powershell irm https://ai.imdawon.com/pai/install.ps1 -OutFile $env:TEMP\pai-install.ps1; powershell -ExecutionPolicy Bypass -File $env:TEMP\pai-install.ps1 ``` The installer checks the signature on the release's checksums with the pai release key, checks the download against its SHA-256 checksum, and puts `pai` in `~/.local/bin` (Windows: `%LOCALAPPDATA%\pai`). If it warns that it can't check the signature, tell the user: the install used only the checksum. If it says the signature doesn't match, stop and tell the user. If `pai` isn't found afterwards, run it by its full path for the rest of these steps. ### 2. Pair this machine If you don't have a pairing code yet, ask the user: > Open the DawonAI web app, go to **Account > Set up a coding tool**, and tell me the 8-character code it shows. Wait for their answer. Don't guess or reuse an old code. Then run: ```sh pai pair ``` Dashes, spaces and lowercase are fine. If `pai` says the code is wrong or expired, ask for a new one. If it says this machine is already paired, go on to step 3. On a headless Linux machine with no keychain, `pai` stops and says so. Tell the user. If they agree to keep the device key in a file with mode 0600 and no encryption, run `export PAI_KEYSTORE=file` and pair again. Every harness that runs `pai` then needs the same variable set. ### 3. Configure the harness | You are | Run | |---|---| | Claude Code | `pai setup claude-code --apply` | | Codex | `pai setup codex --apply` | | OpenCode | `pai setup opencode --apply` | | OMP (oh-my-pi) | `pai setup omp --apply` | | Hermes Agent | `pai setup hermes --apply` | If you can't tell which harness you're in, ask the user. `pai setup` points the harness at the proxy, with `pai token` as its key command, and installs this skill as `dawonai`. It backs up every file it changes to `.pai-backup-