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
| Variable | CLI Equivalent | Description |
|---|---|---|
| CCC_USERNAME | --username | Authentication username |
| CCC_PASSWORD | --password | Authentication password |
| CCC_NGROK_TOKEN | --ngrok-token | ngrok authentication token |
| CCC_NGROK_DOMAIN | --ngrok-domain | Static ngrok domain |
Usage Examples
Shell Configuration
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
~/.zshrc
Terminal
# 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
Terminal
# Set for a single command
CCC_USERNAME=admin CCC_PASSWORD=secret ccc.env File (Development)
Create a .env file in your project:
.env
Text
CCC_USERNAME=devuser
CCC_PASSWORD=devpassword
CCC_NGROK_TOKEN=abc123Security Warning
Never commit .env files with real credentials to version control. Add .env to your .gitignore.
Windows (PowerShell)
PowerShell
Terminal
# Set environment variable for session
$env:CCC_USERNAME = "myuser"
$env:CCC_PASSWORD = "mysecretpassword"
cccWindows (Command Prompt)
Command Prompt
Terminal
set CCC_USERNAME=myuser
set CCC_PASSWORD=mysecretpassword
ccc