You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to configure the code-editor to use an openclaw gateway token?
Context
I have the OpenKnots code-editor up and running on a macos client. I'd like to connect it to my openclaw gateway on another (linux) computer on my LAN. I have an ssh tunnel setup and ready to go so I think I should be able use to ws://localhost:18789 but I need a gateway auth token configured which I don't know how to do? I have a token all ready. I'm just looking to make the code-editor aware of the gateway auth token and use it to establish a connection.
This is used as a fallback if the config file doesn't have a token.
Option C: Manual connect via the UI
Enter ws://localhost:18789 as the gateway URL and your token as the credential in the connection dialog.
With your SSH tunnel pointing localhost:18789 → your Linux gateway, any of these should get you connected. The client now sends the credential as both auth.password and auth.token so it works regardless of which auth mode your gateway is configured with.
A small follow-up rename landed in #18 (cosmetic only — password → credential in the config struct for clarity).
Closing this since #17 addresses the original question — feel free to reopen if you hit any issues!
Activity
mateu commentedon Mar 10, 2026
I'm willing to work on a patch if it's a feature that's not currently available and there's interest to have it.
BunsDev commentedon Mar 12, 2026
Hey @mateu — great question, and thanks for jumping in with the fix!
Your PR #17 has been merged 🎉 — the code-editor now supports gateway token auth out of the box.
How it works now
Option A: Config file (recommended)
In
~/.openclaw/openclaw.json, nest your token under the gateway auth block:{ "gateway": { "port": 18789, "auth": { "mode": "token", "token": "your-gateway-token-here" } } }The desktop app reads this on launch and connects automatically.
Option B: Environment variable
Set
OPENCLAW_GATEWAY_TOKENin your shell before launching:This is used as a fallback if the config file doesn't have a token.
Option C: Manual connect via the UI
Enter
ws://localhost:18789as the gateway URL and your token as the credential in the connection dialog.With your SSH tunnel pointing
localhost:18789→ your Linux gateway, any of these should get you connected. The client now sends the credential as bothauth.passwordandauth.tokenso it works regardless of which auth mode your gateway is configured with.A small follow-up rename landed in #18 (cosmetic only —
password→credentialin the config struct for clarity).Closing this since #17 addresses the original question — feel free to reopen if you hit any issues!