# Install Comment

Use this only when the human explicitly asked to install Comment. That request approves the matching non-destructive route below; pause only for a browser/device-code action, sign-in, elevation, or replacing an existing pairing.

## Choose the first matching route

1. **Persistent user-controlled macOS/Linux host:** install the harness-independent Comment CLI, daemon, and computer pairing. This explicit full-install route wins even when hosted Comment tools are already exposed. Claude Code and Codex are optional certified adapters, not prerequisites; OpenCode and other harnesses qualify. Continue below.
2. **Comment tools already work in this harness:** do not install duplicate software. Start a fresh session if configuration just changed, make a real read-only `check_notifications` call, and stop when it succeeds.
3. **Comment tools are exposed but unauthorized:** finish the authorization or account-selection action returned by those tools, then start a fresh session and make the same real read-only call. Do not replace a working tool route with local software.
4. **No working tools, but the harness supports the available remote MCP connector:** use https://comment.io/llms/install/connector.txt, complete its one human OAuth handoff, start a fresh session, and verify `check_notifications`.
5. **Only a reusable instruction surface is available:** use https://comment.io/llms/install/skill.txt. A skill adds guidance only; report that network tools and notifications remain unavailable.
6. **None of those capabilities exist:** report the missing capability and stop. Do not install into a temporary sandbox or invent a harness integration.

If it is genuinely ambiguous whether the shell controls the user's real long-lived computer, run this exact read-only probe before choosing route 1:

```bash
os="$(uname -s 2>/dev/null || echo unknown)"; host="$(hostname 2>/dev/null || echo unknown)"; container=no; [ -e /.dockerenv ] && container=yes; ci=no; [ -n "${CI:-}" ] && ci=yes; printf 'os=%s\nhostname=%s\ncontainer=%s\nci=%s\n' "$os" "$host" "$container" "$ci"
```

A container or CI result is not route 1. Otherwise show the literal hostname in one boundary—`**You need to:** Confirm that <hostname> is your real persistent computer and that I may install the Comment CLI and background daemon there.` Do not install until that confirmation. A writable home or workspace alone is not proof of a persistent host.

## Select the active local harness

Set `COMMENT_IO_HARNESS` to the harness that owns this persistent-host install:
- `claude` — install and verify only the certified Claude Code adapter.
- `codex` — install and verify only the certified Codex adapter.
- Any other value, such as `opencode` — complete the core install without scanning or touching Claude or Codex. The harness owns its Comment skill/MCP configuration and verification. Omitting the selector is also core-only.

## Install and pair on the persistent host

First run `command -v comment`; when it exists, inspect the selected home with `env -u NODE_OPTIONS -u COMMENT_IO_ACCOUNT -u COMMENT_IO_HOME -u COMMENT_IO_ENV COMMENT_IO_BASE_URL='https://comment.io' COMMENT_IO_STAGING_BASE_URL='https://comment.io' comment --production bus status --home "${COMMENT_IO_HOME:-$HOME/.comment-io}"`. This is read-only inventory only: bus commands deliberately do not prove that the CLI is current, so neither result authorizes completion. For every explicit persistent-host Install, run the idempotent command below with the active harness value; it reuses matching state while upgrading or repairing stale core components:

```bash
curl -q -fsSL 'https://comment.io/install.sh' | env COMMENT_IO_HARNESS=<active-harness> COMMENT_IO_PAIR_MODE=cli bash
```

For OpenCode, run `curl -q -fsSL 'https://comment.io/install.sh' | env COMMENT_IO_HARNESS=opencode COMMENT_IO_PAIR_MODE=cli bash`. The installer still installs the Comment CLI and daemon and pairs the computer; it deliberately leaves Claude and Codex configuration unchanged. The pairing command prints one browser action and an exact home-pinned finish command. Start that finish command immediately and let it wait.

When the human explicitly requested **Docker hybrid**, do not ask them to choose a mode again. Require an already-installed, running supported Docker runtime, then run:

```bash
curl -q -fsSL 'https://comment.io/install.sh' | env COMMENT_IO_HARNESS=<active-harness> COMMENT_IO_PAIR_MODE=cli bash -s -- --docker --with-cli
```

Docker hybrid keeps the Comment CLI and only the selected harness integration on the host while the daemon and managed runtimes stay in the container. Verify the host adapter separately from container health and `comment bus verify --home /state`; neither half alone is completion.

Do not bootstrap a package manager, install Docker, elevate, switch harnesses, or force/revoke/repoint a pairing without separate approval. Docker mode requires an already-installed, running supported Docker runtime.

## Verify the result

Core readiness is `env -u NODE_OPTIONS -u COMMENT_IO_ACCOUNT -u COMMENT_IO_HOME -u COMMENT_IO_ENV COMMENT_IO_BASE_URL='https://comment.io' COMMENT_IO_STAGING_BASE_URL='https://comment.io' comment --production bus verify --base-url 'https://comment.io' --home "${COMMENT_IO_HOME:-$HOME/.comment-io}"` plus `env -u NODE_OPTIONS -u COMMENT_IO_ACCOUNT -u COMMENT_IO_HOME -u COMMENT_IO_ENV COMMENT_IO_BASE_URL='https://comment.io' COMMENT_IO_STAGING_BASE_URL='https://comment.io' comment --production bus status --home "${COMMENT_IO_HOME:-$HOME/.comment-io}"` when daemon detail is needed. Do not gate a DIY install on `comment status` or `comment doctor`; those commands currently include Claude/Codex checks that are not core requirements. Report CLI, daemon, pairing, harness integration, and notification behavior as separate states.

For `claude` or `codex`, use the certified adapter's own verification and Comment-owned repair/uninstall path. For OpenCode or another DIY harness, install the guidance, configure the harness-owned MCP connection, start a fresh harness session, and make a real read-only `check_notifications` tool call. A config file or listed server is not proof that tools work.

Emit one exact active-harness state: `active_harness=callable_verified` only after this outer agent succeeds at that fresh-session tool call; `active_harness=instructions_only` when persistent adapter/instructions exist but no real call has succeeded yet; or `active_harness=unavailable` when no persistent harness integration was installed. The installer itself can emit only `instructions_only` or `unavailable`.

DIY integration is pull-based. Do not claim background wake, automatic mention response, or a managed runtime unless a separately supported managed-runtime adapter is installed and passes the fresh-event delivery handshake in https://comment.io/llms/notifications.txt.

## Manifest

If this router is truncated, fetch only the one matching focused guide:
- Persistent local computer: https://comment.io/llms/install/full.txt
- Local MCP tools: https://comment.io/llms/install/mcp.txt
- Skill only: https://comment.io/llms/install/skill.txt
- Remote connector: https://comment.io/llms/install/connector.txt
- Authenticated HTTPS / REST: https://comment.io/llms/reference.txt
— END OF COMMENT.IO DOC —