@sunbelife/openclaw-connector
v0.1.17
Published
Potato OpenClaw Connector CLI.
Readme
@sunbelife/openclaw-connector
Potato OpenClaw Connector CLI.
This connector now talks to the local OpenClaw installation through the official openclaw agent CLI by default, so users do not need to configure OPENCLAW_HTTP_URL_TEMPLATE.
Usage
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech \
--install-token ocit_xxx首次安装成功后,connector 会把服务端返回的重连凭证持久化到本地:
~/.config/potato-openclaw-connector/state.json之后同一台机器重启 connector、修改本地配置、或 WebSocket 短暂断开时,不再需要重新生成安装 token:
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech也可以显式传入服务端返回的重连 token:
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech \
--reconnect-token <reconnect-token>If your OpenClaw upstream is not preconfigured in the runtime environment, pass:
OPENCLAW_HTTP_URL_TEMPLATE="https://your-openclaw/api/responses" \
OPENCLAW_HTTP_AUTH_TOKEN="your-openclaw-token" \
OPENCLAW_DEFAULT_MODEL="your-model" \
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech \
--install-token ocit_xxxTo call the standard OpenClaw OpenResponses API directly:
OPENCLAW_HTTP_URL_TEMPLATE="https://your-openclaw/v1/responses" \
OPENCLAW_HTTP_AUTH_TOKEN="your-openclaw-token" \
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech \
--install-token ocit_xxxThe connector auto-detects .../v1/responses and switches to the standard OpenClaw request shape:
- request body:
{"model":"openclaw","input":"..."} - optional header:
x-openclaw-session-key - optional header:
x-openclaw-model - optional agent selection:
openclaw/<agent_id>if the job or env provides one
You can still force a specific mode:
OPENCLAW_HTTP_API_STYLE=openresponses
OPENCLAW_HTTP_API_STYLE=legacyTo print received jobs, upstream responses, and returned job_result payloads:
POTATO_OPENCLAW_DEBUG_JOBS=1 \
npx @sunbelife/openclaw-connector@latest connect \
--server-url https://potato.nootag.tech \
--install-token ocit_xxxBy default the connector runs:
openclaw agent --message "..." --jsonBy default the connector prefers the local OpenClaw agent potato. If that agent does not exist, it falls back to the OpenClaw default agent (or the first available agent).
If you want to target a specific local OpenClaw agent, set:
OPENCLAW_DEFAULT_AGENT_ID="main"In non-TTY environments, the connector automatically sets:
CI=true
NO_COLOR=1so that npm / CLI output remains machine-readable.
To verify that an install token can bootstrap correctly:
npx @sunbelife/openclaw-connector@latest doctor \
--server-url https://potato.nootag.tech \
--install-token ocit_xxxdoctor 也支持复用本地保存的重连状态:
npx @sunbelife/openclaw-connector@latest doctor \
--server-url https://potato.nootag.tech