Skip to main content

No project description provided

Project description

minions-openclaw

CI npm version PyPI version License: MIT

A production-quality monorepo for managing OpenClaw Gateway instances using minions-sdk for structured data management.

Overview

minions-openclaw provides a TypeScript SDK, Python SDK, and CLI for:

  • Registering and managing multiple OpenClaw Gateway instances
  • Capturing point-in-time configuration snapshots
  • Decomposing openclaw.json configs into a structured minion tree
  • Monitoring live gateway state (agents, channels, model providers)
  • Diffing configuration across time or between instances

Features

  • ๐Ÿ”— Multi-instance management โ€” Register and manage a fleet of OpenClaw Gateway instances
  • ๐Ÿ“ธ Snapshot capture โ€” Capture live state snapshots for audit and comparison
  • ๐Ÿ”„ Config decomposition โ€” Parse openclaw.json into structured minions with typed schemas
  • ๐Ÿ“Š Diff & history โ€” Compare snapshots over time to track configuration drift
  • ๐Ÿ” Device authentication โ€” RSA-based device challenge/response authentication
  • ๐ŸŒ WebSocket client โ€” Full protocol implementation of the OpenClaw Gateway WS API
  • ๐Ÿ Python SDK โ€” Equivalent Python library for use in scripts and automation
  • ๐Ÿ“– Documentation โ€” Astro Starlight docs site

Installation

CLI (global)

npm install -g @minions-openclaw/cli

TypeScript SDK

npm install @minions-openclaw/sdk

Python SDK

pip install minions-openclaw

Quick Start

Register a gateway instance

openclaw-manager register my-gateway --url ws://192.168.1.100:8080 --token mytoken

List registered instances

openclaw-manager list

Ping an instance

openclaw-manager ping <instanceId>

Capture a snapshot

openclaw-manager snapshot <instanceId>

View snapshot history

openclaw-manager history <instanceId>

CLI Command Reference

openclaw-manager [command] [options]

Commands:
  register <name>         Register a new OpenClaw Gateway instance
    --url <url>           Gateway WebSocket URL (required)
    --token <token>       Auth token (optional)

  ping <instanceId>       Ping an instance and record latency

  snapshot <instanceId>   Capture a live snapshot of gateway state

  list                    List all registered instances

  history <instanceId>    Show snapshot history for an instance

  agents <instanceId>     List agents on a gateway
  channels <instanceId>   List channels on a gateway
  models <instanceId>     List model providers on a gateway

  config show <instanceId>              Show latest config
  config diff <id1> <id2>               Diff two snapshots
  config export <instanceId>            Export config as JSON
  config import <instanceId> --file <path>  Import config from file

TypeScript SDK Usage

import { MinionsOpenClaw } from '@minions-openclaw/sdk';

const minions = new MinionsOpenClaw();

// Register an instance
const instance = await minions.openclaw.instances.register('my-gateway', 'ws://localhost:8080', 'token');

// Connect and fetch live state
const client = minions.openclaw.createGatewayClient(instance.fields['url'] as string, 'token');
await client.openConnection();
const presence = await client.fetchPresence();
await client.close();

// Capture a snapshot
const snapshot = await minions.openclaw.snapshots.captureSnapshot(instance.id, presence);

// Decompose a config file
const config = await minions.openclaw.config.loadFromFile('./openclaw.json');
const { minions: newMinions, relations } = minions.openclaw.config.decompose(config, instance.id);

Python SDK Usage

from minions_openclaw import MinionsOpenClaw
import asyncio

minions = MinionsOpenClaw()

# Register an instance
instance = minions.openclaw.instances.register('my-gateway', 'ws://localhost:8080', 'token')

# Async: connect and fetch state
async def capture():
    client = minions.openclaw.create_gateway_client(instance.fields['url'], token='token')
    await client.open_connection()
    presence = await client.fetch_presence()
    await client.close()

    snapshot = minions.openclaw.snapshots.capture_snapshot(instance.id, presence)
    print(f'Snapshot: {snapshot.id}')

asyncio.run(capture())

Architecture

minions-openclaw/
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ core/          # TypeScript library (@minions-openclaw/sdk)
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ types.ts           # MinionType definitions for all OpenClaw entities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InstanceManager.ts # CRUD for gateway instances
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GatewayClient.ts   # WebSocket client (challenge/response auth)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SnapshotManager.ts # Snapshot capture & diff
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ConfigDecomposer.ts# openclaw.json โ†’ minion tree
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.ts           # Public exports
โ”‚   โ”‚   โ””โ”€โ”€ test/                  # Jest tests
โ”‚   โ”œโ”€โ”€ cli/           # CLI tool (@minions-openclaw/cli)
โ”‚   โ”‚   โ””โ”€โ”€ src/commands/          # Commander.js commands
โ”‚   โ””โ”€โ”€ python/        # Python SDK (minions-openclaw)
โ”‚       โ”œโ”€โ”€ minions_openclaw/
โ”‚       โ””โ”€โ”€ tests/
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ docs/          # Astro Starlight documentation
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ typescript/    # TypeScript usage examples
โ”‚   โ””โ”€โ”€ python/        # Python usage examples
โ””โ”€โ”€ spec/
    โ””โ”€โ”€ v0.1.md        # Technical specification

Data Storage

Instances and snapshots are persisted to ~/.openclaw-manager/data.json using the minions-sdk structured object format.

Connection Protocol

The GatewayClient implements the OpenClaw WebSocket protocol:

  1. Server sends connect.challenge with nonce + timestamp
  2. Client signs challenge with RSA private key (or sends empty signature)
  3. Server responds with hello-ok (or hello-error)
  4. Client can then call methods via { type: "call", id, method, params }

Development Setup

# Clone the repo
git clone https://github.com/minions-openclaw/minions-openclaw.git
cd minions-openclaw

# Install all JS dependencies (workspaces)
npm install

# Build TypeScript packages
npm run build

# Run TypeScript tests
npm run test -w packages/core

# Python setup
cd packages/python
pip install -e ".[dev]"
pytest tests/ -v

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/my-feature)
  3. Make your changes and add tests
  4. Run the test suite (npm test && cd packages/python && pytest)
  5. Commit your changes (git commit -m 'feat: add my feature')
  6. Push and open a Pull Request

License

MIT โ€” see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minions_openclaw-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minions_openclaw-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file minions_openclaw-0.1.1.tar.gz.

File metadata

  • Download URL: minions_openclaw-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minions_openclaw-0.1.1.tar.gz
Algorithm Hash digest
SHA256 44b30964b7a71ae1bc21c585cccad5b2e77e0a5dabedde3f53a74b13f49f6442
MD5 958a253cabbf7dee31ea39c26a514f97
BLAKE2b-256 456adc34ecd7867717f482615372c6f80bd1a6f2f90272de77eb533350cc86f7

See more details on using hashes here.

File details

Details for the file minions_openclaw-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for minions_openclaw-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfcb802677d7317bc14850343921f780237b50a1b13a21cdc5d5a77d4d49bd75
MD5 2f2ddc677fa2bc58755779c34f35251f
BLAKE2b-256 63f2e8d703963808e890a399621d3a9df78eb90beb9ccfdb00de66efb4375235

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page