openclaw-cli

Installation
SKILL.md

OpenClaw CLI

Use the openclaw-cli CLI for direct OpenClaw calls.

Install

If openclaw-cli is not installed yet, run:

curl -fsSL https://raw.githubusercontent.com/TimoBechtel/openclaw-cli/main/install.sh | bash

Required environment

export OPENCLAW_GATEWAY_TOKEN="your-token"

Optional:

  • OPENCLAW_BASE_URL (default http://127.0.0.1:18789)
  • OPENCLAW_AGENT_ID (default main)
  • OPENCLAW_SESSION_KEY_PREFIX

Usage

Start a new conversation (omit --session-key):

openclaw-cli ask "Summarize the latest deployment risks."

Continue the same conversation (reuse the returned session key):

openclaw-cli ask "Continue from previous context." --session-key "<session-key>"

Use machine-readable output when needed:

openclaw-cli ask "Return JSON with top 3 risks." --json

Session handling

  • Pass the same --session-key on every call to continue a conversation.
  • First call: omit --session-key (a new one is returned).
  • Later calls: pass the returned key.
  • To start fresh, omit --session-key again.

Context guidance

  • OpenClaw has no memory between sessions.
  • When starting fresh or omitting --session-key, include the full context OpenClaw needs:
    • the user's question
    • relevant code
    • file paths
    • any other important details
Installs
17
GitHub Stars
2
First Seen
Mar 2, 2026