Commands
Environment Configuration
Configure environment variables and API keys for ElizaOS projects
Environment Command
Manage environment variables and secrets.
Usage
Subcommands
Subcommand | Description | Options |
---|---|---|
list | List all environment variables | --system , --local |
edit-local | Edit local environment variables | -y, --yes |
reset | Reset environment variables and clean up database/cache files (interactive selection) | -y, --yes |
interactive | Interactive environment variable management | -y, --yes |
Options
List Command Options
Option | Description |
---|---|
--system | List only system information |
--local | List only local environment variables |
General Options
Option | Description |
---|---|
-y, --yes | Automatically confirm prompts |
Usage
Subcommands
Subcommand | Description | Options |
---|---|---|
list | List all environment variables | --system , --local |
edit-local | Edit local environment variables | -y, --yes |
reset | Reset environment variables and clean up database/cache files (interactive selection) | -y, --yes |
interactive | Interactive environment variable management | -y, --yes |
Options
List Command Options
Option | Description |
---|---|
--system | List only system information |
--local | List only local environment variables |
General Options
Option | Description |
---|---|
-y, --yes | Automatically confirm prompts |
Viewing Environment Variables
Managing Local Environment Variables
Interactive Management
Resetting Environment and Data
Example list
output:
edit-local
Details
The edit-local
command allows you to:
- View existing local variables
- Add new variables
- Edit existing variables
- Delete variables
Note: The --yes
flag displays current variables and exits without interactive editing, since variable modification requires user input.
interactive
Details
Interactive mode provides a menu with options to:
- List environment variables
- Edit local environment variables
- Reset environment variables
Note: The --yes
flag is ignored in interactive mode since it requires user input by design.
reset
Details
The reset command allows you to selectively reset:
- Local environment variables - Clears values in local
.env
file while preserving keys - Cache folder - Deletes the cache folder (
~/.eliza/cache
) - Local database files - Deletes local database files (PGLite data directory)
Environment File Structure
ElizaOS uses local environment variables stored in .env
files in your project directory:
- Local variables - Stored in
./.env
in your current project directory
Missing .env File Handling
If no local .env
file exists:
- Commands will detect this and offer to create one
- The
list
command will show helpful guidance - The
edit-local
command will prompt to create a new file
Common Environment Variables
Variable | Description |
---|---|
OPENAI_API_KEY | OpenAI API key for model access |
ANTHROPIC_API_KEY | Anthropic API key for Claude models |
TELEGRAM_BOT_TOKEN | Token for Telegram bot integration |
DISCORD_BOT_TOKEN | Token for Discord bot integration |
POSTGRES_URL | PostgreSQL database connection string |
SQLITE_DATA_DIR | Directory for PGLite database files |
MODEL_PROVIDER | Default model provider to use |
LOG_LEVEL | Logging verbosity (debug, info, warn, error) |
LOG_TIMESTAMPS | Show timestamps in logs (default: true) |
PORT | HTTP API port number |
Database Configuration Detection
The reset command intelligently detects your database configuration:
- External PostgreSQL - Warns that only local files will be removed
- PGLite - Ensures the correct local database directories are removed
- Missing configuration - Skips database-related reset operations
Security Features
- Value masking - Sensitive values (API keys, tokens) are automatically masked in output
- Local-only storage - Environment variables are stored locally in your project
- No global secrets - Prevents accidental exposure across projects