@oni.bot/code
npm install -g @oni.bot/codeRequires Node.js 18+ and an OPENROUTER_API_KEY environment variable.
oni # interactive mode in current directory
oni --auto # autonomous mode (minimal approval prompts)
oni --dir /path/to/project # specify project rootOPENROUTER_API_KEY=sk-or-... # required
ONI_MODEL=anthropic/claude-sonnet-4 # optional, sets primary model
ONI_FAST_MODEL=anthropic/claude-haiku-4 # optional, sets fast modeloni is a full agentic coding assistant that runs in your terminal. It understands your codebase, plans work, executes it, and verifies the result — all in a single session.
Agentic loop — think → act → observe cycle with automatic context compaction at 68% threshold. The agent stays in context across hundreds of turns.
Coding tools — read files, write files, apply patches, run shell commands, batch edits, multi-file search. All operations are tracked and reversible.
Swarm dispatch — complex tasks automatically route to multi-agent swarms (fan-out, pipeline, debate, map-reduce, hierarchical, peer-network, pool). The conductor decides the topology.
Web tools — websearch and webfetch for research tasks, wired into the agent loop.
Cron scheduler — /loop 30m <task> schedules recurring agent tasks within a session.
Skills — drop a SKILL.md in .oni/skills/ and the agent gains a new capability with /skill-name invocation.
Permission system — interactive or auto mode. Granular allow/deny rules per tool pattern.
Plugin system — extend with custom tools via the plugin loader.
Create oni.jsonc in your project root (supports comments):
@oni.bot/code is built entirely on @oni.bot/core primitives:
| Component | Core primitive |
|---|---|
| Conductor | ONIHarness, AgentLoop |
| Context compaction | ContextCompactor |
| Lifecycle hooks | HooksEngine |
| Tool definitions | defineTool, ToolSchema |
| Swarm dispatch | SwarmGraph, 7 topology templates |
| Event system | EventBus, 22 lifecycle event types |
| Model adapters | openrouter, anthropic, openai, google, ollama |
Part of the ONI platform:
@oni.bot/core— graph execution engine and framework primitives@oni.bot/sentinel— code analysis and review engine
MIT — AP3X Dev
{ // Primary model "model": "anthropic/claude-sonnet-4", // Maximum agent turns per session "maxTurns": 50, // Autonomous mode — skip most approval prompts "mode": "auto", // Swarm defaults "swarm": { "maxConcurrency": 5, "agentTimeout": 300000 } }