Skip to content
ajflowPublic

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Hive — run an AI company from your terminal

Run an AI company from your terminal.
Autonomous agent orchestration engine built in Rust.

Quickstart · Docs · Examples · Discord

MIT License Stars Crates.io Discord


$ hive status

  🏢 Flowtivity AI — All Systems Operational

  ┌─────────────────┬────────┬──────────┬───────────┬──────────┐
  │ Department       │ Status │ Budget   │ Spent     │ Mode     │
  ├─────────────────┼────────┼──────────┼───────────┼──────────┤
  │ 📝 Content       │ 🟢     │ $15/day  │ $11.20    │ auto     │
  │ 🔍 Leads         │ 🟢     │ $10/day  │ $7.45     │ auto     │
  │ 📧 Sales         │ 🟡     │ $15/day  │ $9.80     │ approval │
  │ 📊 Analytics     │ 🟢     │ $5/day   │ $3.10     │ auto     │
  │ 🏗️ Tenders       │ 🟡     │ $10/day  │ $5.60     │ approval │
  │ 🔬 QA            │ 🟢     │ $8/day   │ $3.90     │ auto     │
  │ 🛡️ Governance    │ 🟢     │ $2/day   │ $1.25     │ auto     │
  └─────────────────┴────────┴──────────┴───────────┴──────────┘

  Total: $42.30 / $65.00 (65%) · 7/7 agents active · 23 tasks today

What is Hive?

Hive is an orchestration engine for AI agent companies. Define your company in a TOML file, hire agents from any provider, set budgets, and let them run. Monitor everything from your terminal.

If OpenClaw is an employee, and Paperclip is a company — Hive is the operating system.

Your terminal
    ↕
hive (this project)
    ↕
┌──────────┬──────────┬──────────┬──────────┐
│ OpenClaw │  Claude  │  Codex   │  Any LLM │
│  agents  │   Code   │  agents  │  agent   │
└──────────┴──────────┴──────────┴──────────┘

One binary. Zero dependencies. Runs anywhere.


Why Hive?

Without Hive With Hive
20 terminal tabs, no idea which agent is doing what hive status — one command, full picture
Agents burn through API credits unchecked Per-department budgets with automatic circuit breakers
Company knowledge lives in your head hive.toml — your entire company is version-controlled
"Did the content agent already publish today?" hive logs content --today
Agent sends embarrassing duplicate email Governance agent catches it, hive audit shows the block
Sharing your agent setup means writing docs hive export > company.toml — anyone can hive import it
Restarting agents after a reboot takes 20 minutes hive up — everything back in 2 seconds

Quickstart

Install

# From crates.io
cargo install hive-ai

# Or download pre-built binary (macOS, Linux, Windows)
curl -fsSL https://hive.flowtivity.ai/install.sh | sh

# Or via npm (bundles native binary)
npm install -g @AJflow/hive

Create your first company

hive init my-company
cd my-company

This creates a hive.toml:

[company]
name = "My AI Company"
mission = "Build something amazing"
currency = "USD"

[board]
name = "Your Name"

[[departments]]
id = "engineering"
name = "Engineering"
mission = "Build the product"
budget = { daily = 20.00 }
mode = "autonomous"
runtime = "claude-code"

Hire your first agent and run

# Authenticate with your LLM provider
export ANTHROPIC_API_KEY=sk-ant-...

# Start all departments
hive up

# Or run a single task
hive run engineering "Build a REST API for user authentication"

# Watch it work
hive logs engineering --follow

Core Concepts

Company-as-Code

Your entire company is defined in hive.toml. Git-trackable. Shareable. Reproducible.

[company]
name = "Flowtivity AI"
mission = "Work smarter with AI, not harder with more hours"
currency = "AUD"

[board]
name = "AJ Awan"
contact = "telegram:aj"
notify = ["daily-briefing", "budget-alert", "error"]

[ceo]
name = "Flowbee"
runtime = "openclaw"
interface = "telegram"
memory = true  # persistent memory across sessions

[[departments]]
id = "content"
name = "Content & AEO"
mission = "Own search rankings and social presence"
budget = { daily = 15.00, alert_at = 0.8, pause_at = 1.0 }
mode = "autonomous"
runtime = "openclaw"
skills = ["aeo-blog", "linkedin-post", "social-media"]
schedule = "0 8 * * *"  # wake at 8am daily
kpis = ["posts_published", "impressions", "clicks", "avg_position"]

[[departments]]
id = "leads"
name = "Lead Research"
mission = "Keep the pipeline full with qualified prospects"
budget = { daily = 10.00 }
mode = "autonomous"
runtime = "openclaw"
skills = ["lead-researcher", "contact-enrichment"]
depends_on = ["analytics"]  # waits for analytics insights before researching

[[departments]]
id = "sales"
name = "Sales & Outreach"
mission = "Convert leads to meetings"
budget = { daily = 15.00 }
mode = "approval"  # first-touch emails need human approval
runtime = "openclaw"
skills = ["cold-email", "prototype-builder"]
approver = "board"
depends_on = ["leads", "qa"]

[[departments]]
id = "analytics"
name = "Analytics & Intelligence"
mission = "Surface opportunities from data"
budget = { daily = 5.00 }
mode = "autonomous"
runtime = "claude-code"
skills = ["gsc-analytics", "ga4", "cloudflare-stats"]
schedule = "0 7 * * *"  # first to wake, feeds other departments

[[departments]]
id = "tenders"
name = "Bid & Tender"
mission = "Find and win government tenders"
budget = { daily = 10.00 }
mode = "approval"
runtime = "openclaw"
skills = ["austender-scraper", "bid-writer"]
approver = "board"

[[departments]]
id = "qa"
name = "Product & QA"
mission = "Nothing ships broken"
budget = { daily = 8.00 }
mode = "autonomous"
runtime = "claude-code"
skills = ["prototype-qa", "email-qa", "blog-qa"]
# QA reviews output from content and sales before it ships
reviews = ["content", "sales", "tenders"]

[[departments]]
id = "governance"
name = "Governance & Budget"
mission = "Keep the machine honest and efficient"
budget = { daily = 2.00 }
mode = "autonomous"
runtime = "claude-code"
skills = ["budget-monitor", "dedup-checker", "audit-trail"]
watches = ["*"]  # monitors all departments

Agent Runtimes

Hive doesn't care what agent you use. If it can receive a task and return a result, it's hired.

Runtime How it works Best for
openclaw Connects via OpenClaw gateway API Autonomous 24/7 agents with memory
claude-code Spawns Claude Code process Coding, analysis, one-shot tasks
codex Spawns Codex CLI Code generation, auto-approved changes
cursor Connects to Cursor workspace IDE-integrated development
http POST task to any HTTP endpoint Custom agents, cloud functions
shell Runs a shell command Scripts, cron-like automation
mcp Connects via Model Context Protocol Any MCP-compatible agent

Modes

Every department operates in one of three modes:

Mode Behaviour Use when
autonomous Agent acts freely within budget Low-risk work: analytics, research, content
approval Agent drafts, human approves before execution External comms: emails, bids, social posts
paused Agent stopped, no tasks processed Debugging, budget overrun, maintenance

Switch modes at any time:

hive mode sales approval     # require approval for all sales actions
hive mode sales autonomous   # let it run
hive pause sales             # stop immediately
hive resume sales            # restart

Budget Enforcement

Budgets are not suggestions. They're circuit breakers.

$ hive budget

  📊 Budget Overview — March 7, 2026

  Daily budget: $65.00 / Monthly: ~$1,950
  Today spent:  $42.30 (65%)

  ┌─────────────────┬──────────┬───────────┬──────────────┐
  │ Department       │ Budget   │ Spent     │ Status       │
  ├─────────────────┼──────────┼───────────┼──────────────┤
  │ Content          │ $15.00   │ $11.20    │ ██████████░░ │
  │ Sales            │ $15.00   │ $9.80     │ ████████░░░░ │
  │ Leads            │ $10.00   │ $7.45     │ █████████░░░ │
  │ Tenders          │ $10.00   │ $5.60     │ ███████░░░░░ │
  │ QA               │ $8.00    │ $3.90     │ ██████░░░░░░ │
  │ Analytics        │ $5.00    │ $3.10     │ ████████░░░░ │
  │ Governance       │ $2.00    │ $1.25     │ ████████░░░░ │
  └─────────────────┴──────────┴───────────┴──────────────┘

  Cost efficiency:
    Per lead:  $1.85  (↓12% vs last week)
    Per post:  $3.20
    Per bid:   $2.80

When a department hits its budget limit:

  1. 80% — Warning logged, board notified
  2. 100% — Department auto-paused, board alerted
  3. Manual hive resume or wait for daily budget reset

Dependency Graph

Departments can depend on each other. Hive resolves the execution order automatically.

Analytics (7am) → Leads → Sales
                    ↓
                   QA → [ships to external]
                    ↑
                 Content
                    ↑
              Governance (watches all)
$ hive graph

  analytics ──→ leads ──→ sales
                  │          │
               content       │
                  │          │
                  └──→ qa ←──┘
                       │
                    [output]

  governance ──→ [watches: *]

CLI Reference

Company Management

hive init [name]              # Create new company in current directory
hive up                       # Start all departments
hive down                     # Gracefully stop all departments
hive status                   # Overview of all departments
hive org                      # Display org chart
hive graph                    # Show dependency graph
hive config                   # Validate and display hive.toml
hive export [file]            # Export company config
hive import <file>            # Import company config

Department Operations

hive run <dept> "task"        # Run a one-shot task in a department
hive logs <dept> [--follow]   # Stream department activity
hive logs <dept> --today      # Today's activity only
hive pause <dept>             # Pause a department
hive resume <dept>            # Resume a department
hive mode <dept> <mode>       # Set mode: autonomous | approval | paused
hive restart <dept>           # Restart department agent

Agent Management

hive hire <dept> [--runtime]  # Add/replace agent in a department
hive fire <dept>              # Remove agent from a department
hive agents                   # List all active agents
hive health                   # Health check all agents (heartbeat)

Budget & Governance

hive budget                   # Budget overview
hive budget set <dept> <amt>  # Set department budget
hive budget history [--days]  # Historical spend data
hive audit [dept]             # Full audit trail
hive audit --errors           # Only errors and blocks

Approvals

hive inbox                    # Show pending approvals
hive approve <id>             # Approve a pending action
hive reject <id> [--reason]   # Reject with optional reason
hive approve --all            # Approve all pending (use carefully)

AI Integration

hive mcp                      # Start MCP server (for Claude, Cursor, etc.)
hive mcp --stdio              # MCP over stdio (for tool integration)
hive serve [--port 8080]      # Start web dashboard
hive api                      # Start REST API server

Skills

hive skills list              # List installed skills
hive skills add <url>         # Install skill from GitHub
hive skills remove <name>     # Remove a skill

MCP Integration

Run hive mcp and any MCP-compatible client can orchestrate your company:

# In Claude Desktop settings, add:
{
  "mcpServers": {
    "hive": {
      "command": "hive",
      "args": ["mcp", "--stdio"]
    }
  }
}

Now Claude can:

  • hive.status() — check all departments
  • hive.run("content", "Write a blog about AI trends") — assign tasks
  • hive.budget() — check spend
  • hive.approve(id) — approve pending actions
  • hive.logs("sales") — read activity

Works with OpenClaw, Cursor, Windsurf, or any MCP client.


Web Dashboard

hive serve --port 8080

Opens a real-time dashboard at localhost:8080 with:

  • Org chart visualization
  • Department cards with budget bars, KPIs, and mode toggles
  • Live activity feed
  • Approval inbox
  • Budget charts and cost analytics
  • Mobile-responsive (manage from your phone)

The dashboard is optional. Everything it shows is available via the CLI.


Examples

Solo Founder — Content + Sales

[company]
name = "My SaaS"

[[departments]]
id = "content"
name = "Content"
budget = { daily = 10.00 }
mode = "autonomous"
runtime = "claude-code"

[[departments]]
id = "sales"  
name = "Sales"
budget = { daily = 10.00 }
mode = "approval"
runtime = "openclaw"

Agency — Multi-Client

[company]
name = "AI Agency"

# Each client gets their own department
[[departments]]
id = "client-acme"
name = "ACME Corp"
budget = { daily = 25.00 }
mode = "approval"
runtime = "openclaw"
tags = ["client", "enterprise"]

[[departments]]
id = "client-startup"
name = "Startup Inc"
budget = { daily = 10.00 }
mode = "autonomous"
runtime = "claude-code"
tags = ["client", "startup"]

Open Source Project — CI + Community

[company]
name = "My OSS Project"

[[departments]]
id = "triage"
name = "Issue Triage"
budget = { daily = 5.00 }
mode = "autonomous"
runtime = "claude-code"
skills = ["github-issues"]

[[departments]]
id = "pr-review"
name = "PR Review"
budget = { daily = 10.00 }
mode = "approval"
runtime = "codex"
skills = ["code-review"]

Architecture

┌─────────────────────────────────────────────────┐
│                    hive CLI                       │
│  (Rust binary — parsing, config, orchestration)  │
├─────────────────────────────────────────────────┤
│                                                   │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐       │
│  │ Scheduler│  │  Budget  │  │  Audit   │       │
│  │          │  │  Engine  │  │  Logger  │       │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘       │
│       │              │              │              │
│  ┌────┴──────────────┴──────────────┴────┐       │
│  │          Department Manager            │       │
│  │  (lifecycle, heartbeat, delegation)    │       │
│  └────┬──────────┬──────────┬────────────┘       │
│       │          │          │                     │
│  ┌────┴────┐ ┌───┴────┐ ┌──┴─────┐              │
│  │OpenClaw │ │ Claude │ │  HTTP  │  ...adapters  │
│  │Adapter  │ │ Code   │ │Adapter │              │
│  └─────────┘ └────────┘ └────────┘              │
│                                                   │
├─────────────────────────────────────────────────┤
│  Storage: SQLite (embedded) or Postgres           │
│  Config:  hive.toml                               │
│  Logs:    Append-only audit trail                 │
│  API:     REST + WebSocket + MCP                  │
└─────────────────────────────────────────────────┘

Key Design Decisions

  • Single binary — No runtime dependencies. Download and run.
  • SQLite default — Zero-config embedded database. Postgres optional for scale.
  • Append-only audit — Every agent action is immutable. Compliance-ready.
  • Adapter pattern — New agent runtimes are a single trait implementation.
  • Config-driven — All behaviour defined in hive.toml. No code required.
  • Offline-first — Works without internet for local agents. Cloud optional.

Comparison

Hive Paperclip CrewAI AutoGen
Language Rust Node.js Python Python
Interface CLI + Dashboard Dashboard Python API Python API
Config TOML file Dashboard UI Python code Python code
Budgets Per-department, circuit breakers Per-agent limits None None
MCP Native No No No
Agent-agnostic Any runtime OpenClaw, Claude, Codex LangChain-based OpenAI-based
Audit trail Append-only log Basic logging None None
Install Single binary Docker/Node.js pip install pip install
Company-as-code hive.toml UI config Python scripts Python scripts
Dependency graph Built-in No Sequential only Round-robin

Roadmap

  • Core CLI — init, up, down, status, logs
  • hive.toml config system
  • Budget engine with circuit breakers
  • OpenClaw adapter
  • Claude Code adapter
  • Audit trail
  • MCP server (hive mcp)
  • Web dashboard (hive serve)
  • Approval workflow (hive inbox)
  • Dependency graph execution
  • Codex adapter
  • HTTP adapter (webhooks)
  • hive publish — share company templates
  • Plugin system for custom adapters
  • Multi-company support (hive.workspace.toml)
  • Hive Cloud — managed hosting (coming 2026)

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Clone and build
git clone https://github.com/AJflow/hive.git
cd hive
cargo build

# Run tests
cargo test

# Run with example config
cargo run -- --config examples/flowtivity/hive.toml status

Built With

Hive is built and tested using AI agents — specifically OpenClaw and Claude Code. We eat our own cooking.

The Flowtivity team runs Hive in production to manage 7 departments, 186+ leads across AU and US, and $65/day in autonomous AI operations.

Read the full story:


License

MIT — see LICENSE for details.


Built by Flowtivity 🐝 — Work smarter with AI, not harder with more hours.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages