Skip to main content
This runbook is the operational path for taking a fresh machine from zero to a working Ravi environment:
  1. Install and verify Omni.
  2. Install and verify Ravi.
  3. Configure the main WhatsApp instance.
  4. Configure the main agent.
  5. Create a REBAC audit group and route it to a dedicated audit agent.
  6. Add permission audit triggers.
  7. Run smoke checks.
Ravi is installed as a global CLI. Use ravi directly throughout this runbook. Do not create wrapper variables for first-time setup.

0. Operating Assumptions

  • Bun is installed and its global bin directory is on PATH.
  • Omni is the channel gateway.
  • Ravi owns agents, sessions, routing, policies, permissions, triggers, cron, and durable runtime state.
  • The Ravi source repo is only needed for development. A normal install uses the published global CLI.
  • Secrets stay in local environment files or a secret manager. Never paste them into chats, docs, or committed files.
Useful state locations:
Before starting, check what is already installed:

1. Install Omni

Omni must be installed before Ravi can connect WhatsApp, Telegram, Discord, Slack, or other channel accounts.
omni install is the interactive setup wizard. It handles server setup, process manager setup, API key generation, and startup. For scripted installs:
If this machine still has the old Omni CLI package:
Alternative install paths from the Omni repo:
Verify Omni:
If omni auth status is not authenticated but the server is running, login with the API key printed by the install/startup banner:
Optional raw Omni WhatsApp smoke test:
Use that raw Omni smoke only to prove the gateway works. The real Ravi-owned WhatsApp setup later should go through ravi instances create and ravi instances connect. Keep the boundary clear:
  • Omni owns transport and provider connection.
  • Ravi owns semantic runtime concepts: agent, instance, route, session, contact, chat, policy, and permission.

2. Install Ravi

Install the global CLI:
Configure local environment:
At minimum, configure:
  • the runtime provider credentials used by this deployment;
  • OMNI_API_URL;
  • OMNI_API_KEY;
  • NATS_URL, if not using the default local NATS endpoint.
Start the daemon:
If something fails, check logs before changing configuration:

3. Create the Main Agent

Recommended convention:
  • agent id: main
  • display name: Ravi
  • workspace: ~/ravi/main
Create the workspace:
Create ~/ravi/main/AGENTS.md with the operating identity and rules for the main assistant. Minimal bootstrap shape:
Register the agent:
For a trusted personal bootstrap, the main agent usually needs broad operator access:
For a customer or shared deployment, do not grant broad access by default. Start with the narrowest grants required for that agent’s job.

4. Create and Connect the Main Instance

Create the WhatsApp instance with conservative defaults:
Connect the account:
Scan the QR code from WhatsApp. Verify:

First DM Smoke Test

Send a WhatsApp DM to the connected account. Because dmPolicy is pairing, the sender should appear as pending:
Send another DM and verify the main agent responds.

5. Add a REBAC Audit Group

The REBAC audit group should be handled by a dedicated agent. Do not overload the main agent with permission audit work. Recommended convention:
  • group name: ravi - rebac
  • agent id: ravi-rebac
  • workspace: ~/ravi/ravi-rebac
Create the agent workspace:
Create ~/ravi/ravi-rebac/AGENTS.md:
Register it:

Permission Profile

Start with an observer profile:
If this audit agent must use ravi permissions list, grant, or revoke, it currently needs superadmin access because the permissions CLI group is protected as superadmin:
Only use that profile for a private, trusted operations group.

Route the Audit Group

In WhatsApp:
  1. Create the group.
  2. Add the connected Ravi account.
  3. Send a message in the group.
Then approve and route it:
The group id usually looks like:
Send a test message in the group and confirm ravi-rebac answers there.

6. Add Permission Audit Triggers

Important delivery rule: triggers capture their reply session and outbound source from the context that creates them. If you create a trigger from a plain shell with no chat context, the trigger can run but may not know which WhatsApp group should receive the report. Preferred setup:
  1. Route the audit group to ravi-rebac.
  2. Send a message in that group asking ravi-rebac to create its own triggers.
  3. The trigger creation command runs inside the audit group context, so future trigger reports return to that group.
Use these trigger definitions.

Permission Denials

Permission CLI Changes From Sessions

Permission CLI Changes From Shell

Unknown Instance Events

If you must create triggers from a shell, immediately test one and confirm where the report lands:
If the report does not appear in the audit group, create or repair it from the audit group context instead of assuming --account is enough. --account selects the channel account; it is not a chat destination.

7. Smoke Checks

Run the cross-checks before calling setup complete:
Check live logs while sending one DM and one group message:
Check recent events:
Expected outcomes:
  • Omni is connected.
  • Ravi daemon is running.
  • main instance is connected to WhatsApp.
  • DM policy is not accidentally open unless this is intentional.
  • Group policy is not accidentally open unless this is intentional.
  • Main DM replies work.
  • Audit group replies work.
  • Permission denial trigger fires to the audit group.
Once the first environment works, add these next:
  • A dev agent for Ravi core development.
  • A ravi-rebac audit agent for permission and route mapping.
  • A metrics observer agent for runtime KPIs.
  • A daily or hourly observer cron for system health.
  • A backup routine for ~/.ravi/ravi.db.
  • A documented list of connected Omni accounts and their owning agents.
  • A route inventory exported from:

9. Troubleshooting

Messages arrive but no agent responds

Check instance policy and pending entries:
If the chat is a group and groupPolicy=allowlist, it needs an explicit route:

A route exists but the wrong session replies

Routes select agents. Session subscriptions can keep an existing session attached to a chat. Inspect sessions and routes together before changing policies.

Trigger fires but does not post to WhatsApp

The trigger probably lacks a deliverable reply source. Recreate it from inside the audit group context after the group is routed and responding.

Permission check says allowed but Bash still fails

REBAC is one permission layer. Runtime hooks, workspace policies, or local provider rules can still block execution. Read the denial text before adding broader grants.

Omni is connected but Ravi cannot see channels

Verify Ravi can read Omni config or environment:

10. Bootstrap Completion Record

At the end of setup, record:
  • machine hostname;
  • Ravi source path;
  • Omni account names;
  • connected Ravi instance names;
  • main agent id and workspace;
  • audit agent id and workspace;
  • audit group id;
  • trigger ids;
  • permission profile chosen for each agent;
  • known intentional broad grants.
That record is the handoff artifact for the next operator.