clasp-cli
Command-line interface for CLASP protocol routers and connections.
Installation
Or build from source:
Commands
Start CLASP Router
Important: You need a CLASP router running before protocol connections can work.
# Start a CLASP router (required - central message hub)
# Start router with specific transport
Start Protocol Connections
Note: These commands create protocol connections that connect to the CLASP router. Each connection translates bidirectionally between its protocol and CLASP.
# Start an OSC connection (listens for OSC, routes to CLASP router)
# Start an MQTT connection (connects to broker, routes to CLASP router)
# Start a WebSocket connection
# Start an HTTP REST API connection
How it works:
External Protocol ←→ Protocol Connection ←→ CLASP Router ←→ Other Connections/Clients
For example, clasp osc --port 9000:
- Listens for OSC messages on UDP port 9000
- Connects to CLASP router (default: localhost:7330)
- Translates OSC ↔ CLASP bidirectionally
- Routes through CLASP router to other clients/connections
Publish/Subscribe
# Publish a value
# Subscribe to an address pattern
Create Bridges
# Bridge OSC to MQTT
Configuration
# Show current configuration
# Start with config file
Key Management
Generate and inspect Ed25519 keypairs used for capability tokens and entity identity:
# Generate a new keypair (hex-encoded, saved with 0600 permissions)
# Show the public key
# Show in did:key format
Capability Token Commands
Create, delegate, inspect, and verify Ed25519 capability tokens (requires caps feature):
# Create a root token with admin access, valid for 30 days
# Delegate with narrower scopes
# Inspect a token (decode without validation)
# Verify a token against a trust anchor
Scope format: action:pattern where action is admin, write, read, or a custom string, and pattern is a CLASP address with optional wildcards.
Delegation rules: Child tokens can only narrow scopes (never widen), and cannot outlive their parent token.
Entity Token Commands
Generate entity keypairs and mint entity tokens (requires registry feature):
# Generate an entity keypair with metadata
# Mint an entity token from a keypair
# Inspect an entity token
Entity ID format: clasp:<base58> derived from the Ed25519 public key.
Options
| Flag | Description |
|---|---|
-v, --verbose |
Enable verbose logging |
--json |
Output in JSON format |
--config |
Path to configuration file |
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Maintained by LumenCanvas | 2026