Skip to main content
By the end of this page you will know which file or command controls each part of Ravi, which ~/.ravi/.env variables the code actually reads, how to change settings and agent properties, and where Ravi keeps its data and processes.

Where configuration lives

Changes made with ravi agents, ravi instances and ravi settings apply to the running daemon without a restart. Changes to .env, and to a Slack channel’s credentials or defaults, need a restart of the process that reads them.

The .env file

How it is loaded

The daemon and the CLI both read ~/.ravi/.env, but not the same way:
  • The daemon (ravi under PM2) loads the file at start and overrides any value already in its environment. The file wins.
  • The CLI (ravi in your shell) loads the file but only fills keys that are not already set. A variable exported in your shell wins over the file.
  • The channel runner (ravi-channels) runs the CLI, so it reads the file the CLI way. It also inherits the environment of the shell that ran ravi channels start or ravi channels restart, so a variable exported in that shell wins over the file.
Apply a change with:
To edit the file:
To set a provider credential without an editor or TTY, use the allowlisted writer. It writes atomically with mode 0600 and never prints the value:
ravi runtime env set accepts only CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CODEX_HOME, GROK_HOME and GROK_DISABLE_AUTOUPDATER.
RAVI_STATE_DIR moves Ravi’s databases and state, and ravi runtime env set then writes to $RAVI_STATE_DIR/.env. The daemon and the CLI still read ~/.ravi/.env. If you set RAVI_STATE_DIR, edit ~/.ravi/.env directly so the daemon sees your change.
Slack tokens never come from .env. The Slack runner reads them only from the credential broker. See Slack.

Model providers

The Codex provider always runs codex from PATH.

Infrastructure

HTTP gateway and SDK

The HTTP server is off unless RAVI_HTTP_PORT is set. See SDKs and HTTP gateway. Boolean variables accept 1, true or yes. The gateway never answers with Access-Control-Allow-Origin: *; chrome-extension:// origins are always allowed.

Media

The image provider is chosen by, in order: the command flag, the agent’s image_provider default, the instance’s default, the image.provider setting, then RAVI_IMAGE_PROVIDER. See Media.

Slack runner

These are read by the ravi-channels runner. Apply them with ravi channels restart. A Slack channel’s own defaults win over these variables, per channel:
defaults takes the whole JSON object; pass every key you want to keep.
ravi channels restart keeps the previous value of RAVI_SLACK_SUBSCRIPTION_SCOPE, RAVI_SLACK_THREAD_REPLY_MODE, RAVI_SLACK_ROOT_REPLY_MODE and RAVI_SLACK_WORKING_REACTION when your shell no longer sets them. To drop a value, remove it, then run ravi channels stop and ravi channels start.

Credentials and sandbox

Not used

Older docs list OMNI_DIR, DATABASE_URL, OMNI_API_PORT and NATS_PORT. Ravi does not read them. Omni’s database and ports are Omni’s configuration; Ravi reaches NATS through NATS_URL.

Global settings

Settings live in ravi.db and apply immediately.
ravi settings list also shows runtime.model_broker.required, the superadmin-only permissions.* keys and tasks.sessionTtl.knowledgeEngineer.
whatsapp.dmPolicy and whatsapp.groupPolicy are listed and written by ravi setup, but nothing reads them at runtime. Set policies on the instance instead:
See Routing.

Agent properties

When you change provider, model or modelPreset, sessions without their own override switch on their next turn. Sessions pinned with ravi sessions set-provider or ravi sessions set-model keep their pin; add --force to clear those pins too.

DM scopes

The DM scope decides which direct messages share a session. Groups always get their own session, agent:main:<channel>:<account>:group:<id>, with :thread:<id> added for threads. The scope is chosen by: the matching route’s dmScope, then the agent’s dmScope, then the defaultDmScope setting.
ravi instances set <name> dmScope <scope> is accepted and stored, but routing does not use it. Set the scope on the route or the agent.

Files on disk

Ravi’s logs are PM2’s logs:

PM2 processes

If you run NATS yourself instead of through Omni, it is your own PM2 process (for example nats). See Install. ravi daemon start starts only ravi. ravi daemon status shows ravi, omni-nats and omni-api; check the runner with ravi channels status or pm2 ls. ravi update restarts both ravi and ravi-channels. To bring everything back after a reboot:
ravi daemon install saves the PM2 process list and suggests the startup command.