Skip to main content

Prerequisites

  • Bun >= 1.0
  • TypeScript knowledge
  • NATS server (downloaded by ravi setup)

Setup

Build

The build process:
  1. prebuildgen:commands (generates CLI command registry)
  2. bun build → Bundles src/cli/index.ts into dist/bundle/ with minification
  3. gen:plugins → Writes the packaged internal plugins artifact to dist/bundle/internal-plugins.json

Dev Mode

Running Locally

Testing

Tests cover: bash tool, hooks, router, heartbeat, permissions, triggers, omni consumer, and bot.

Quality Checks

Or individually:

Documentation

Or via Makefile:

When to Restart the Daemon

Restart required:
  • After bun run build (code changes need the new bundle)
  • After modifying src/ files (daemon runs the built bundle)
No restart needed:
  • After any CLI config command (ravi agents set, ravi triggers set, etc.)
  • CLI writes directly to SQLite and emits NATS refresh signals
  • The running daemon picks up changes automatically

Git Hooks

The project uses git hooks via .githooks/:
The pre-push hook mirrors the CI quality gate locally:
If the generated SDK is stale, the hook runs bun run sdk:generate, leaves the generated files in the worktree, and blocks the push until they are committed. Never use --no-verify on commits or pushes.

Project Structure

Adding CLI Commands

CLI commands use decorators. Each command group is a file in src/cli/commands/:
After adding/modifying commands, run bun run gen:commands to regenerate the command registry.

Adding Skills

Skills are SKILL.md files in src/plugins/internal/ravi-system/skills/:
Each SKILL.md has YAML frontmatter (name, description) and markdown content that gets loaded into agent context when relevant. In source/dev mode, skills are discovered directly from src/plugins/internal/**. The packaged artifact is generated by bun run build; do not commit a generated skills registry.