Skip to main content

Getting Started with EnvFly CLI

This guide will walk you through installing EnvFly CLI and setting up your first project.

Prerequisites

Before you begin, make sure you have:
  • Node.js 14.0.0 or higher
  • npm or yarn package manager
  • Git (for Git storage provider)

Installation

npm install -g envfly-cli

Option 2: Install from source

git clone https://github.com/adarsh-technocrat/EnvFly-CLI.git
cd EnvFly-CLI
npm install
npm link

Verify Installation

envfly --version
You should see the current version of EnvFly CLI.

Quick Setup

1. Initialize EnvFly in Your Project

Navigate to your project directory and run:
envfly init
This will start an interactive setup process:
1

Project Name

Enter a name for your project (defaults to directory name)
2

Storage Provider

Choose where to store your environment variables: - Git Repository: Store encrypted files in your Git repo - AWS Secrets Manager: Use AWS for enterprise-grade storage - Azure Key Vault: Use Azure Key Vault - Google Secret Manager: Use Google Cloud - EnvFly Cloud Service: Use EnvFly’s hosted service
3

Configuration

Configure your chosen storage provider

2. Create Your First Environment

After initialization, create a .env.production file:
# .env.production
DATABASE_URL=postgresql://user:pass@prod-db:5432/mydb
API_KEY=your_production_api_key
REDIS_URL=redis://prod-redis:6379
NODE_ENV=production

3. Push to Storage

envfly push production
This will encrypt and store your environment variables securely.

4. Share with Your Team

If using EnvFly Cloud Service:
# Create a team
envfly team create "Development Team"

# Invite team members
envfly team invite alice@company.com developer
envfly team invite bob@company.com readonly

Basic Workflow

Here’s the typical workflow for using EnvFly CLI:

Common Commands

# List available environments
envfly list

# Push local environment to storage
envfly push production

# Pull environment from storage
envfly pull production

# Sync environment (merge local and remote)
envfly sync production

# View environment history
envfly history production

# View audit logs
envfly audit production

Storage Provider Setup

envfly init
# Choose: Git Repository
# Enter encryption key
# Set environment files path
Pros:
  • ✅ No external dependencies
  • ✅ Full version control
  • ✅ Works offline
  • ✅ Free
Cons:
  • ❌ Requires encryption key management
  • ❌ Limited team features
# First, authenticate
envfly login

# Then initialize
envfly init
# Choose: EnvFly Cloud Service
# Set up team access
Pros:
  • ✅ Built-in team management
  • ✅ Role-based access control
  • ✅ Audit logs
  • ✅ No key management
Cons:
  • ❌ Requires internet connection
  • ❌ May have usage limits

AWS Secrets Manager (Enterprise)

envfly init
# Choose: AWS Secrets Manager
# Configure AWS region and prefix
Requirements:
  • AWS credentials configured (aws configure)
  • Secrets Manager access permissions

Next Steps

Troubleshooting

Common Issues

Make sure you have Node.js 14+ installed and try: bash npm cache clean --force npm install -g envfly-cli
For EnvFly Cloud Service, make sure you’re logged in: ```bash envfly login
</Accordion>
<Accordion title="Storage provider connection fails">
Check your configuration and credentials: ```bash # For AWS aws configure #
For Azure az login # For Google Cloud gcloud auth application-default login

Getting Help