npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@clawnexus/sdk

v0.4.0

Published

ClawNexus SDK — programmatic client for discovering and managing OpenClaw instances

Readme

@clawnexus/sdk

ClawLink Protocol SDK — programmatic client for the ClawNexus daemon API.

Discover and manage OpenClaw-compatible AI instances from your Node.js applications.

Installation

npm install @clawnexus/sdk

Requires Node.js >= 22 and a running clawnexus daemon.

Quick Start

import { ClawNexusClient } from "@clawnexus/sdk";

const client = new ClawNexusClient();

// List all discovered instances
const { instances } = await client.listInstances();
console.log(instances);

// Get a specific instance by name or alias
const inst = await client.getInstance("home");
console.log(`${inst.alias ?? inst.auto_name} @ ${inst.address}:${inst.gateway_port}`);

// Scan the network
const scan = await client.scan();
console.log(`Found ${scan.discovered} instance(s)`);

// Set an alias
await client.setAlias("olivia", "home");

API Reference

Constructor

const client = new ClawNexusClient({
  apiUrl: "http://localhost:17890",  // default
  timeout: 5000,                     // default, in ms
});

Instance Methods

| Method | Returns | Description | |--------|---------|-------------| | health() | Record<string, unknown> | Daemon health status | | listInstances(opts?) | { count, instances } | List instances, optional scope filter | | getInstance(id) | ClawInstance | Get instance by alias, auto_name, address, or address:port | | setAlias(id, alias) | { status, auto_name, agent_id, alias } | Set or update instance alias | | removeInstance(id) | { status, removed } | Remove instance from registry | | scan() | { status, discovered, instances } | Trigger network scan |

Registry Methods (v0.2)

| Method | Returns | Description | |--------|---------|-------------| | register() | { status, claw_name, pubkey } | Register with public Registry | | registryStatus() | RegistryStatus | Current registration status | | resolve(name) | ClawInstance | Resolve a .claw name via public Registry | | whoami() | WhoamiResponse | This instance's public key and .claw name |

Relay Methods (v0.4)

| Method | Returns | Description | |--------|---------|-------------| | relayConnect(clawId) | { status, target } | Initiate relay connection to a peer | | relayStatus() | Record<string, unknown> | Current relay state and active rooms | | relayDisconnect(roomId) | { status, room_id } | Disconnect a relay room |

Agent Policy Methods (v0.4)

| Method | Returns | Description | |--------|---------|-------------| | getPolicy() | PolicyConfig | Get current policy configuration | | updatePolicy(policy) | { status } | Replace full policy configuration | | patchPolicy(partial) | { status, policy } | Partial update (deep merge) | | resetPolicy() | { status, policy } | Reset to defaults |

Agent Task Methods (v0.4)

| Method | Returns | Description | |--------|---------|-------------| | listTasks(opts?) | { count, tasks } | List tasks, filter by direction, state, or all | | getTask(taskId) | TaskRecord | Get a single task by ID | | cancelTask(taskId, reason?) | { status, task } | Cancel an active task | | getTaskStats() | TaskStats | Aggregate task statistics | | propose(targetClawId, roomId, task) | { status, task } | Send a task proposal to a peer | | query(targetClawId, roomId, queryType) | { status, message_id } | Query peer capabilities/status | | getInbox() | { count, items } | List inbound proposals pending review | | approveInbox(messageId) | { status, task } | Approve a queued proposal | | denyInbox(messageId, reason?) | { status } | Deny a queued proposal |

Error Handling

import { ClawNexusClient, ClawNexusApiError } from "@clawnexus/sdk";

const client = new ClawNexusClient();

try {
  const inst = await client.getInstance("unknown");
} catch (err) {
  if (err instanceof ClawNexusApiError) {
    console.log(err.statusCode);  // 404
    console.log(err.message);     // "Instance not found"
  }
}

Types

The SDK re-exports all core types:

import type {
  ClawInstance,
  PolicyConfig,
  TaskRecord,
  TaskSpec,
  TaskStats,
  TaskState,
  TaskDirection,
  InboxItem,
  RegistryStatus,
  WhoamiResponse,
} from "@clawnexus/sdk";

License

MIT