o
odinpkg.dev
packages / library / odin-claw

odin-claw

0a4f30blibrary

Small enough to run on your coffee maker. 100% Odin. <0.5 MB binary.

No license ยท updated 5 months ago

OdinClaw

Small enough to run on your coffee maker.

406 KB binary ยท 2.7s build ยท 5.4 MB Docker image

AI assistant runtime written in Odin, inspired by NullClaw (Zig).

๐Ÿ“– Detailed Guide: See AGENTS.md for comprehensive operational documentation.

Features

  • Tiny: 406 KB binary, 5.4 MB Docker image, 2.7s build on Apple Silicon
  • Multi-Provider Support: OpenAI, Anthropic, xAI, Ollama, and 30+ OpenAI-compatible providers
  • 10 Built-in Tools: shell, file_read, file_write, file_edit, file_append, git, http_request, memory_store, memory_recall, memory_forget
  • Multiple Channels: CLI, Telegram, Slack, Discord
  • LMDB Backend: Fast local memory storage
  • Gateway Server: HTTP server with CORS, pairing, rate limiting
  • Security: ChaCha20-Poly1305 encryption, audit logging, path sandboxing

Installation

# Compile C helper for libcurl (one-time)
cc -c src/curl_helpers.c -o src/curl_helpers.o

# Build (optimized for speed)
odin build src -out:odin-claw -o:aggressive

Configuration

Create ~/.odin-claw/config.json:

{
  "providers": {
    "default_provider": "openai",
    "default_model": "gpt-4o",
    "openai_api_key": "sk-..."
  },
  "tools": {
    "workspace_path": "/tmp"
  },
  "channels": {
    "telegram_api_key": "..."
  }
}

Or use environment variables:

  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY
  • XAI_API_KEY
  • NULLCLAW_PROVIDERS_DEFAULT_PROVIDER

Commands

Command Description
odin-claw agent Start the AI agent loop
odin-claw gateway Start HTTP gateway server
odin-claw channel Manage messaging channels
odin-claw cron Manage scheduled tasks
odin-claw status Show system status
odin-claw doctor Run diagnostics
odin-claw onboard Initial setup wizard
odin-claw skills List/manage skills
odin-claw hardware Hardware management
odin-claw migrate Data migration
odin-claw models List available models
odin-claw daemon Run as background daemon
odin-claw service Run as system service
odin-claw help Show help

Providers

  • OpenAI: gpt-4o, gpt-4-turbo, gpt-3.5-turbo
  • Anthropic: claude-sonnet-4, claude-opus-4
  • xAI: grok-2, grok-beta
  • Ollama: llama3, mistral, codellama (local)
  • OpenAI-Compatible: Groq, DeepSeek, LM Studio, Vercel, Mistral, Cohere, Together, Perplexity, NVIDIA NIM, Venice, Zen/OpenCode

Tools

All tools support sandboxed execution with path validation:

  • shell - Execute shell commands
  • file_read - Read files
  • file_write - Write files
  • file_edit - Edit files (replace text)
  • file_append - Append to files
  • git - Git operations (status, commit, push, pull)
  • http_request - Make HTTP requests
  • memory_store - Store in memory DB
  • memory_recall - Search memory
  • memory_forget - Delete from memory

Testing

Run comprehensive tests (25 total in separate test files):

odin test src -all-packages

Tests are organized in separate files (*_test.odin) to keep the runtime binary lean and fast.

Development

Project Structure

src/
โ”œโ”€โ”€ main.odin          # CLI entry point
โ”œโ”€โ”€ agent.odin         # AI agent orchestration
โ”œโ”€โ”€ providers.odin     # LLM provider integrations
โ”œโ”€โ”€ tools.odin         # Tool definitions
โ”œโ”€โ”€ memory.odin        # In-memory storage
โ”œโ”€โ”€ lmdb.odin          # LMDB backend
โ”œโ”€โ”€ channels.odin      # Messaging channels
โ”œโ”€โ”€ gateway.odin       # HTTP server
โ”œโ”€โ”€ config.odin        # Configuration management
โ”œโ”€โ”€ runtime.odin       # Process execution
โ”œโ”€โ”€ security.odin      # Security utilities
โ”œโ”€โ”€ peripherals.odin   # Hardware interfaces
โ”œโ”€โ”€ curl_helpers.c     # C libcurl bindings
โ””โ”€โ”€ *_test.odin        # Test files (separate from runtime)

Building

# Development build
odin build src -out:odin-claw

# Optimized release build
odin build src -out:odin-claw -o:aggressive

License

MIT