{"id":45862273,"url":"https://github.com/longzhi/clawhive","last_synced_at":"2026-04-02T20:36:49.339Z","repository":{"id":340911879,"uuid":"1156026636","full_name":"longzhi/clawhive","owner":"longzhi","description":"Lightweight, Rust-native AI Agent platform. Security sandbox from day one.","archived":false,"fork":false,"pushed_at":"2026-03-31T16:57:25.000Z","size":22783,"stargazers_count":50,"open_issues_count":15,"forks_count":10,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-31T18:44:10.578Z","etag":null,"topics":["a2a","agent","agent-framework","ai","ai-agent","chatbot","multi-agent","openclaw","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/longzhi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-12T07:07:37.000Z","updated_at":"2026-03-31T16:57:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/longzhi/clawhive","commit_stats":null,"previous_names":["longzhi/clawhive"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/longzhi/clawhive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longzhi%2Fclawhive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longzhi%2Fclawhive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longzhi%2Fclawhive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longzhi%2Fclawhive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longzhi","download_url":"https://codeload.github.com/longzhi/clawhive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longzhi%2Fclawhive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31315999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","agent","agent-framework","ai","ai-agent","chatbot","multi-agent","openclaw","rust"],"created_at":"2026-02-27T06:24:13.744Z","updated_at":"2026-04-02T20:36:49.334Z","avatar_url":"https://github.com/longzhi.png","language":"Rust","readme":"# clawhive\n\n[![CI](https://github.com/longzhi/clawhive/actions/workflows/ci.yml/badge.svg)](https://github.com/longzhi/clawhive/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Rust](https://img.shields.io/badge/rust-1.92%2B-orange.svg)](https://www.rust-lang.org/)\n[![GitHub release](https://img.shields.io/github/v/release/longzhi/clawhive?include_prereleases)](https://github.com/longzhi/clawhive/releases)\n\nEnglish | [中文](README_CN.md)\n\nAn open-source, Rust-native alternative to [OpenClaw](https://github.com/openclaw/openclaw) — deploy your own AI agents across Telegram, Discord, Feishu/Lark, WhatsApp, WeChat, and more with a single binary.\n\n**One binary, ~14 MB, zero runtime dependencies.** No Node.js, no npm, no Docker — just download, configure, and run.\n\n## Installation\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/longzhi/clawhive/main/install.sh | bash\n```\n\nAuto-detects OS/architecture, downloads latest release, installs binary and skills to `~/.clawhive/`.\n\nAfter installation, run to activate in your current shell:\n\n```bash\nsource ~/.clawhive/env\n```\n\nOr download manually from [GitHub Releases](https://github.com/longzhi/clawhive/releases).\n\n## Setup\n\nConfigure providers, agents, and channels using either method:\n\n**Option A: Web Setup Wizard** — Start the server and open the browser-based wizard:\n\n```bash\nclawhive start\n# Open http://localhost:8848/setup in your browser\n```\n\n**Option B: CLI Setup Wizard** — Run the interactive terminal wizard:\n\n```bash\nclawhive setup\n```\n\n## Usage\n\n```bash\n# Setup / config\nclawhive setup\nclawhive validate\n\n# Chat mode (local REPL)\nclawhive chat\n\n# Service lifecycle\nclawhive start               # start in foreground\nclawhive up                  # start if not already running (always daemon)\nclawhive restart\nclawhive stop\nclawhive reload              # hot-reload config without restart\n\n# Dashboard mode (observability TUI)\nclawhive dashboard\n\n# Code mode (developer TUI)\nclawhive code\n\n# Agents / sessions\nclawhive agent list\nclawhive agent show clawhive-main\nclawhive session reset \u003csession_key\u003e\n\n# Schedules / tasks\nclawhive schedule list\nclawhive schedule run \u003cschedule_id\u003e\nclawhive task trigger clawhive-main \"summarize today's work\"\n\n# Logs\nclawhive logs\n\n# Auth\nclawhive auth status\nclawhive auth login openai\n```\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `setup` | Interactive configuration wizard |\n| `up` | Start as background daemon (alias for `start -d`) |\n| `start [--tui] [--daemon]` | Start all configured channel bots and HTTP API server |\n| `stop` | Stop a running clawhive process |\n| `restart` | Restart clawhive (stop + start as daemon) |\n| `reload [--agents\\|--routing]` | Hot-reload configuration without restart |\n| `chat [--agent \u003cid\u003e]` | Local REPL for testing |\n| `validate` | Validate YAML configuration |\n| `consolidate` | Run memory consolidation manually |\n| `logs` | Tail the latest log file |\n| `agent list\\|show\\|enable\\|disable` | Agent management |\n| `skill list\\|show\\|analyze\\|install` | Skill management |\n| `session reset \u003ckey\u003e` | Reset a session |\n| `schedule list\\|run\\|enable\\|disable\\|history` | Scheduled task management |\n| `wait list` | List background wait tasks |\n| `task trigger \u003cagent\u003e \u003ctask\u003e` | Send a one-off task to an agent |\n| `auth login\\|status` | OAuth authentication management |\n\n## Why clawhive?\n\n- **Tiny footprint** — One binary, ~14 MB. Runs on a Raspberry Pi, a VPS, or a Mac Mini with minimal resource usage.\n- **Security by design** — Two-layer security model: non-bypassable hard baseline + origin-based trust. External skills must declare permissions explicitly.\n- **Bounded execution** — Enforced token budgets, timeout limits, and sub-agent recursion depth. No runaway loops, no surprise bills.\n- **Web + CLI setup** — Browser-based setup wizard or interactive CLI. Get your first agent running in under 2 minutes.\n\n## Features\n\n- Multi-agent orchestration with per-agent personas, model routing, and memory policy controls\n- Three-layer memory system: Session JSONL → Daily files → MEMORY.md (long-term)\n- Hybrid search: sqlite-vec vector similarity + FTS5 BM25 over memory chunks\n- Hippocampus consolidation: periodic LLM-driven synthesis into long-term memory\n- Channel adapters: Telegram, Discord, Slack, WhatsApp, iMessage, Feishu, DingTalk, WeCom (multi-bot, multi-connector)\n- ReAct reasoning loop with repeat guard and sub-agent spawning\n- Skill system (SKILL.md with frontmatter + permission declarations)\n- Token-bucket rate limiting per user\n- LLM provider abstraction with retry + exponential backoff (Anthropic, OpenAI, Gemini, DeepSeek, Groq, Ollama, OpenRouter, Together, Fireworks, and any OpenAI-compatible endpoint)\n- Real-time TUI dashboard and YAML-driven configuration\n\n## Architecture\n\n![clawhive architecture](assets/architecture.png)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eProject Structure\u003c/strong\u003e\u003c/summary\u003e\n\n```\ncrates/\n├── clawhive-cli/        # CLI binary (clap) — start, setup, chat, validate, agent/skill/session/schedule\n├── clawhive-core/       # Orchestrator, session mgmt, config, persona, skill system, sub-agent, LLM router\n├── clawhive-memory/     # Memory system — file store (MEMORY.md + daily), session JSONL, SQLite index, chunker, embedding\n├── clawhive-gateway/    # Gateway with agent routing and per-user rate limiting\n├── clawhive-bus/        # Topic-based in-process event bus (pub/sub)\n├── clawhive-provider/   # LLM provider trait + multi-provider adapters (streaming, retry)\n├── clawhive-channels/   # Channel adapters (Telegram, Discord, Slack, WhatsApp, iMessage)\n├── clawhive-auth/       # OAuth and API key authentication\n├── clawhive-scheduler/  # Cron-based task scheduling\n├── clawhive-server/     # HTTP API server\n├── clawhive-schema/     # Shared DTOs (InboundMessage, OutboundMessage, BusMessage, SessionKey)\n├── clawhive-runtime/    # Task executor abstraction\n└── clawhive-tui/        # Real-time terminal dashboard (ratatui)\n\n~/.clawhive/             # Created by install + setup\n├── bin/                 # Binary\n├── skills/              # Skill definitions (SKILL.md with frontmatter)\n├── config/              # Generated by `clawhive setup`\n│   ├── main.yaml        # App settings, channel configuration\n│   ├── agents.d/*.yaml  # Per-agent config (model policy, tools, memory, identity)\n│   ├── providers.d/*.yaml # LLM provider settings\n│   └── routing.yaml     # Channel → agent routing bindings\n├── workspaces/          # Per-agent workspace (memory, sessions, prompts)\n├── data/                # SQLite databases\n└── logs/                # Log files\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eSecurity Model\u003c/strong\u003e\u003c/summary\u003e\n\nclawhive implements a **two-layer security architecture** for defense-in-depth:\n\n**Hard Baseline (Always Enforced)**\n\n| Protection | What It Blocks |\n|------------|----------------|\n| **SSRF Prevention** | Private networks (10.x, 172.16-31.x, 192.168.x), loopback, cloud metadata endpoints |\n| **Sensitive Path Protection** | Writes to `~/.ssh/`, `~/.gnupg/`, `~/.aws/`, `/etc/`, system directories |\n| **Private Key Shield** | Reads of `~/.ssh/id_*`, `~/.gnupg/private-keys`, cloud credentials |\n| **Dangerous Command Block** | `rm -rf /`, fork bombs, disk wipes, curl-pipe-to-shell patterns |\n| **Resource Limits** | 30s timeout, 1MB output cap, 5 concurrent executions |\n\n**Origin-Based Trust Model**\n\n| Origin | Trust Level | Permission Checks |\n|--------|-------------|-------------------|\n| **Builtin** | Trusted | Hard baseline only |\n| **External** | Sandboxed | Must declare all permissions in SKILL.md frontmatter |\n\nExternal skills declare permissions in SKILL.md:\n\n```yaml\n---\nname: weather-skill\npermissions:\n  network:\n    allow: [\"api.openweathermap.org:443\"]\n  fs:\n    read: [\"${WORKSPACE}/**\"]\n  exec: [curl, jq]\n  env: [WEATHER_API_KEY]\n---\n```\n\nAny access outside declared permissions is denied at runtime.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eMemory System\u003c/strong\u003e\u003c/summary\u003e\n\nThree-layer architecture inspired by neuroscience:\n\n1. **Session JSONL** (`sessions/\u003cid\u003e.jsonl`) — append-only conversation log, typed entries. Used for session recovery and audit trail.\n2. **Daily Files** (`memory/YYYY-MM-DD.md`) — daily observations written by LLM during conversations.\n3. **MEMORY.md** — curated long-term knowledge. Updated by hippocampus consolidation (LLM synthesis of recent daily files).\n4. **SQLite Search Index** — sqlite-vec + FTS5. Hybrid search: vector similarity × 0.7 + BM25 × 0.3.\n\nNote: JSONL files are NOT indexed. Only Markdown memory files participate in search.\n\n\u003c/details\u003e\n\n```bash\nclawhive start\n# Open http://localhost:8848/setup in your browser\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTechnical Comparison (vs OpenClaw)\u003c/strong\u003e\u003c/summary\u003e\n\n| Aspect | clawhive | OpenClaw |\n|--------|----------|----------|\n| **Runtime** | Pure Rust binary, embedded SQLite | Node.js runtime |\n| **Security Model** | Two-layer policy (hard baseline + origin trust) | Tool allowlist |\n| **Permission System** | Declarative SKILL.md permissions | Runtime policy |\n| **Memory** | Markdown-native (MEMORY.md canonical) | Markdown-native (MEMORY.md + memory/*.md) |\n| **Integration Surface** | Multi-channel (Telegram, Discord, Slack, WhatsApp, iMessage, CLI) | Broad connectors |\n| **Dependency** | Single binary, no runtime deps | Node.js + npm |\n\n\u003c/details\u003e\n\n### Run\n\n```bash\n# Setup / config\nclawhive setup\nclawhive validate\n\n# Chat mode (local REPL)\nclawhive chat\n\n# Service lifecycle\nclawhive start\nclawhive up                 # start if not already running (always daemon)\nclawhive restart\nclawhive stop\nclawhive reload              # hot-reload config without restart\n\n# Dashboard mode (observability TUI)\nclawhive dashboard\nclawhive dashboard --port 8848\n\n# Code mode (developer TUI)\nclawhive code\nclawhive code --port 8848\n\n# Agents / sessions\nclawhive agent list\nclawhive agent show clawhive-main\nclawhive session reset \u003csession_key\u003e\n\n# Schedules / tasks\nclawhive schedule list\nclawhive schedule run \u003cschedule_id\u003e\nclawhive task trigger clawhive-main \"summarize today's work\"\n\n# Auth\nclawhive auth status\nclawhive auth login openai\n```\n\n## Quick Start (Developers)\n\nPrerequisites: Rust 1.92+\n\n```bash\n# Clone and build\ngit clone https://github.com/longzhi/clawhive.git\ncd clawhive\ncargo build --workspace\n\n# Interactive setup (configure providers, agents, channels)\ncargo run -- setup\n\n# Chat mode (local REPL)\ncargo run -- chat\n\n# Start all configured channel bots\ncargo run -- start\n\n# Start if not already running (always daemon)\ncargo run -- up\n\n# Restart / stop\ncargo run -- restart\ncargo run -- stop\n\n# Dashboard mode (observability TUI)\ncargo run -- dashboard\ncargo run -- dashboard --port 8848\n\n# Coding agent mode (attach local TUI channel to running gateway)\ncargo run -- code\ncargo run -- code --port 8848\n```\n\n## Developer Workflow\n\nUse local quality gates before pushing:\n\n```bash\n# One-time: install repo-managed git hooks\njust install-hooks\n\n# Run all CI-equivalent checks locally\njust check\n\n# Release flow: check -\u003e push main -\u003e replace tag and push tag\njust release v0.1.0-alpha.15\n```\n\nIf you don't use `just`, use scripts directly:\n\n```bash\nbash scripts/install-git-hooks.sh\nbash scripts/check.sh\nbash scripts/release.sh v0.1.0-alpha.15\n```\n\n`just check` runs:\n\n1. `cargo fmt --all -- --check`\n2. `cargo clippy --workspace --all-targets -- -D warnings`\n3. `cargo test --workspace`\n\n## Configuration\n\nConfiguration is managed through `clawhive setup`, which interactively generates YAML files under `~/.clawhive/config/`:\n\n- `main.yaml` — app name, runtime settings, feature flags, channel config\n- `agents.d/\u003cagent_id\u003e.yaml` — agent identity, model policy, tool policy, memory policy\n- `providers.d/\u003cprovider\u003e.yaml` — provider type, API base URL, authentication\n- `routing.yaml` — default agent ID, channel-to-agent routing bindings\n\nSupported providers: Anthropic, OpenAI, Gemini, DeepSeek, Qwen, Moonshot, Zhipu GLM, MiniMax, Volcengine, Qianfan, Groq, Ollama, OpenRouter, Together, Fireworks, and any OpenAI-compatible endpoint.\n\n\u003c/details\u003e\n\n## Development\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eQuick Start (Developers)\u003c/strong\u003e\u003c/summary\u003e\n\nPrerequisites: Rust 1.92+\n\n```bash\ngit clone https://github.com/longzhi/clawhive.git\ncd clawhive\ncargo build --workspace\n\ncargo run -- setup       # Interactive setup\ncargo run -- chat        # Chat mode (local REPL)\ncargo run -- start       # Start all channel bots\ncargo run -- start -d    # Start as background daemon\ncargo run -- dashboard   # Dashboard mode\ncargo run -- code        # Coding agent mode\n```\n\n\u003c/details\u003e\n\n```bash\n# Run all tests\ncargo test --workspace\n\n# Lint\ncargo clippy --workspace --all-targets -- -D warnings\n\n# Format\ncargo fmt --all\n\n# Run all CI-equivalent checks locally\njust check\n\n# Release\njust release v0.1.0-alpha.15\n```\n\n## Tech Stack\n\n| Component | Technology |\n|-----------|-----------|\n| Language | Rust (2021 edition) |\n| LLM Providers | Anthropic, OpenAI, Gemini, DeepSeek, Qwen, Moonshot, Zhipu GLM, MiniMax, Volcengine, Qianfan, Groq, Ollama, OpenRouter, Together, Fireworks |\n| Channels | Telegram, Discord, Slack, WhatsApp, iMessage, Feishu, DingTalk, WeCom, CLI |\n| Database | SQLite (rusqlite, bundled) |\n| Vector Search | sqlite-vec |\n| Full-Text Search | FTS5 |\n| HTTP | reqwest |\n| Async | tokio |\n| TUI | ratatui + crossterm |\n| CLI | clap 4 |\n\n## License\n\nMIT\n\n## Status\n\nThis project is under active development. The memory architecture uses Markdown-native storage + hybrid retrieval.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongzhi%2Fclawhive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongzhi%2Fclawhive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongzhi%2Fclawhive/lists"}