envfly list

List all environments and their variables in your EnvFly project.

Usage

envfly list [options]

Description

The list command displays all environments in your project along with their variables. This is useful for:
  • Overview: Get a quick overview of all environments
  • Audit: Review what variables are stored in each environment
  • Debugging: Check if variables are properly stored
  • Documentation: Generate documentation of your environment structure

Options

Examples

Basic List

$ envfly list
┌─────────────┬─────────────┬─────────────┬─────────────────────┐
 Environment Variable Type Last Updated
├─────────────┼─────────────┼─────────────┼─────────────────────┤
 development DATABASE_URL│ string 2024-01-15 10:30:00
 development API_KEY string 2024-01-15 10:30:00
 development DEBUG boolean 2024-01-15 10:30:00
 production DATABASE_URL│ string 2024-01-15 09:15:00
 production API_KEY string 2024-01-15 09:15:00
 staging DATABASE_URL│ string 2024-01-15 08:45:00
 staging API_KEY string 2024-01-15 08:45:00
└─────────────┴─────────────┴─────────────┴─────────────────────┘

List Specific Environment

$ envfly list --environment production
┌─────────────┬─────────────┬─────────────┬─────────────────────┐
 Environment Variable Type Last Updated
├─────────────┼─────────────┼─────────────┼─────────────────────┤
 production DATABASE_URL│ string 2024-01-15 09:15:00
 production API_KEY string 2024-01-15 09:15:00
 production LOG_LEVEL string 2024-01-15 09:15:00
└─────────────┴─────────────┴─────────────┴─────────────────────┘

JSON Output

$ envfly list --format json
{
  "environments": {
    "development": {
      "variables": {
        "DATABASE_URL": {
          "type": "string",
          "updated": "2024-01-15T10:30:00Z",
          "encrypted": true
        },
        "API_KEY": {
          "type": "string",
          "updated": "2024-01-15T10:30:00Z",
          "encrypted": true
        }
      }
    },
    "production": {
      "variables": {
        "DATABASE_URL": {
          "type": "string",
          "updated": "2024-01-15T09:15:00Z",
          "encrypted": true
        },
        "API_KEY": {
          "type": "string",
          "updated": "2024-01-15T09:15:00Z",
          "encrypted": true
        }
      }
    }
  }
}

Filter Variables

$ envfly list --filter "DB_*"
┌─────────────┬─────────────┬─────────────┬─────────────────────┐
 Environment Variable Type Last Updated
├─────────────┼─────────────┼─────────────┼─────────────────────┤
 development DB_HOST string 2024-01-15 10:30:00
 development DB_PORT number 2024-01-15 10:30:00
 development DB_NAME string 2024-01-15 10:30:00
 production DB_HOST string 2024-01-15 09:15:00
 production DB_PORT number 2024-01-15 09:15:00
 production DB_NAME string 2024-01-15 09:15:00
└─────────────┴─────────────┴─────────────┴─────────────────────┘

Show Values (Use with Caution)

$ envfly list --show-values --environment development
┌─────────────┬─────────────┬─────────────┬─────────────────────┬─────────────────────┐
 Environment Variable Type Last Updated Value
├─────────────┼─────────────┼─────────────┼─────────────────────┼─────────────────────┤
 development DATABASE_URL│ string 2024-01-15 10:30:00 postgresql://lo...
 development API_KEY string 2024-01-15 10:30:00 dev_key_123
 development DEBUG boolean 2024-01-15 10:30:00 true
└─────────────┴─────────────┴─────────────┴─────────────────────┴─────────────────────┘

Use Cases

Integration Examples

CI/CD Pipeline

# .github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: List Production Variables
        run: |
          envfly list --environment production --format json > env-audit.json

      - name: Deploy with Variables
        run: |
          envfly pull production
          npm run deploy

Scripting

#!/bin/bash
# audit-environments.sh

echo "=== Environment Audit Report ==="
echo "Generated: $(date)"
echo

# List all environments
echo "All Environments:"
envfly list --format table

echo

# Check for sensitive variables
echo "Sensitive Variables Check:"
envfly list --filter "*KEY*" --filter "*SECRET*" --filter "*PASSWORD*"

echo

# Generate JSON report
envfly list --format json > env-audit-$(date +%Y%m%d).json
echo "JSON report saved to env-audit-$(date +%Y%m%d).json"

Team Collaboration

# Team lead reviewing environments
envfly list --sort updated

# Developer checking their environment
envfly list --environment development --show-values

# DevOps engineer auditing production
envfly list --environment production --format json | jq '.environments.production.variables | keys'

Error Handling

Best Practices