No project description provided
Project description
minions-openclaw
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.jsonconfigs 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.jsoninto 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:
- Server sends
connect.challengewith nonce + timestamp - Client signs challenge with RSA private key (or sends empty signature)
- Server responds with
hello-ok(orhello-error) - 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
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Make your changes and add tests
- Run the test suite (
npm test && cd packages/python && pytest) - Commit your changes (
git commit -m 'feat: add my feature') - Push and open a Pull Request
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44b30964b7a71ae1bc21c585cccad5b2e77e0a5dabedde3f53a74b13f49f6442
|
|
| MD5 |
958a253cabbf7dee31ea39c26a514f97
|
|
| BLAKE2b-256 |
456adc34ecd7867717f482615372c6f80bd1a6f2f90272de77eb533350cc86f7
|
File details
Details for the file minions_openclaw-0.1.1-py3-none-any.whl.
File metadata
- Download URL: minions_openclaw-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfcb802677d7317bc14850343921f780237b50a1b13a21cdc5d5a77d4d49bd75
|
|
| MD5 |
2f2ddc677fa2bc58755779c34f35251f
|
|
| BLAKE2b-256 |
63f2e8d703963808e890a399621d3a9df78eb90beb9ccfdb00de66efb4375235
|