# Install CueApril from a coding agent

Full guide: https://app.cueapril.com/agents/README.md

CueApril is available as `cueapril` on npm and PyPI. The Python package launches the same bundled JavaScript CLI: it needs an installed Node.js runtime, has no Python runtime dependencies, and does not download Node or run npm during launch. Installing the package and connecting an agent does not start or charge for an assessment.

## One prompt

> Set up CueApril for this coding agent and repository. Read https://app.cueapril.com/agents/install.md, check prerequisites, and install with npm (npx -y cueapril@latest init) or PyPI (uvx cueapril init). Use CUEAPRIL_API_KEY if already available. Otherwise ask me to supply a key through my secret manager or approve the browser link; never ask me to paste a key into chat. Configure this agent, run doctor --json, and report connected separately from project readiness. Do not start a paid assessment until I ask.

## Choose one installer

| Path | Prerequisites | Command |
|---|---|---|
| npm, no global install | Node.js 20+ and npm | `npx -y cueapril@latest init` |
| npm, installed command | Node.js 20+ and npm | `npm install -g cueapril`, then `cueapril init` |
| PyPI, isolated execution | Python 3.10+, uv and Node.js 20+ | `uvx cueapril init` |
| PyPI, installed command | Python 3.10+, pipx and Node.js 20+ | `pipx install cueapril`, then `cueapril init` |

Check installed runtimes with `node --version` and, for Python, `python3 --version`. Use one installer; the Python package and npm package provide the same commands and authentication. For reproducible automation, replace `@latest` with your reviewed npm version or use `uvx --from cueapril==<version> cueapril`.

`init` configures installed Claude Code, Codex, Gemini CLI and Cursor clients. Choose one with `--agents claude`, `--agents codex`, `--agents gemini` or `--agents cursor`; use a comma-separated list for several. It backs up changed settings, preserves other servers, skips clients it cannot find and is safe to rerun. The default skill and configuration scope is the user account; `--scope project` installs the skill in this project. Restart or reload the coding client's MCP connections after setup. A client might require its own server or tool approval.

## Authenticate without exposing a key

The CLI uses `CUEAPRIL_API_KEY` if your environment or secret manager already provides it, otherwise its private user credential store. A key starts with `cueapril_sk_` and must belong to the intended organisation and project. Never inspect a credential file to copy it, print it, put it in command arguments or paste it into an agent conversation.

If no key is available, `init` starts device approval. Give the person the exact verification link and short code returned by CueApril. An organisation owner or administrator checks the code, chooses access and approves once. The CLI stores the resulting key with mode 0600 outside the repository. A coding agent cannot approve its own key.

Agent shells with short command deadlines should split approval into two steps:

```bash
npx -y cueapril@latest init --no-wait --no-browser --json
# Present the returned verification_url and user code to the person.
# After approval, resume the same request:
npx -y cueapril@latest init --no-browser --json
```

A pending approval exits 4. Follow the returned `next_actions` and resume command; do not repeatedly create new approval requests. `--no-browser` lets the person open the link themselves.

For an existing key, configure `CUEAPRIL_API_KEY` through a secret manager and run `init --no-login --json`. Alternatively pipe a single key from the secret manager to `init --key-stdin --json`. The CLI verifies read access before saving it. `--key-stdin` refuses interactive terminal input, so the value never becomes a visible prompt or shell argument. Do not use `echo <key>` or a literal key in a script.

If no credential is available, `init --no-login --json` exits 5 with an authentication-required result and actionable next steps; it does not start browser approval. Installation can therefore stop cleanly for the person to provide access instead of hanging an unattended agent.

## Verify and resume

```bash
npx -y cueapril@latest doctor --json
npx -y cueapril@latest setup --json
```

`doctor` reports API connectivity, authentication, project readiness, installed client configuration and skill state without printing the key. `setup` checks GitHub access, the approved standing plan, funding, testing capacity and the key's permissions. Keep **connected** and **ready to assess** separate: a valid connection can have human-owned project blockers. Pass `--project <id>` when the key covers several projects.

| Situation | Action |
|---|---|
| Missing key | Provide `CUEAPRIL_API_KEY`, import with `--key-stdin`, or use browser approval. |
| Approval pending | Present the same link/code, then rerun `init` without `--no-wait`. |
| HTTP 401 | The key is invalid, expired or revoked. Get an administrator-approved replacement; `login` can start approval. |
| HTTP 403 | Request the required project and scope from an administrator. Reinstalling does not expand access. |
| Project not ready | Follow each setup check's owner and `fix_url`. An agent key cannot connect providers, approve plans or add funding. |
| Agent cannot see MCP tools | Reload its MCP connections or restart it, then check its own server list and approvals. The CLI remains usable. |
| API unavailable | Preserve the error and retry a read later. Do not rotate credentials or start paid work as a connectivity probe. |

`cueapril logout` revokes the stored key and removes local credentials; `logout --local` removes them only on this computer. Keep unattended CI keys in the CI secret store. The default origin is `https://app.cueapril.com`; change `CUEAPRIL_URL` only to an origin your organisation trusts.

## Next step

After an authorised assessment request, call `cueapril_start_assessment`, wait with `cueapril_wait_for_assessment`, then read `cueapril_get_assessment_results`. CLI equivalents, API errors, pagination and outcomes are documented at https://app.cueapril.com/agents/api.md. `incomplete` and `cancelled` are never passes. A successful installation is separate from completed assessment acceptance.
