Attaching a Local Coding Agent with OpenClaw: The Minimum Setup

For a minimal OpenClaw local agent path, official docs say to (1) keep config and workspace under ~/.openclaw and run the Gateway, (2) connect local models through Ollama’s native endpoint when you need them, and (3) opt in to the bundled coding-agent skill after installing and authenticating claude, codex, or opencode.

This article stays at that minimum path. It does not invent UI labels, version numbers, prices, or personal reviews. Prefer live pages on docs.openclaw.ai when flags change.

What do you install?

One-line answer: OpenClaw (app or CLI) plus a runnable Gateway; Ollama if you want local inference; and at least one of Claude Code, Codex, or OpenCode if you enable coding delegation.

Setup docs keep personalization outside the source repo:

  • Config: ~/.openclaw/openclaw.json
  • Workspace: ~/.openclaw/workspace (skills, prompts, memory)

Bootstrap folders without the full wizard:

openclaw setup --baseline

(From a source checkout without a global install: pnpm openclaw setup --baseline.)

The stable path lets the macOS app manage the bundled Gateway. The bleeding-edge path runs pnpm gateway:watch and attaches the app in Local mode. On Linux, a systemd user service plus lingering matters so logout does not kill the Gateway.

For local models, install Ollama separately and use a tools-capable model. The bundled coding-agent skill expects one of claude, codex, opencode (or another supported CLI named in the skill metadata) on PATH.

Useful debug locations from the docs:

  • Channel/provider credentials: ~/.openclaw/credentials/
  • Model auth and sessions: SQLite stores under the state directory
  • Logs: /tmp/openclaw/ (documented default)

How do you set the model endpoint?

One-line answer: Use Ollama’s native host (default http://127.0.0.1:11434), not an OpenAI-compatible /v1 URL, and select provider/model through OpenClaw onboarding or models commands.

The Ollama provider doc states OpenClaw talks to Ollama’s native /api/chat API. During onboarding, pick Ollama, then Cloud + Local, Cloud only, or Local only. Local modes ask for a base URL and inspect installed models.

openclaw models list --provider ollama
openclaw models set ollama/<model>

Automatic discovery only considers models already loaded in memory (/api/ps) with tool support and enough confirmed context. An installed but unloaded model is not an automatic candidate; Desktop Model Setup can still prepare Local only explicitly. Cloud only uses OLLAMA_API_KEY and hosted defaults.

Gateway WebSocket defaults to ws://127.0.0.1:18789—keep the app and CLI on the same port. For headless one-shots, follow the Agent CLI docs for openclaw agent exec (embedded) versus Gateway-backed openclaw agent.

How do Cursor and Claude fit in?

One-line answer: OpenClaw owns the Gateway, skills, and sessions; Cursor IDE or Claude Code / Codex / OpenCode act as the coding side—especially as workers behind the coding-agent skill.

coding-agent is opt-in in Skills config. Example in ~/.openclaw/openclaw.json:

{
  skills: {
    entries: {
      "coding-agent": { enabled: true }
    }
  }
}

The skill is meant for delegated coding (large refactors, PR loops), not trivial edits or read-only lookup. Cursor the IDE is not listed as a required binary for that skill; treat IDE editing and Gateway-spawned worker CLIs as separate roles.

Minimum path: OpenClaw setup + Gateway → optional Ollama native connection → enable coding-agent + authenticate a worker CLI. Check Getting Started / Setup for current pins.

Sources