Environment Variables
CodeCLI behavior can be configured through environment variables. These control authentication, feature flags, experimental features, permissions, network settings, and development options. Environment variables take precedence over configuration files.
CODECLI_ (for CLI-specific settings) or use standard names like API_BASE_URL for server endpoints.Core
Fundamental configuration variables that control the CLI behavior.
| Variable | Type | Default | Description |
|---|---|---|---|
| CODECLI_CONFIG | string | --- | Path to a specific codecli.json config file to load |
| CODECLI_CONFIG_DIR | string | ~/.config/codecli | Directory for configuration files, sessions, and cached data |
| CODECLI_CONFIG_CONTENT | string | --- | Inline JSON config content (overrides config file). Useful in CI/CD pipelines. |
| CODECLI_PERMISSION | string | ask | Default permission mode: ask, auto, deny. Controls how tool permissions are handled. |
| CODECLI_ADD_DIR | string | --- | Colon-separated list of directories to add to the workspace on startup |
| CODECLI_CLIENT | string | auto | HTTP client backend: auto, fetch, axios. Controls which HTTP library is used for API calls. |
Feature Flags
Disable specific features or default behaviors. All flags are boolean (set to 1 or true to enable).
| Variable | Default | Description |
|---|---|---|
| CODECLI_DISABLE_PROJECT_CONFIG | false | Do not read project-level .codecli/config.json or CLAUDE.md files |
| CODECLI_DISABLE_DEFAULT_PLUGINS | false | Do not load default plugins on startup. Only load explicitly configured plugins. |
| CODECLI_DISABLE_LSP_DOWNLOAD | false | Prevent automatic downloading of LSP servers for code intelligence features |
| CODECLI_DISABLE_AUTOCOMPACT | false | Disable automatic context compaction when the conversation exceeds the token limit |
| CODECLI_DISABLE_PRUNE | false | Disable automatic pruning of old sessions and cached data |
| CODECLI_DISABLE_MODELS_FETCH | false | Do not fetch the latest model list from the server on startup |
| CODECLI_DISABLE_CLAUDE_CODE | false | Disable the built-in Claude Code integration layer |
| CODECLI_DISABLE_EXTERNAL_SKILLS | false | Do not load external skills from the skill registry. Only use built-in skills. |
Experimental
These variables enable experimental features that may be unstable. Use with caution in production environments.
| Variable | Default | Description |
|---|---|---|
| CODECLI_EXPERIMENTAL | false | Master switch to enable all experimental features at once |
| CODECLI_EXPERIMENTAL_FILEWATCHER | false | Enable real-time file watching for automatic context updates |
| CODECLI_EXPERIMENTAL_LSP_TOOL | false | Enable the LSP tool for code intelligence (go-to-def, references, etc.) |
| CODECLI_EXPERIMENTAL_MARKDOWN | false | Enable markdown rendering in the TUI output panel |
| CODECLI_ENABLE_EXA | false | Enable Exa-powered enhanced web search with deeper result extraction |
| CODECLI_ENABLE_OFFICE | false | Enable Office document tools (docx, xlsx, pptx read/write) |
Permission
Variables that affect security and permission handling. These can bypass or modify the standard permission flow.
| Variable | Type | Default | Description |
|---|---|---|---|
| CODECLI_DANGEROUSLY_SKIP_PERMISSIONS | boolean | false | Skip all tool permission prompts. Tools execute immediately without confirmation. Use only in trusted environments. |
| CODECLI_BARE | boolean | false | Run in bare mode: no project config, no plugins, no default system prompt additions |
| CODECLI_APPEND_SYSTEM_PROMPT | string | --- | Append arbitrary text to the system prompt. Useful for adding project-specific instructions. |
| CODECLI_VAULT_PASSWORD | string | --- | Password for decrypting the secrets vault. Avoid setting this in shell configs -- prefer interactive entry. |
CODECLI_DANGEROUSLY_SKIP_PERMISSIONS bypasses all safety checks. Only use in fully trusted, isolated environments such as CI containers. Never set this on developer workstations.API and Network
Configure server endpoints and proxy settings.
| Variable | Type | Default | Description |
|---|---|---|---|
| API_BASE_URL | string | https://api.poly.inc | Base URL for the Polysystems API server |
| ACCOUNTS_BASE_URL | string | https://dev.poly.inc | Base URL for the Accounts dashboard (auth, billing) |
| CHAT_BASE_URL | string | https://chat.poly.inc | Base URL for the Chat / streaming API |
| POLY_BUILD | string | production | Build environment: production, staging, development. Affects API endpoints and logging. |
| HTTP_PROXY | string | --- | HTTP proxy URL for all HTTP requests (e.g. http://proxy.corp.com:8080) |
| HTTPS_PROXY | string | --- | HTTPS proxy URL for all HTTPS requests. Takes precedence over HTTP_PROXY for HTTPS calls. |
Development
Variables for developing and debugging codecli itself. Not intended for normal use.
| Variable | Type | Default | Description |
|---|---|---|---|
| CODECLI_DEV | boolean | false | Enable development mode with verbose logging, hot reload, and relaxed error handling |
| CODECLI_FAKE_VCS | boolean | false | Simulate VCS operations without a real git repository. For testing only. |
| CODECLI_MODELS_URL | string | --- | Override URL for fetching the model catalog |
| CODECLI_MODELS_PATH | string | --- | Path to a local JSON file to use as the model catalog (bypasses remote fetch) |
| CODECLI_FFI_LIB | string | --- | Path to a custom FFI native library. Used for testing alternative backends. |