> ## Documentation Index
> Fetch the complete documentation index at: https://runinfra.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a coding agent

> Set up, verify, and restore your coding agent with RunInfra Connect.

Connect your coding agent to RunInfra, verify a request, and restore the previous configuration when you are finished.

## Connect your agent

Use an installed coding agent with its first-time setup complete. Have a workspace API key and available RunInfra credits. Continue CLI can require an [explicit configuration path](/docs/tools-sdks/continue#restart) before onboarding is complete.

```bash theme={"dark"}
npx @runinfra/connect claude
```

This is the same as `npx @runinfra/connect claude on`. In an interactive terminal, Connect starts login if needed. Review the proposed file changes, approve them, then follow the restart hint after verification.

To install the command globally:

```bash theme={"dark"}
npm install -g @runinfra/connect
runinfra-connect login
runinfra-connect claude on --model deepseek-v4-flash
```

## Commands

```text theme={"dark"}
runinfra-connect <agent>  # same as on
runinfra-connect <agent> on [--model <slug>] [--key-source literal|helper] [--yes] [--preview] [--json]
runinfra-connect <agent> off [--force] [--json]
runinfra-connect <agent> status [--json]
runinfra-connect login [--json]
runinfra-connect logout [--json]
runinfra-connect status [--json]
runinfra-connect doctor [<agent>] [--json]
runinfra-connect key rotate [--json]
runinfra-connect --help [--json]
runinfra-connect --version [--json]
```

Use `-h` for help or `-V` for the version. No arguments shows help. A bare agent also accepts the `on` options.

<Warning>
  `--json` is accepted on every command and emits newline-delimited JSON. Machine-mode `on` requires `--yes`: without it, Connect prints the file-change summary and exits 8 without writing configuration. `on --json --yes` applies changes without prompting. Sign in first for machine-mode `on`; it does not start login for you.
</Warning>

`--yes` approves `on` changes without a confirmation prompt. It does not bypass preview approval or repair conflicting files. `--force` belongs only to `off` and can discard later edits. Do not repeat options or pass keys as arguments.

## Supported agents

The registry includes eighteen agents: six ready, nine preview, and three manual.

`ready` supports automatic setup. `preview` requires `--preview` and has limitations listed below. `manual` prints instructions without writing files or claiming a verified connection.

| Agent                                             | Support tier | Protocol             | Summary                                                                                                                                                             |
| ------------------------------------------------- | ------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Claude Code](/docs/tools-sdks/claude-code) (`claude`) | ready        | `anthropic-messages` | Use RunInfra models in Claude Code with a native model picker.                                                                                                      |
| [Codex](/docs/tools-sdks/codex) (`codex`)              | ready        | `openai-responses`   | Use RunInfra models through Codex's Responses provider.                                                                                                             |
| [OpenCode](/docs/tools-sdks/opencode) (`opencode`)     | ready        | `openai-chat`        | Use RunInfra models in OpenCode's model picker.                                                                                                                     |
| [Pi](/docs/tools-sdks/pi) (`pi`)                       | ready        | `openai-chat`        | Use RunInfra models in Pi with native provider settings.                                                                                                            |
| [Aider](/docs/tools-sdks/aider) (`aider`)              | ready        | `openai-chat`        | Use RunInfra models in Aider through its native OpenAI-compatible settings.                                                                                         |
| [Qwen Code](/docs/tools-sdks/qwen-code) (`qwen-code`)  | ready        | `openai-chat`        | Use RunInfra models in Qwen Code with an explicit OpenAI-compatible model selection.                                                                                |
| [Kilo Code](/docs/tools-sdks/kilo-code) (`kilo-code`)  | preview      | `openai-chat`        | Use RunInfra models in current-generation Kilo Code with a native compatible provider.                                                                              |
| [Goose](/docs/tools-sdks/goose) (`goose`)              | preview      | `openai-chat`        | Configure Goose for RunInfra with a manual process-environment credential handoff.                                                                                  |
| [Continue](/docs/tools-sdks/continue) (`continue`)     | preview      | `openai-chat`        | Register RunInfra chat models in Continue's local YAML configuration.                                                                                               |
| [Cline](/docs/tools-sdks/cline) (`cline`)              | preview      | `openai-chat`        | Configure Cline's shared compatible provider file with manual IDE verification.                                                                                     |
| [Droid (Factory)](/docs/tools-sdks/droid) (`droid`)    | preview      | `openai-chat`        | Register personal RunInfra chat models for manual selection in Droid.                                                                                               |
| [Zed](/docs/tools-sdks/zed) (`zed`)                    | preview      | `openai-chat`        | Configure Zed's RunInfra models with a manual environment or in-app credential handoff.                                                                             |
| Grok Build (`grok`)                               | preview      | `openai-chat`        | Add RunInfra models to Grok Build's user model picker.                                                                                                              |
| Hermes (`hermes`)                                 | preview      | `openai-chat`        | Use RunInfra as a named custom provider in Hermes.                                                                                                                  |
| OpenClaw (`openclaw`)                             | preview      | `openai-chat`        | Add RunInfra to OpenClaw while keeping existing providers available.                                                                                                |
| [Crush](/docs/tools-sdks/crush) (`crush`)              | manual       | `openai-chat`        | Follow manual Crush setup steps without writing executable configuration.                                                                                           |
| Cursor (`cursor`)                                 | manual       | `openai-chat`        | Follow manual Cursor settings steps, with routing limitations explained.                                                                                            |
| Fx (`fx`)                                         | manual       | `openai-chat`        | Current Fx documentation does not show a custom base URL or an OpenAI-compatible provider setting. Connect has no setup recipe. Check the current Fx documentation. |

## What on writes

`on` checks that the agent is installed, reads your saved key, fetches the available model list, and selects models compatible with the agent. `--model` must be an available model id. Without it, Connect uses the first compatible model.

Before asking for approval, Connect states the agent, model, destination, key placement, affected files, any permission change, and that the following API check uses credits.

Connect shows a file-change summary, takes a snapshot, and records a pending operation with the origin snapshot and expected file hashes. It then writes the agent's native settings and completes the connection record. For Codex the picker shows the configured model; switch with `on --model <slug>` or Codex's own model option. Some adapters register models that you must select manually; follow the agent page and printed handoff. Existing unrelated settings are retained where the format can be edited safely; review every warning.

Do not edit an agent's configuration while a Connect command is running. Connect compares current bytes and rechecks file identity before replacement. On POSIX, it also retains a displaced-file copy when its contents differ from the bytes read and warns with its path. Windows does not make that copy. If the filesystem cannot create the copy, Connect warns and proceeds with its other checks. Writes through an already-open file can arrive after the final comparison, so these checks do not make concurrent editing safe.

After an interrupted write, the next `on`, `off`, or `key rotate` checks the pending operation. If all files match the expected new bytes, Connect completes the connection record. If all match the previous bytes, it discards the pending operation. Mixed or modified files stop setup with exit 6. Review the named origin snapshot before choosing `<agent> off --force` to restore it. Status and doctor inspect pending operations without changing state. A final connection-state save failure keeps the written files and recovery record instead of undoing them. Recovery handles process interruption; it does not guarantee recovery after power loss.

After writing, Connect makes a small real request using the selected model and the agent's protocol. This request uses credits. It reports a request id and `cached_tokens`, or `not reported` when cache usage is unavailable. Follow the printed restart or new-chat hint before using the agent.

<Note>
  A successful probe is not proof that the agent has restarted. If the API check fails after writing, the settings and snapshot stay saved. Connect still prints the restart hint and launch instructions. Fix the cause it names, then run `doctor <agent>`, or `<agent> off` to restore.
</Note>

Run `on` again to refresh the agent's model list. Model choices are saved at setup time, not refreshed on every launch.

## What off restores

```bash theme={"dark"}
runinfra-connect claude off
```

`off` restores the origin snapshot from before the first `on` in the active connection and removes files that did not exist then. Later active `on` calls and `key rotate` keep that restore point. A changed managed file set requires `off` before reconnecting. Older state without an origin uses its recorded snapshot. Snapshots are retained, and recorded POSIX file permissions are restored.

<Warning>
  If you or the agent edited a managed file after connecting, `off` refuses to overwrite it. Back up and review your edits first. Use `off --force` only when you intend to discard them. Connect saves the current contents in a recovery snapshot and prints its id before overwriting them.
</Warning>

Without usable recovery state, Connect removes only recognizable managed regions by default and refuses unmarked RunInfra settings. `off --force` saves a recovery snapshot before attempting to remove identifiable RunInfra credentials. A provider name or credential field name alone does not prove ownership. Foreign or ambiguous targeted credentials are preserved, and recovery refuses with exit 6 before editing. Unsafe syntax can require manual recovery.

Best-effort cleanup leaves other settings unchanged and warns when the original snapshot is missing. It does not claim to restore the original configuration. If cleanup finished but state finalization was interrupted, a forced retry can clear the missing-snapshot state without another edit and reports `restored: false, cleaned: true`. Keep the retained snapshots for recovery.

## Login, logout, and key replacement

```bash theme={"dark"}
runinfra-connect login
```

Without `RUNINFRA_API_KEY` set, interactive login opens the RunInfra dashboard key page. Create or select a workspace API key for the workspace you intend to use, then paste your key at the hidden prompt. If the browser cannot open, use the URL printed by Connect.

An existing `RUNINFRA_API_KEY` takes precedence over both paste and standard input. To paste a replacement interactively, unset that value first. To replace a key through the environment, update its value before running `key rotate`; otherwise the old key can be reused without a paste prompt.

Login validates key access, reports available credits, and checks for available models before saving credentials. It does not require a positive credit balance. The completion probe happens during `on`, not login.

For unattended login, supply the key through standard input from your secret manager or through `RUNINFRA_API_KEY`. Do not put the key in command arguments, shell history, screenshots, or logs.

`logout` removes only Connect's saved credentials. Agent settings and snapshots stay on disk, and the key is not revoked. Use `<agent> off` to restore an agent's settings and revoke unwanted keys in the dashboard.

`key rotate` acquires a replacement key, updates agents whose managed files are active, and probes them again. Missing or modified configurations are skipped and reported. Update helper environments yourself. Check every result before revoking the old key; retained snapshots can contain it. A partial rotation is reported as a failure even though new local credentials may already be saved. Machine results distinguish `updated` from `probed`; a failed probe after a successful write reports `updated: true, probed: false`.

## Key placement

Unless an agent defaults to helper mode, the default `--key-source literal` stores a plaintext key in its native configuration or credential file with `0600` permissions on POSIX systems. Goose and Zed default to helper mode and refuse literal mode. Cline supports literal mode only. Crush is manual and writes nothing.

For Goose, helper mode is the default; pass the key through `OPENAI_API_KEY`. Connect leaves the keyring unchanged. You do not need to pass `--key-source helper` explicitly. Zed requires a manual environment or in-app credential handoff and has no settings API-key field.

Connect restricts permissions only on its own configuration directories, not an agent's directory or your home directory. External files retain inherited Windows permissions. Connect reports Windows protection for its own credential and snapshot directories only after verifying access is limited to the current user, SYSTEM, or Administrators. Review any permissions warning; these files are not encrypted.

```bash theme={"dark"}
runinfra-connect claude on --key-source helper
```

`--key-source helper` uses the agent's supported indirection or printed environment handoff instead of a new literal key. Set `RUNINFRA_API_KEY` through your secret-management workflow, then follow the agent-specific instructions in the environment that actually launches it.

| Agent                                            | Helper setting                                                                                                                                                                                                                |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Code                                      | `apiKeyHelper` reads the launch environment.                                                                                                                                                                                  |
| Codex                                            | `env_key` names `RUNINFRA_API_KEY`.                                                                                                                                                                                           |
| OpenCode                                         | An environment reference reads `RUNINFRA_API_KEY`.                                                                                                                                                                            |
| Pi                                               | An environment reference reads `RUNINFRA_API_KEY`.                                                                                                                                                                            |
| [Aider](/docs/tools-sdks/aider#key-placement)         | Hand off `RUNINFRA_API_KEY` to `AIDER_OPENAI_API_KEY` before launch.                                                                                                                                                          |
| [Qwen Code](/docs/tools-sdks/qwen-code#key-placement) | Model entries name `RUNINFRA_API_KEY` through `envKey`; helper mode removes owned saved assignments that can be safely removed. Older assignments still referenced by retained entries can remain.                            |
| [Kilo Code](/docs/tools-sdks/kilo-code#key-placement) | One `provider.runinfra.env` entry names `RUNINFRA_API_KEY`. Connect does not switch automatically to `RUNINFRA_GATEWAY_KEY`. Set `RUNINFRA_API_KEY` in the launching environment. No `options.apiKey` placeholder is written. |
| [Goose](/docs/tools-sdks/goose#key-placement)         | Hand off `RUNINFRA_API_KEY` to `OPENAI_API_KEY`. Keyring and `secrets.yaml` stay unchanged.                                                                                                                                   |
| [Continue](/docs/tools-sdks/continue#key-placement)   | `apiKey` uses `${{ secrets.RUNINFRA_API_KEY }}`. Verify CLI and IDE secret resolution separately.                                                                                                                             |
| [Cline](/docs/tools-sdks/cline#key-placement)         | Helper mode is refused. Only literal credentials are supported.                                                                                                                                                               |
| [Droid](/docs/tools-sdks/droid#key-placement)         | Personal `apiKey` uses `${RUNINFRA_API_KEY}`. This is environment interpolation, not `apiKeyHelper`.                                                                                                                          |
| [Zed](/docs/tools-sdks/zed#key-placement)             | Set `RUNINFRA_API_KEY` in the editor's launch environment or enter the key in Zed's provider settings. No file credential is written.                                                                                         |
| [Crush](/docs/tools-sdks/crush#key-placement)         | Manual only. Connect writes no reference or credential.                                                                                                                                                                       |

A variable set only in a terminal does not reach an already running app, a background service, or a Windows GUI launch. Fully restart the app with the required environment. The setup probe uses saved credentials; it does not prove the app inherited the helper value.

Helper mode does not erase Connect's saved key or keys retained in older snapshots. Treat the credentials, snapshots, and agent configuration as secrets.

## Status

```bash theme={"dark"}
runinfra-connect status
runinfra-connect claude status
```

| State      | Meaning                                                                     |
| ---------- | --------------------------------------------------------------------------- |
| `active`   | Every managed file matches its saved hash.                                  |
| `modified` | A managed file changed, or some but not all managed files are missing.      |
| `missing`  | There is no recorded connection, or all recorded managed files are missing. |

Status includes the support tier, selected model, and connection time. `active` describes file contents only, not a running app or a successful current request. The all-agent command also checks for paused models when saved credentials are available; a catalog warning does not change the local file result.

## Doctor

```bash theme={"dark"}
runinfra-connect doctor claude
```

Doctor checks saved-key access, available models, and managed files before making a real protocol request. The first failing check determines the exit code: 3 for the key, 6 for configuration, 2 for the base URL or model, and 5 for the endpoint.

Use an agent argument to check one setup strictly. Without it, doctor checks recorded connections. Unconnected adapters appear as informational `not-connected` rows and do not fail the command. Missing or modified files with recorded state still fail. Manual adapters are marked manual, not verified.

Doctor does not rewrite configuration or verify an app restart. A stale model list can require `on` again. In helper mode it also checks the current process's `RUNINFRA_API_KEY`, which does not prove a different app inherited that environment. Doctor's real requests use credits. After a successful check, doctor prints the agent's restart hint and launch instructions again.

## JSON output

Add `--json` to any command and read stdout as newline-delimited JSON. Each nonempty line is one complete object with a string `kind`, not one element of a JSON array. Narration, warnings, recovery paths, and launch instructions go to stderr. JSON mode never opens a sign-in or confirmation prompt; machine-mode `on` needs an existing login and `--yes`.

Consume the exit code as well as every record. A command can emit useful records and then fail. `configured` precedes verification and is not final success. A successful `probe` checks API access, not whether the agent restarted. Structured paths, model names, and identifiers keep their punctuation; secret and unsafe-control-character filtering still applies.

Record kinds are `config-conflict`, `configured`, `diff`, `doctor`, `error`, `help`, `key-rotate`, `login`, `logout`, `manual`, `off`, `paused-models`, `pending-recovery`, `probe`, `recovery-snapshot`, `status`, and `version`. Key rotation includes per-agent records and a summary with `summary: true`. A failed `probe` includes `httpStatus`, `reason`, and `retryAfterSeconds`.

Accept unknown fields and kinds so additive changes do not break your script. See [Connect JSON output](/docs/tools-sdks/connect-json-output) for every field, record condition, and command ordering table.

## Preview adapters

Read the reason before opting in. `on` requires `--preview` for these adapters. Preview is not a dry run: it writes settings and sends a request using credits. It does not certify the adapter.

<AccordionGroup>
  <Accordion title="Kilo Code">
    Kilo Code needs live stream/tool, override, IDE activation and post-start restoration checks before promotion from preview.

    ```bash theme={"dark"}
    runinfra-connect kilo-code on --preview
    ```

    See [Kilo Code](/docs/tools-sdks/kilo-code) for the verified CLI response, first-start permission block, and configuration precedence.
  </Accordion>

  <Accordion title="Goose">
    This preview writes Goose's model and URL settings without changing the keyring or `secrets.yaml`. Set `OPENAI_API_KEY` in Goose's launch environment. Confirm the settings and request destination in a new Goose chat before relying on this preview.

    Connect could not confirm the `OPENAI_HOST`/`OPENAI_BASE_PATH` URL recipe, `GOOSE_PATH_ROOT` and `XDG_CONFIG_HOME` overrides, system and additional-file precedence, companion-secret resolution, optional model limits, BOM or flow-style trailing commas, or comment preservation after native saves against the current Goose documentation; check the [environment guide](https://goose-docs.ai/docs/guides/environment-variables) and [provider guide](https://goose-docs.ai/docs/getting-started/providers/) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect goose on --preview
    ```

    See [Goose](/docs/tools-sdks/goose) for the default helper handoff, private `goose info -v` settings check, and separate new-chat destination check. The settings check does not prove authentication or routing.
  </Accordion>

  <Accordion title="Continue">
    Continue requires explicit --config for safe first-run/rewrite handling. CLI tool execution is not sandboxed; IDE activation, routing, secrets and restoration after native saves need separate verification.

    ```bash theme={"dark"}
    runinfra-connect continue on --preview
    ```

    Follow the [explicit-config startup instructions](/docs/tools-sdks/continue#restart), including after onboarding. Continue CLI 1.5.47 completed a verified RunInfra round trip from the Connect-written file; IDE activation and the remaining preview checks are separate. `--readonly` is plan mode, not a sandbox.
  </Accordion>

  <Accordion title="Cline">
    This preview writes only `providers.json` with a literal API key. Connect could not confirm its paths, schema, selectors, authentication and helper resolution, `globalState`/Plan/Act precedence, model metadata fallback, CLI flags or restoration after native saves against the current Cline documentation; check the [configuration guide](https://docs.cline.bot/getting-started/config) and [CLI reference](https://docs.cline.bot/cli/cli-reference) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect cline on --preview
    ```

    See [Cline](/docs/tools-sdks/cline) for literal credentials and separate CLI routing and VS Code Plan/Act checks. Connect prints manual follow-up guidance, not a Cline diagnostic command.
  </Accordion>

  <Accordion title="Droid (Factory)">
    This preview registers RunInfra models in `~/.factory/settings.json`. Connect could not confirm path overrides, parser behavior, effective generated IDs, saved-default selection, credential resolution, file watching or restoration after native saves against the current Droid documentation; check the [CLI settings guide](https://docs.factory.ai/droid-cli/settings) and [BYOK guide](https://docs.factory.ai/model-independence/byok) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect droid on --preview
    ```

    See [Droid](/docs/tools-sdks/droid) for the derived `custom:` id from the final written personal array and selection in Droid's **Custom models** section. Confirm the derived id in the installed picker before use. Connect does not write a personal saved-default selector.
  </Accordion>

  <Accordion title="Zed">
    This preview writes RunInfra models to `settings.json` with a manual environment or keychain handoff. Connect could not confirm path overrides, the compatible-provider schema, `RUNINFRA_API_KEY` environment/keychain precedence, CLI diagnostics or restoration after saves against the current Zed documentation; check the [configuration guide](https://zed.dev/docs/configuring-zed.html) and [API access guide](https://zed.dev/docs/ai/use-api-access.html) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect zed on --preview
    ```

    See [Zed](/docs/tools-sdks/zed) for the `agent: open settings` and `zed: open settings file` command-palette actions, credential handoff, and new Agent chat checks. These are editor actions, not shell diagnostics. Confirm a new Agent reply and its request destination separately.
  </Accordion>

  <Accordion title="Grok Build">
    This preview adds RunInfra models with `api_backend = chat_completions` and uses `env_key` in helper mode. Connect targets Grok Build's user configuration, not project model settings.

    Connect could not confirm literal `api_key` support, `GROK_HOME` edge cases, other path and policy overrides, credential precedence, parser tolerance or save and restoration behavior against the current Grok Build documentation; check the [settings reference](https://docs.x.ai/build/settings/reference) and [enterprise configuration guide](https://docs.x.ai/build/enterprise#configuration) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect grok on --preview
    ```

    In literal mode, only the selected model stores the key. Other model selections also need `RUNINFRA_API_KEY` in the launch environment.

    Review `GROK_DEFAULT_MODEL`, `GROK_MODELS_BASE_URL`, `GROK_MODELS_LIST_URL`, `GROK_CONFIG`, and `GROK_CONFIG_PATH` before relying on the user file. Connect does not resolve those overrides.

    Restart Grok Build. Inspect the loaded configuration:

    ```bash theme={"dark"}
    grok inspect
    ```

    Confirm the selected RunInfra model and request destination separately. Connect's API probe does not prove Grok Build used these settings. Restoring the managed file does not restore your external environment.
  </Accordion>

  <Accordion title="Hermes">
    This preview adds a RunInfra provider to `config.yaml` with `.env` for literal keys. Connect requires at least 64,000 context tokens for this setup. That minimum is Connect's preview guard.

    Connect could not confirm the native Windows default path, `HERMES_HOME` and profiles, the named-provider fields including `api`, `key_env`, `transport`, `default_model` and `context_length`, `model.default` and the `custom:runinfra` selector, credential and dotenv precedence, `api_mode` and `enabled` effects, required metadata, Hermes's minimum context size, parser tolerance or save and restoration behavior against the current Hermes documentation; check the [named-provider guide](https://hermes-agent.nousresearch.com/docs/integrations/providers#named-custom-providers) and [configuration guide](https://hermes-agent.nousresearch.com/docs/user-guide/configuration) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect hermes on --preview
    ```

    Review the active profile and settings file before use. Check existing `api_mode` and `enabled` settings for competing provider choices. Connect keeps an existing `.env` assignment when another provider uses it.

    Restart Hermes after editing files. Inspect selection:

    ```bash theme={"dark"}
    hermes config get model
    ```

    This checks configuration, not a reply or its destination. Confirm those separately. Restoring Connect's files does not restore external credentials or profile settings.
  </Accordion>

  <Accordion title="OpenClaw">
    This preview adds RunInfra models using JSON/JSONC only, not full JSON5. It sets `models.mode` to `merge` and selects `runinfra/<model-id>` through `agents.defaults.model.primary`. Connect leaves `modelPolicy.allow` unchanged. Check that policy before selecting RunInfra.

    Connect could not confirm the active file under `OPENCLAW_CONFIG_PATH`, `OPENCLAW_STATE_DIR`, `OPENCLAW_HOME` or profiles, parser tolerance, credential and per-agent model precedence, missing helper values, reload or changes after saves and restoration against the current OpenClaw documentation; check the [configuration guide](https://docs.openclaw.ai/gateway/configuration), [environment guide](https://docs.openclaw.ai/help/environment), and [model registry guide](https://docs.openclaw.ai/concepts/models#models-registry-modelsjson) before relying on it.

    ```bash theme={"dark"}
    runinfra-connect openclaw on --preview
    ```

    If Connect refuses JSON5 syntax or a structure it cannot rewrite safely, review the non-secret settings before applying them through this command:

    ```text theme={"dark"}
    openclaw config set
    ```

    Supply the reviewed setting and value yourself. Use `models.mode: merge`, `models.providers.runinfra.baseUrl: https://api.runinfra.ai/v1`, and `models.providers.runinfra.api: openai-completions`. Set `agents.defaults.model.primary` to `runinfra/<model-id>`. Use the catalog's exact model ids, names, reasoning support, context windows, and output limits for `models.providers.runinfra.models`; Connect uses `input: ["text"]`.

    Enter your API key through OpenClaw's **Control UI Settings > Models**. In helper mode, start OpenClaw with `RUNINFRA_API_KEY` in its actual environment. An export in another terminal does not reach an already running process.

    Check the active provider and model. Restart OpenClaw if reload is disabled or fails. Start a new chat. A successful Connect API probe does not prove OpenClaw used these settings. Credential cleanup without the origin snapshot does not remove the provider, model catalog, or primary selection.
  </Accordion>
</AccordionGroup>

## Manual setup

These commands print the registry's instructions. They do not edit the app or verify a request.

### Crush

```bash theme={"dark"}
runinfra-connect crush
```

1. Connect writes nothing for Crush. Native `crushrc` is Bash, and legacy `crush.json` fields are shell-resolved. Keep a backup before editing. Check `~/.config/crush/crushrc` on macOS and Linux or `%USERPROFILE%\.config\crush\crushrc` on Windows. Check `XDG_CONFIG_HOME` and `CRUSH_GLOBAL_CONFIG` for location overrides.
2. For legacy `crush.json` only, use `type: openai-compat` and `base_url: https://api.runinfra.ai/v1` in `providers.runinfra`. Review `api_key` before using `${RUNINFRA_API_KEY:?set RUNINFRA_API_KEY}` as its value. For native `crushrc`, use `--type openai-compat`, `--base-url`, and `--api-key` with an exported variable.
3. For legacy `crush.json`, confirm both `models.large` and `models.small` use provider `runinfra` and an exact RunInfra model id. Native model ids use `provider/model`. Press **Ctrl+L** to open the model picker. Confirm the intended model there.
4. Do not guess model limits or capabilities. Review the `--context-window` and `--default-max-tokens` limit flags before setting them. Empty `openai-compat` model lists auto-discover models. Explicit metadata takes precedence over discovered values.
5. Review project `.crushrc`, then `crushrc`, before the global native file. Check legacy `.crush.json` and `crush.json`, `CRUSH_GLOBAL_DATA`, and workspace `.crush` state for conflicting selections. Data files are application state, not configuration. Do not edit them by hand.
6. Restart the whole Crush process after reviewing configuration and permissions. Do not use `crush run` as an automatic verifier. Test only in an isolated disposable environment. Confirm the request destination separately.
7. To disconnect, undo only the provider, model, and credential changes you made. Alternatively, restore your reviewed backup without discarding later edits. Connect `off` does not manage Crush files. Keep a shared environment key if another app uses it. Removing it does not revoke it. Connect could not confirm the full legacy `crush.json` schema, `${RUNINFRA_API_KEY:?set RUNINFRA_API_KEY}` expansion, `models.large`/`models.small` selection, path and state precedence, discovery completeness, required metadata, parser and reload behavior, changes after saves or `crush run` permissions against the current Crush documentation; check the [configuration guide](https://github.com/charmbracelet/crush/tree/main/docs/config) and [run implementation](https://github.com/charmbracelet/crush/blob/main/internal/cmd/run.go) before relying on it.

See [Crush](/docs/tools-sdks/crush) for native and legacy configuration, picker checks, discovery limits, permission cautions, and manual restoration. Connect writes no files and prints no automatic verification command.

### Cursor

```bash theme={"dark"}
runinfra-connect cursor
```

1. Open **Cursor Settings > Models**. Find **OpenAI API Key** and **Override OpenAI Base URL**. Some current Cursor versions make these fields uneditable. Stop if either field cannot be edited.
2. Set **Override OpenAI Base URL** to `https://api.runinfra.ai/v1`. Confirm this destination before entering or verifying your RunInfra key.
3. Paste your RunInfra API key into **OpenAI API Key** only after confirming the base URL. Enter the key in Cursor, not in this command. Restore your previous URL or turn the override off before switching keys.
4. If your version offers **Add model**, enter each exact RunInfra model id you want to use. Select that exact model in a new chat.
5. Confirm the request destination for each mode before using it. Do not assume the same routing for Tab, Inline Edit, Agent, or Auto.
6. Check the selected model and request destination in a new chat. Check that requests use the expected OpenAI-compatible format. This manual path does not establish end-to-end compatibility.
7. To disconnect, turn off **Override OpenAI Base URL** and reselect your previous Cursor model. Restore the previous key and base URL values. Remove only the custom entries you added. Removing a saved key does not revoke it. Connect could not confirm a nested **API Keys** page, per-version save, verification and removal controls, **Add model** and model-id acceptance, `/v1` request compatibility, the override's scope across other keys, routing for Tab, Inline Edit, Agent and Auto, which requests pass through Cursor's servers, or restart and saved-setting behavior against the current Cursor documentation; check [Cursor's field-editability report](https://forum.cursor.com/t/regression-models-openai-api-key-base-url-inputs-not-editable-in-3-15-6-ok-in-3-14-27/167685), [base URL discussion](https://forum.cursor.com/t/openai-api-and-override-base-url-values/148140), and [request-format guidance](https://help.openai.com/en/articles/20001506-using-openai-models-in-cursor) before relying on it.

### Fx

```bash theme={"dark"}
runinfra-connect fx
```

Current Fx documentation does not show a custom base URL or an OpenAI-compatible provider setting, so Connect has no setup recipe. No Fx settings are changed. Connect could not confirm direct RunInfra setup against the current Fx documentation; check the current Fx documentation before relying on it.

## Exit codes

| Code | Meaning                                                            |
| ---- | ------------------------------------------------------------------ |
| 0    | Success.                                                           |
| 1    | Unexpected CLI error.                                              |
| 2    | Invalid usage, unsupported runtime, or preview without approval.   |
| 3    | Authentication failed or no saved key.                             |
| 4    | Not found, not installed, or no access.                            |
| 5    | Network, rate limit, server, or endpoint probe failure.            |
| 6    | Configuration changed, recovery conflict, or integrity failure.    |
| 7    | Local storage, permissions, or space failure.                      |
| 8    | Confirmation is required; use `--yes` after reviewing the changes. |
| 9    | Confirmation was refused; no configuration changes were made.      |
| 130  | Interrupted.                                                       |

## Troubleshooting

| Symptom                                    | What to do                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agent not installed                        | Install it, finish its first-time setup, and make it available on `PATH`.                                                                                                                                                                                                                                                                                                       |
| Key refused                                | Run `login` with a workspace API key and check that the intended workspace has credits.                                                                                                                                                                                                                                                                                         |
| Model unavailable                          | Select an available exact model id and run `on --model <slug>` again.                                                                                                                                                                                                                                                                                                           |
| Modified configuration or missing snapshot | Keep a backup, inspect the changes, and recover before retrying. Do not use `--force` unless you intend to lose later edits.                                                                                                                                                                                                                                                    |
| Configuration lock                         | New locks identify a process and machine. Only a stopped process on the same machine is reclaimed automatically. A lock from another machine refuses and names that machine; finish the operation there. Do not run Connect concurrently against a synchronized configuration directory on different machines.                                                                  |
| Legacy or abandoned recovery lock          | A 0.1.0 `operation.lock` is never reclaimed automatically after its process stops. An abandoned same-machine `operation.lock.reclaim` can be recovered, but a live, foreign, empty, or malformed guard refuses. Remove only the named recovery file after confirming its owner stopped on the named machine. `operation.lock.reclaim.recover` is never reclaimed automatically. |
| Probe succeeds but the app still fails     | Follow the restart hint, check provider-policy warnings, and verify the helper environment where the app launches.                                                                                                                                                                                                                                                              |
| Preview or manual adapter                  | Read its limitations above before trying setup. An instruction list is not a verified connection.                                                                                                                                                                                                                                                                               |
