Documentation Index
Fetch the complete documentation index at: https://docs.cirron.com/llms.txt
Use this file to discover all available pages before exploring further.
cirron env
Manage environment variables for your Cirron project environments (development, staging, production, etc.). The env command provides secure management of environment-specific configuration through the Cirron API.
Subcommands
cirron env list — List environment variables
cirron env set — Set an environment variable
cirron env delete — Delete an environment variable
Usage
cirron env list [--env <environment>]
cirron env set <key> <value> [--env <environment>]
cirron env delete <key> [--env <environment>]
Options
| Option | Description | Default |
|---|
--env, -e | Target environment (development, staging, production, etc.) | production |
Subcommand Details
List Environment Variables
List all environment variables for a given environment. Sensitive values are automatically masked for security.
# List all environment variables for production
cirron env list --env production
# List environment variables for staging
cirron env list --env staging
# List environment variables for development
cirron env list --env development
Example Output
Environment Variables (production)
API_URL: https://app.cirron.com
DB_PASSWORD: ********
SECRET_KEY: ********
DATABASE_URL: postgresql://user:pass@localhost:5432/db
DEBUG: false
Empty Environment Output
No environment variables found for development
Set Environment Variable
Set or update an environment variable for a given environment.
# Set API URL for production
cirron env set API_URL https://app.cirron.com --env production
# Set database password for staging
cirron env set DB_PASSWORD mypassword123 --env staging
# Set debug flag for development
cirron env set DEBUG true --env development
Example Output
Set API_URL in production environment
Delete Environment Variable
Delete an environment variable from a given environment. Prompts for confirmation before deletion.
# Delete secret key from staging
cirron env delete SECRET_KEY --env staging
# Delete debug flag from development
cirron env delete DEBUG --env development
Confirmation Prompt
Delete SECRET_KEY from staging environment? (y/N)
Example Output
Deleted SECRET_KEY from staging environment
Security Features
Automatic Value Masking
Sensitive environment variables are automatically masked in output:
- Passwords: Any key containing “password” is masked
- Secrets: Any key containing “secret” is masked
- Keys: Any key containing “key” is masked
# These values will be masked in output
cirron env set DB_PASSWORD mypassword123
cirron env set API_SECRET_KEY abc123
cirron env set JWT_SECRET xyz789
# Output shows masked values
DB_PASSWORD: ********
API_SECRET_KEY: ********
JWT_SECRET: ********
Secure Storage
Environment variables are stored securely via the Cirron API:
- Encrypted transmission
- Secure storage on Cirron servers
- Access control per project and environment
Configuration Requirements
Project Configuration
The env command requires a valid cirron.yaml file in your project:
{
"name": "my-project",
"version": "1.0.0",
"environments": {
"development": {},
"staging": {},
"production": {}
}
}
Authentication
You must be authenticated to use the env command:
# Authenticate first
cirron auth login
# Then use env commands
cirron env list --env production
Examples
Development Workflow
# Set up development environment
cirron env set DEBUG true --env development
cirron env set API_URL http://localhost:3000 --env development
cirron env set DATABASE_URL postgresql://localhost/dev_db --env development
# List development variables
cirron env list --env development
Staging Environment
# Configure staging environment
cirron env set API_URL https://staging-app.cirron.com --env staging
cirron env set DEBUG false --env staging
cirron env set DATABASE_URL postgresql://staging-db --env staging
# Verify staging configuration
cirron env list --env staging
Production Environment
# Set production secrets
cirron env set API_URL https://app.cirron.com --env production
cirron env set SECRET_KEY production-secret-key --env production
cirron env set DATABASE_URL postgresql://prod-db --env production
# Audit production variables
cirron env list --env production
Error Handling
Common Errors
Missing Project Configuration
Error: No cirron.yaml found. Run cirron init to initialize a project
Solution: Initialize your project
Authentication Required
Error: Not authenticated. Run cirron auth login to authenticate
Solution: Authenticate with Cirron
API Errors
Error: Failed to fetch environment variables
Solutions:
# Check network connection
ping app.cirron.com
# Verify authentication
cirron auth status
# Check API configuration
cirron config --get apiUrl
Recovery Actions
-
Project Not Initialized
# Initialize project
cirron init my-project
# Then use env commands
cirron env list
-
Authentication Issues
# Login to Cirron
cirron auth login
# Verify authentication
cirron auth status
-
Configuration Issues
# Check configuration
cirron config --list
# Reset configuration if needed
cirron config --reset
Best Practices
Environment Organization
- Use Descriptive Names: Use clear, descriptive names for environments
- Separate Concerns: Keep development, staging, and production separate
- Consistent Naming: Use consistent naming conventions across environments
Security Best Practices
- Never Log Secrets: Sensitive values are automatically masked
- Use Strong Values: Use strong, unique values for secrets and keys
- Regular Audits: Regularly audit environment variables with
env list
- Remove Unused Variables: Clean up unused variables with
env delete
Workflow Integration
# Before deployment
cirron env list --env production
# After configuration changes
cirron env set NEW_VAR value --env staging
cirron env list --env staging
# Clean up old variables
cirron env delete OLD_VAR --env development
Integration
With Other Commands
Environment variables are used by other Cirron commands:
# Build uses environment variables
cirron build --env production
# Deploy uses environment variables
cirron deploy --env staging
# Status checks environment configuration
cirron status
CI/CD Integration
# GitHub Actions example
- name: Set Environment Variables
run: |
cirron env set API_URL ${{ secrets.API_URL }} --env production
cirron env set SECRET_KEY ${{ secrets.SECRET_KEY }} --env production
- name: Deploy
run: cirron deploy --env production
Troubleshooting
Debugging Issues
# Check project configuration
cat cirron.yaml
# Verify authentication
cirron auth status
# Test API connection
cirron config --get apiUrl
# List all environments
cirron env list --env production
Common Problems
- Network Issues: Check internet connection and firewall settings
- Authentication Expired: Re-authenticate with
cirron auth login
- Invalid Environment: Ensure environment name matches project configuration
- Permission Issues: Verify you have access to the project and environment
- cirron auth - Manage authentication
- cirron config - Manage CLI configuration
- cirron deploy - Deploy applications
- cirron status - Check system status