Managing Device Pairing with OpenClaw CLI
Managing device access and tokens often feels like a chore, especially when you’re dealing with pending requests or stale tokens that break your workflow. If you’ve ever been stuck trying to figure out why a device won’t connect or how to kick off an old session, you know the struggle.
The openclaw devices command is your go-to tool for managing device pairing requests and device-scoped tokens. Here is how you can use it to keep your connections clean and secure.
Commands
Section titled “Commands”openclaw devices list
Section titled “openclaw devices list”You can use this to list pending pairing requests and paired devices.
openclaw devices listopenclaw devices list --jsonThe output for pending requests includes the requested role and scopes. This helps you review approvals before you commit.
openclaw devices remove <deviceId>
Section titled “openclaw devices remove <deviceId>”If you need to remove a single paired device entry, use this command.
When you are authenticated with a paired device token, non-admin callers can remove only their own device entry. Removing some other device requires operator.admin.
openclaw devices remove <deviceId>openclaw devices remove <deviceId> --jsonopenclaw devices clear --yes [--pending]
Section titled “openclaw devices clear --yes [--pending]”Use this to clear paired devices in bulk.
openclaw devices clear --yesopenclaw devices clear --yes --pendingopenclaw devices clear --yes --pending --jsonopenclaw devices approve [requestId] [--latest]
Section titled “openclaw devices approve [requestId] [--latest]”This command lets you approve a pending device pairing request by its exact requestId. If you omit the requestId or pass --latest, OpenClaw only prints the selected pending request and exits. You will need to rerun the approval with the exact request ID after you verify the details.
Note: if a device retries pairing with changed auth details (role/scopes/public key), OpenClaw supersedes the previous pending entry and issues a new requestId. Run openclaw devices list right before approval to use the current ID.
openclaw devices approveopenclaw devices approve <requestId>openclaw devices approve --latestopenclaw devices reject <requestId>
Section titled “openclaw devices reject <requestId>”If a request looks wrong, you can reject the pending device pairing request.
openclaw devices reject <requestId>openclaw devices rotate --device <id> --role <role> [--scope <scope...>]
Section titled “openclaw devices rotate --device <id> --role <role> [--scope <scope...>]”You can rotate a device token for a specific role and optionally update scopes. The target role must already exist in that device’s approved pairing contract; rotation cannot mint a new unapproved role.
If you omit --scope, later reconnects with the stored rotated token reuse that token’s cached approved scopes. If you pass explicit --scope values, those become the stored scope set for future cached-token reconnects.
Non-admin paired-device callers can rotate only their own device token. Also, any explicit --scope values must stay within the caller session’s own operator scopes; rotation cannot mint a broader operator token than the caller already
openclaw devices rotate --device <deviceId> --role operator --scope operator.read --scope operator.writeopenclaw devices revoke --device <deviceId> --role nodeopenclaw config get gateway.auth.tokenopenclaw devices listopenclaw devices rotate --device <deviceId> --role operatoropenclaw devices remove <deviceId>openclaw devices listopenclaw devices approve <requestId>OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.