Environment Variables
Looplia uses environment variables for API keys, model configuration, and development settings.
API Keys
Section titled “API Keys”| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key for Claude | Yes* |
ZENMUX_API_KEY | ZenMux proxy API key | Yes* |
CLAUDE_CODE_OAUTH_TOKEN | Claude Code OAuth token (alternative auth) | No |
Setting API Keys
Section titled “Setting API Keys”# Option 1: Export in current sessionexport ANTHROPIC_API_KEY=sk-ant-api03-...
# Option 2: Add to shell profile (~/.zshrc or ~/.bashrc)echo 'export ANTHROPIC_API_KEY=sk-ant-api03-...' >> ~/.zshrcsource ~/.zshrc
# Option 3: Use .env file (for development)echo 'ANTHROPIC_API_KEY=sk-ant-api03-...' >> .envenv $(cat .env) looplia run writing-kit --file test.mdModel Configuration
Section titled “Model Configuration”| Variable | Description | Default |
|---|---|---|
LOOPLIA_AGENT_MODEL_MAIN | Override main agent model | Provider default |
LOOPLIA_AGENT_MODEL_EXECUTOR | Override skill executor model | Provider default |
Model Override Examples
Section titled “Model Override Examples”# Use Opus for main agentexport LOOPLIA_AGENT_MODEL_MAIN=claude-opus-4-20250514
# Use Haiku for executor (faster, cheaper)export LOOPLIA_AGENT_MODEL_EXECUTOR=claude-haiku-4-20250514
# Run workflowlooplia run writing-kit --file article.mdDevelopment Mode
Section titled “Development Mode”| Variable | Description | Default |
|---|---|---|
LOOPLIA_DEV | Enable development mode | false |
LOOPLIA_DEV_ROOT | Path to looplia-core source repository | - |
LOOPLIA_DEBUG | Enable debug logging | false |
Development Mode
Section titled “Development Mode”When developing Looplia from source, use dev mode to load plugins directly without running init:
# Enable dev modeexport LOOPLIA_DEV=trueexport LOOPLIA_DEV_ROOT=~/projects/looplia-core
# Run from any directory - plugins loaded from sourcecd ~/my-contentlooplia run writing-kit --file article.mdIn dev mode:
- Plugins are loaded from
$LOOPLIA_DEV_ROOT/plugins/ - Changes to plugin files take effect immediately
- No need to run
looplia initafter changes
Debug Logging
Section titled “Debug Logging”# Enable debug outputexport LOOPLIA_DEBUG=1
# Run with verbose logginglooplia run writing-kit --file test.mdDebug logs are written to ~/.looplia/logs/.
Provider Configuration
Section titled “Provider Configuration”These variables work with the provider system:
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Used when provider is anthropic |
ZENMUX_API_KEY | Used when provider is zenmux (auto-mapped to ANTHROPIC_API_KEY for SDK) |
Auto-Mapping
Section titled “Auto-Mapping”When using ZenMux, Looplia automatically maps credentials:
# Set ZenMux keyexport ZENMUX_API_KEY=sk-zenmux-...
# Configure ZenMux providerlooplia config provider preset ZENMUX_ZAI_GLM47
# The ZENMUX_API_KEY is automatically usedlooplia run writing-kit --file article.mdPriority Order
Section titled “Priority Order”Environment variables take precedence over config file settings:
- Environment variables (highest priority)
- Config file (
~/.looplia/looplia.setting.json) - Default values (lowest priority)
# This overrides any config file settingexport LOOPLIA_AGENT_MODEL_MAIN=claude-opus-4-20250514looplia run writing-kit --file article.mdCI/CD Integration
Section titled “CI/CD Integration”For CI/CD pipelines, set variables in your pipeline configuration:
GitHub Actions
Section titled “GitHub Actions”jobs: process: runs-on: ubuntu-latest env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 - run: bunx looplia init --yes - run: bunx looplia run writing-kit --file content.md --no-streamingDocker
Section titled “Docker”FROM oven/bun:latestENV ANTHROPIC_API_KEY=""RUN bunx looplia init --yesCMD ["bunx", "looplia", "run", "writing-kit", "--file", "/data/content.md"]docker run -e ANTHROPIC_API_KEY=sk-ant-... -v ./content:/data my-loopliaAll Variables Reference
Section titled “All Variables Reference”| Variable | Type | Description |
|---|---|---|
ANTHROPIC_API_KEY | string | Anthropic API key |
ZENMUX_API_KEY | string | ZenMux proxy API key |
CLAUDE_CODE_OAUTH_TOKEN | string | OAuth token authentication |
LOOPLIA_AGENT_MODEL_MAIN | string | Main agent model override |
LOOPLIA_AGENT_MODEL_EXECUTOR | string | Executor model override |
LOOPLIA_DEV | boolean | Enable development mode |
LOOPLIA_DEV_ROOT | path | Development source path |
LOOPLIA_DEBUG | boolean | Enable debug logging |
See Also
Section titled “See Also”- Installation — Initial setup
- config Command — Configure via CLI
- Troubleshooting — Common issues