Environment Variables

Complete reference of all environment variables used to configure the Chvor server, LLM providers, and channels.

4 min read

Environment Variables

Chvor is configured primarily through environment variables. Set them in a .env file at the project root, pass them to Docker with -e or env_file, or export them in your shell.


LLM Provider Keys

At least one provider key is required for Chvor to function.

VariableRequiredDescriptionDefault
ANTHROPIC_API_KEYOne of threeAPI key for Anthropic (Claude models). Starts with sk-ant-.
OPENAI_API_KEYOne of threeAPI key for OpenAI (GPT models). Starts with sk-.
GOOGLE_API_KEYOne of threeAPI key for Google AI (Gemini models). Starts with AI.

You can set multiple provider keys simultaneously. Skills can specify which provider to use via the model.provider field. If a skill does not specify a provider, Chvor uses the first available key in this order: Anthropic, OpenAI, Google.


Server Configuration

VariableRequiredDescriptionDefault
CHVOR_TOKENNoAccess token that protects the web UI and API. When set, all requests must include this token in the Authorization header (Bearer <token>).— (no auth)
NODE_ENVNoSet to production for production builds. Disables dev-mode features like hot reload and verbose logging.development
PORTNoPort the Chvor server listens on.3001
CHVOR_DATA_DIRNoDirectory where Chvor stores its database, skills, config, and uploads.~/.chvor
LOG_LEVELNoLogging verbosity. One of: debug, info, warn, error.info

Example: Custom data directory

CHVOR_DATA_DIR=/var/lib/chvor

This is useful when running as a system service where the home directory may not be writable.


Channel Tokens

Each channel is activated by setting its corresponding token. If a token is not set, that channel is not started.

VariableRequiredDescriptionDefault
TELEGRAM_BOT_TOKENNoTelegram bot token from @BotFather. Format: 1234567890:AAH....— (channel disabled)
DISCORD_BOT_TOKENNoDiscord bot token from the Developer Portal. Format: MTIz....— (channel disabled)
SLACK_BOT_TOKENNoSlack Bot User OAuth Token. Starts with xoxb-.— (channel disabled)
SLACK_APP_TOKENNoSlack App-Level Token for Socket Mode. Starts with xapp-. Required alongside SLACK_BOT_TOKEN.— (channel disabled)

Note: Slack requires both SLACK_BOT_TOKEN and SLACK_APP_TOKEN to be set. If only one is provided, the Slack channel will not start and the server logs an error.


All Variables at a Glance

# === LLM Providers (at least one required) ===
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
GOOGLE_API_KEY=AI...

# === Server ===
CHVOR_TOKEN=your-secret-token
NODE_ENV=production
PORT=3001
CHVOR_DATA_DIR=~/.chvor
LOG_LEVEL=info

# === Channels (all optional) ===
TELEGRAM_BOT_TOKEN=1234567890:AAH...
DISCORD_BOT_TOKEN=MTIz...
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...

Setting Variables

.env file (development)

Create a .env file in the project root:

ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx
CHVOR_TOKEN=my-dev-token

Chvor loads this file automatically on startup. The .env file is listed in .gitignore — it should never be committed to version control.

Shell export

export ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx
export CHVOR_TOKEN=my-dev-token
pnpm dev

Docker

Inline:

docker run -e ANTHROPIC_API_KEY=sk-ant-... ghcr.io/luka-zivkovic/chvor:latest

From a file:

docker run --env-file .env ghcr.io/luka-zivkovic/chvor:latest

systemd

Reference an environment file in your service unit:

[Service]
EnvironmentFile=/home/chvor/chvor/.env

Security Considerations

  • Never commit API keys to version control. The .env file should be in .gitignore.

  • Use CHVOR_TOKEN in production. Without it, anyone who can reach your server can use your LLM API keys.

  • Restrict file permissions on your .env file:

    chmod 600 .env
  • Rotate keys regularly. If a key is compromised, revoke it immediately in the provider’s dashboard and generate a new one.

  • Docker secrets are not yet supported natively but you can mount secrets files as volumes and source them in a custom entrypoint.


Next Steps