C
Docs

Environment Variables

Configure C3 using environment variables instead of command-line flags.

Overview

Environment variables provide an alternative to command-line flags for configuring C3. They're useful for:

  • Storing sensitive values like passwords securely
  • Setting up consistent configurations across sessions
  • Avoiding sensitive data in command history

Precedence

Environment variables take precedence over command-line flags. If both are set, the environment variable value is used.

Available Variables

VariableCLI EquivalentDescription
CCC_USERNAME--usernameAuthentication username
CCC_PASSWORD--passwordAuthentication password
CCC_NGROK_TOKEN--ngrok-tokenngrok authentication token
CCC_NGROK_DOMAIN--ngrok-domainStatic ngrok domain

Usage Examples

Shell Configuration

Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):

~/.zshrc
# C3 Configuration
export CCC_USERNAME="myuser"
export CCC_PASSWORD="mysecretpassword"
export CCC_NGROK_TOKEN="your_ngrok_token"
export CCC_NGROK_DOMAIN="myapp.ngrok-free.app"

One-Time Use

# Set for a single command
CCC_USERNAME=admin CCC_PASSWORD=secret ccc

.env File (Development)

Create a .env file in your project:

.env
CCC_USERNAME=devuser
CCC_PASSWORD=devpassword
CCC_NGROK_TOKEN=abc123

Security Warning

Never commit .env files with real credentials to version control. Add .env to your .gitignore.

Windows (PowerShell)

PowerShell
# Set environment variable for session
$env:CCC_USERNAME = "myuser"
$env:CCC_PASSWORD = "mysecretpassword"
ccc

Windows (Command Prompt)

Command Prompt
set CCC_USERNAME=myuser
set CCC_PASSWORD=mysecretpassword
ccc