Skip to content

neul-labs/openclaw-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenClaw Rust Core

A Rust implementation of OpenClaw by Neul Labs

Crates.io Documentation Rust License Build


What is This?

This is a Rust implementation of OpenClaw, the open-source AI agent framework, developed by Neul Labs.

Why Rust?

Benefit Impact
Performance Sub-millisecond message routing, minimal memory footprint
Safety Memory safety without GC, thread safety via ownership
Reliability No null pointer exceptions, exhaustive pattern matching
Portability Single binary deployment, cross-compilation to mobile/embedded
Interop napi-rs bindings for Node.js compatibility

Project Structure

┌─────────────────────────────────────────────────────────────────────────────────┐
│                              OpenClaw Rust Core                                  │
├─────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌───────────────────────┐  │
│  │  macOS App  │  │  iOS App    │  │ Android App │  │   TS Plugins (IPC)    │  │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘  └───────────┬───────────┘  │
│         └────────────────┴────────────────┴──────────────────────┘              │
│                              HTTP/WS • JSON-RPC                                  │
├─────────────────────────────────────────────────────────────────────────────────┤
│                       ┌──────────────────────────┐                              │
│                       │     openclaw-gateway     │                              │
│                       │   (axum HTTP/WS server)  │                              │
│                       │  ┌──────────────────┐    │                              │
│                       │  │   openclaw-ui    │    │                              │
│                       │  │ (Vue 3 Dashboard)│    │                              │
│                       │  └──────────────────┘    │                              │
│                       └────────────┬─────────────┘                              │
│            ┌───────────────────────┼───────────────────────┐                    │
│            │                       │                       │                    │
│   ┌────────┴────────┐   ┌─────────┴─────────┐   ┌────────┴────────┐            │
│   │  openclaw-core  │   │  openclaw-agents  │   │openclaw-channels│            │
│   │  (types, config │   │  (runtime, sandbox│   │ (Telegram, etc.)│            │
│   │   events, auth) │   │   workflow, tools)│   └─────────────────┘            │
│   └─────────────────┘   └───────────────────┘                                   │
│            │                       │                                            │
│   ┌────────┴────────┐   ┌─────────┴─────────┐                                  │
│   │ openclaw-secrets│   │openclaw-providers │                                  │
│   │  (AES-256-GCM)  │   │(Anthropic, OpenAI)│                                  │
│   └─────────────────┘   └───────────────────┘                                   │
└─────────────────────────────────────────────────────────────────────────────────┘

Crates

Crate Status Description
openclaw-core ✅ Complete Types, config, events, secrets, auth, validation
openclaw-ipc ✅ Complete IPC message types, nng transport
openclaw-providers ✅ Complete Anthropic, OpenAI providers with streaming
openclaw-agents ✅ Complete Runtime, sandbox, workflow, tools
openclaw-channels ⚠️ Partial Channel traits, routing, allowlist
openclaw-gateway ✅ Complete HTTP/WS server, JSON-RPC, embedded UI
openclaw-plugins ⚠️ Partial Plugin API, FFI bridge (wasmtime)
openclaw-cli ✅ Complete CLI commands (onboard, gateway, status, config)
openclaw-node ✅ Complete napi-rs bindings for Node.js
openclaw-ui ✅ Complete Vue 3 web dashboard (embedded in gateway)

Quick Start

Installation

# From crates.io
cargo install openclaw-cli

# From source
git clone https://github.com/neul-labs/openclaw-rs
cd openclaw-rs
cargo install --path crates/openclaw-cli

Requirements

  • Rust 1.85+ (2024 edition)
  • Node.js 20+ (for building the embedded UI)
  • System dependencies for sandboxing:
    • Linux: bubblewrap (bwrap)
    • macOS: Built-in sandbox-exec
    • Windows: No additional deps (uses Job Objects)

First Run

# Interactive setup wizard
openclaw onboard

# Start the gateway server
openclaw gateway run

# Open the web dashboard
openclaw dashboard

Usage Examples

CLI

# Check system status
openclaw status

# Run health checks
openclaw doctor

# Configure providers
openclaw configure --section auth

# Manage agents
openclaw agents list

Node.js (via openclaw-node)

const { AnthropicProvider, NodeEventStore } = require('openclaw-node');

// Create provider
const provider = new AnthropicProvider(process.env.ANTHROPIC_API_KEY);

// Create completion
const response = await provider.complete({
  model: 'claude-3-5-sonnet-20241022',
  messages: [{ role: 'user', content: 'Hello!' }],
  maxTokens: 1024,
});

console.log(response.content);

Rust

use openclaw_providers::{AnthropicProvider, Provider};
use openclaw_core::secrets::ApiKey;

let provider = AnthropicProvider::new(ApiKey::new("sk-...".into()));
let response = provider.complete(request).await?;

Design Principles

Principle Implementation
Event Sourcing Sessions stored as append-only event logs (sled)
CRDT Projections Conflict-free state via last-write-wins merge
Defense in Depth Input validation, sandboxing, secret redaction
Zero Trust All external input validated at boundaries
Fail Secure Errors default to denial, not exposure

Documentation


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


License

MIT License - see LICENSE for details.


Acknowledgments

This project is a Rust implementation inspired by and compatible with the original OpenClaw project. We're grateful for:

  • The excellent design and architecture of the original OpenClaw project
  • The open-source community that makes projects like this possible
  • The Rust ecosystem for its emphasis on safety and performance

Legal Notice

  • "OpenClaw" refers to the original open-source project at github.com/openclaw/openclaw
  • "Claude" and "Anthropic" are trademarks of Anthropic, PBC
  • "GPT" and "OpenAI" are trademarks of OpenAI, Inc
  • All trademarks belong to their respective owners

This is an independent implementation by Neul Labs. Provider integrations use official public APIs.


Links

About

A community Rust implementation of OpenClaw

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published