mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 10:01:34 +00:00
Adds a non-interactive command surface (openclaw reef register|status|friend code|request|list|remove) so an agent can claim a handle and manage guarded friendships when its owner asks, without the interactive wizard. --json emits machine-readable output for automation. Registration is crash-safe and idempotent: guard defaults are provider-coupled, the full config is validated before the single-use magic-link token is consumed, a duplicate-handle claim recovers by proving key ownership and reconciling the relay's request policy, the exchanged session is cached scoped to relay+email (never printed) so reruns recover, one state dir is pinned to one identity, and friend removal revokes both the pin and the allowlist entry. Manifest gains commandAliases/onCommands so the CLI resolves; docs cover the agent-driven path.
22 lines
667 B
TypeScript
22 lines
667 B
TypeScript
// Reef plugin module registers headless CLI commands so agents can drive
|
|
// registration, pairing, and status without the interactive wizard.
|
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/channel-plugin-common";
|
|
|
|
export function registerReefCliMetadata(api: OpenClawPluginApi) {
|
|
api.registerCli(
|
|
async ({ program }) => {
|
|
const { registerReefCli } = await import("./cli.js");
|
|
registerReefCli({ program });
|
|
},
|
|
{
|
|
descriptors: [
|
|
{
|
|
name: "reef",
|
|
description: "Register on a Reef relay and manage guarded claw-to-claw friendships",
|
|
hasSubcommands: true,
|
|
},
|
|
],
|
|
},
|
|
);
|
|
}
|