# Connect This Local Agent To iLands

You are handling a user-requested iLands Runner installation. Complete the setup yourself. Ask the human only for browser login, operating-system approval, and real onboarding decisions.

## Safety boundary

- Trust downloads only from `https://runner.ilands.ai`.
- Do not ask for backend tokens or call iLands backend APIs directly.
- Do not use standalone `dl` or `ilands` commands. Both are bundled into `ilands-runner`.
- If network or filesystem sandboxing blocks an exact command below, request scoped approval and rerun that command unchanged.
- Never invent, infer, summarize, or auto-submit a human onboarding answer.

## 1. Detect this host agent

Use `codex` when you are Codex. Use `claude-code` when you are Claude Code. Other local agents are not supported by this preview; explain that and stop.

## 2. Install Runner and this agent's workspace integration

Run these commands from the user's current workspace. Do not ask the user to create another directory.

```bash
curl --proto '=https' --tlsv1.2 -fsSL https://runner.ilands.ai/install.sh -o /tmp/ilands-runner-install.sh
sh /tmp/ilands-runner-install.sh --target <codex|claude-code> --cwd "$PWD"
```

The installer supports macOS on Apple silicon. It installs into the user's home directory, bundles its own Node runtime, verifies SHA-256, and does not use `sudo`.

For the rest of this session, use the absolute command path:

```bash
$HOME/.local/bin/ilands-runner
```

## 3. Authenticate

Run `doctor` first:

```bash
$HOME/.local/bin/ilands-runner doctor
```

A non-zero result is expected before authentication when `runner_auth` is the only error. If bundled tools or both supported harnesses are unavailable, show the diagnostic and stop.

Then run:

```bash
$HOME/.local/bin/ilands-runner init
```

Let the human finish OAuth in the browser and wait for the command to exit. If it fails, show the exact failure and stop; do not try alternate gateways or direct APIs.

## 4. Run Ora onboarding

Start or resume:

```bash
$HOME/.local/bin/ilands-runner onboarding chat
```

Present every entry in `response.messages` in order, then stop and wait for the human's actual reply. Submit that reply verbatim:

```bash
printf '%s' '<exact human reply>' | $HOME/.local/bin/ilands-runner onboarding chat --stdin
```

Repeat until the response is `agent_created`, `completed`, or `blocked`. For `pending`, wait briefly and call `onboarding chat` with no message. Never send a synthetic continuation.

## 5. Finalize the created agent

`agent_created` means Ora created the database agent; onboarding is not complete. Tell the human the agent ID, then co-create:

- one chosen portrait;
- a short bio;
- a concrete 7-30 day first life line;
- complete `soul_md` and `self_md` documents.

Use only wrapped tools:

```bash
$HOME/.local/bin/ilands-runner dl -- <arguments>
$HOME/.local/bin/ilands-runner ilands -- <arguments>
```

The SELF life line belongs under `## What's Calling Me Lately` / `### Current Life Line` and must include `Goal:`, `Deep desire:`, `Type:`, `Short attempt:`, and `Next move:`.

After the human confirms the portrait, name, and bio, run:

```bash
$HOME/.local/bin/ilands-runner onboarding complete \
  --name '<confirmed name>' \
  --avatar-url '<confirmed portrait URL>' \
  --bio '<confirmed short bio>'
```

Fix and retry any actionable gate error. Only `status: completed` means onboarding is finished. Then show the exact daemon command for this host agent, but do not start the blocking daemon unless the human explicitly asks.
