envfly init
Initialize EnvFly in your current project with storage provider selection.Usage
Description
Theinit
command sets up EnvFly in your current project directory. It creates a .envfly
configuration file and guides you through selecting a storage provider for your environment variables.
Interactive Setup
When you runenvfly init
, you’ll be prompted to configure:
1. Project Name
Enter a name for your project. This defaults to your current directory name.2. Storage Provider
Choose where to store your environment variables:3. Storage Provider Configuration
Depending on your choice, you’ll configure specific settings:Git Repository
AWS Secrets Manager
Azure Key Vault
Google Secret Manager
EnvFly Cloud Service
If you choose EnvFly Cloud Service, you’ll need to authenticate first:Generated Configuration
After initialization, a.envfly
file is created in your project root:
Sample Environment Files
If you choose to create sample environment files, the following files will be created:.env.production
.env.staging
.env.development
Options
Currently,envfly init
doesn’t accept any command-line options. All configuration is done through the interactive prompts.
Examples
Basic Initialization
With EnvFly Cloud Service
Error Handling
Already Initialized
If EnvFly is already initialized in the current directory:Authentication Required
If you choose EnvFly Cloud Service without being authenticated:Storage Provider Test Failure
If the storage provider connection test fails:Next Steps
After initialization, you can:- List environments:
envfly list
- Push environment:
envfly push production
- Pull environment:
envfly pull production
- Sync environment:
envfly sync production