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

What agents inherit

Agent runtimes (Claude Code, Codex, Pi and Grok), every command an agent runs, the runtime probe, shell triggers and every ravi jobs run job begin from an allowlisted copy of the daemon environment, not from the whole .env. There is no exception, not even for a job you start from your own terminal: the daemon cannot tell who asked for a job, so it never hands a job its own secrets. A job or a shell trigger that needs a secret gets it on purpose: by listing the variable in RAVI_AGENT_ENV_PASSTHROUGH (below) or, for a shell trigger, from its --env-file.
  • Passed: system and toolchain variables (PATH, HOME, LANG, proxies without credentials, SSH_AUTH_SOCK, PM2_HOME, IS_SANDBOX (set IS_SANDBOX=1 when Ravi runs as root; only 1 counts), GIT_*, NODE_* and similar), a fixed list of Ravi variables (state dir, gateway endpoint, logging, jobs, PM2), and each provider’s own config and login: CLAUDE_*/ANTHROPIC_* to Claude, CODEX_* to Codex, PI_* to Pi, GROK_* to Grok.
  • Not passed: other providers’ keys, RAVI_ADMIN_TOKEN, webhook secrets, third-party API keys, database URLs, git config injected through GIT_CONFIG_*, any name that looks like a secret (TOKEN, SECRET, PASSWORD, _KEY, _PAT, HEADERS) and any value that looks like a token.
To give agents a variable on purpose, list it in RAVI_AGENT_ENV_PASSTHROUGH and restart the daemon:
A provider’s own config still reaches only that provider, even when listed, and never a job or a shell trigger: names starting with CLAUDE_, ANTHROPIC_, CODEX_, PI_ or GROK_ belong to the agent runtime, so listing CLAUDE_CODE_OAUTH_TOKEN does not hand it to a job, while an unprefixed name such as DEVIN_API_KEY does reach it. Naming GIT_CONFIG_COUNT passes the whole GIT_CONFIG_* set. A shell trigger runs only when its owner is the operator, like a shell cron (TRIGGER_SHELL_NOT_OPERATOR). It is created and changed only from a request the daemon verifies: from your own chat with Ravi, not from a local ravi in the terminal. Only its owner changes it, turns it on or off. Its --env-file may not sit inside the Ravi state dir (TRIGGER_SHELL_ENV_FILE_IN_STATE_DIR), which holds the daemon’s own secrets, and must be a regular file (TRIGGER_SHELL_ENV_FILE_NOT_REGULAR, no FIFO, device or directory) with a single hard link (TRIGGER_SHELL_ENV_FILE_HARD_LINK). An env file over 1 MiB is refused (TRIGGER_SHELL_ENV_FILE_TOO_LARGE). It must also belong to the OS user Ravi runs as (TRIGGER_SHELL_ENV_FILE_NOT_OWNED), and its group and other users must not be able to write it (TRIGGER_SHELL_ENV_FILE_WRITABLE_BY_OTHERS; chmod 600 fixes it), because whoever can write an env file decides what the command runs. Shell crons follow the same owner and mode rule when their env file is loaded. An env file Ravi cannot check, because of a symlink loop or a path it may not search or read, is refused as well (TRIGGER_SHELL_ENV_FILE_UNVERIFIABLE). Known limit: on macOS an ACL entry (chmod +a "user:<name> allow write" <file>) gives another user write access without changing the mode bits, so the check does not see it. ls -le <file> shows ACLs and chmod -N <file> removes them. On Linux, a POSIX ACL that grants write shows in the group bits and is refused. The location rules are a path check when the trigger is saved and when it fires, not an access boundary: the file can change between the check and the read, and anything that runs as your OS user can still read the state dir.
Upgrading from a version before the agent env allowlist: Claude Code settings without a CLAUDE_ or ANTHROPIC_ prefix no longer reach agents. That includes DISABLE_TELEMETRY, DISABLE_AUTOUPDATER, DISABLE_ERROR_REPORTING, MAX_THINKING_TOKENS, BASH_DEFAULT_TIMEOUT_MS, BASH_MAX_TIMEOUT_MS, MCP_TIMEOUT and USE_BUILTIN_RIPGREP, and any other tool setting whose name is not on the list. If you set one in ~/.ravi/.env for your agents, add it to RAVI_AGENT_ENV_PASSTHROUGH.ravi jobs run now starts from the allowlisted environment, also when you run it from your terminal, and so does a shell trigger. A job that relied on a secret from ~/.ravi/.env gets it through RAVI_AGENT_ENV_PASSTHROUGH. A shell trigger created before this change with no owner is turned off on its next event, and you get one direct message about it; recreate it from your own chat with Ravi. A shell trigger whose --env-file points inside ~/.ravi (the daemon’s .env, for example), at a hard link, at anything that is not a regular file, at a file over 1 MiB, or at a path Ravi cannot check (a symlink loop, a file it may not read) is turned off on its next event, with one direct message to its owner (to you, when nobody owns it); give it a regular file of its own outside the state dir and turn it back on from your own chat with Ravi. A shell trigger or a shell cron whose --env-file belongs to another user, or that its group or others can write (0664, which a umask of 002 gives, for example), stops running: the trigger is turned off on its next event with one direct message to its owner, and each cron run fails with the reason. Run chmod go-w <file> (or chmod 600) and, for a trigger, turn it back on from your own chat with Ravi.

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 only the processes that were online before it ran, so ravi-channels is restarted only if the runner was already running; it warns when native channels are enabled and the runner is not online. To bring everything back after a reboot:
ravi daemon install saves the PM2 process list and suggests the startup command.