Skip to content

AP3X-Dev/oni-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@oni.bot/code

The ONI AI coding assistant CLI.

npm version MIT License powered by @oni.bot/core


Install

npm install -g @oni.bot/code

Requires Node.js 18+ and an OPENROUTER_API_KEY environment variable.


Usage

oni                          # interactive mode in current directory
oni --auto                   # autonomous mode (minimal approval prompts)
oni --dir /path/to/project   # specify project root

Environment

OPENROUTER_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 model

What it does

oni 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 toolswebsearch 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.


Configuration

Create oni.jsonc in your project root (supports comments):

{
  // 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
  }
}

Architecture

@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

Ecosystem

Part of the ONI platform:


License

MIT — AP3X Dev

About

The ONI AI coding assistant — powered by @oni.bot/core

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors