Skip to content

feat: Support additional environment variables for Claude CLI configuration #24

Description

@lroolle

Summary

Add support for additional environment variables to enhance configuration flexibility and align with Claude CLI's official environment variable support.

Motivation

Currently, our Docker wrapper only handles basic authentication mounting but doesn't expose the full range of environment variables that Claude CLI supports. This limits configurability and forces users to work around missing environment controls.

Proposed Environment Variables

Configuration Management

  • CLAUDE_CONFIG_DIR - Override default config directory location
  • NODE_ENV - Environment detection for different behaviors
  • USER_TYPE - User classification controls
  • CI - CI environment detection for automation-friendly behavior

Authentication & API

  • ANTHROPIC_API_KEY_OVERRIDE - Override mechanism for API keys
  • ANTHROPIC_AUTH_TOKEN - Alternative authentication method
  • ANTHROPIC_BASE_URL - Custom endpoint configuration
  • ANTHROPIC_MODEL - Default model selection
  • API_TIMEOUT_MS - Request timeout configuration

Cloud Provider Integration

  • CLAUDE_CODE_USE_BEDROCK - AWS Bedrock toggle
  • CLAUDE_CODE_USE_VERTEX - Google Vertex AI toggle
  • CLOUD_ML_REGION - Cloud region specification
  • VERTEX_REGION_CLAUDE_ - Vertex region prefix

Feature Toggles

  • DISABLE_PROMPT_CACHING - Cache control
  • DISABLE_BINARY_FEEDBACK - Feedback system control
  • FORCE_BINARY_FEEDBACK - Force feedback mode
  • MAX_THINKING_TOKENS - Token limits
  • THINK_TOOL - Enable thinking tool
  • USE_BUILTIN_RIPGREP - Ripgrep preference
  • USE_STAGING_OAUTH - OAuth environment selection

Implementation

  1. Update claude.sh to pass through these environment variables to the Docker container
  2. Update Dockerfile to ensure environment is properly configured
  3. Add documentation to README about supported environment variables
  4. Add examples showing how to use environment-based configuration

Benefits

  • Better CI/CD integration with CI and NODE_ENV detection
  • Flexible config directory placement with CLAUDE_CONFIG_DIR
  • Enhanced cloud provider configuration
  • Fine-grained feature control
  • Improved timeout and caching controls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions