Go to file
naudachu e10b389661 init 2026-01-28 16:24:21 +05:00
.docs init 2026-01-28 16:24:21 +05:00
cmd/aevs init 2026-01-28 16:24:21 +05:00
internal init 2026-01-28 16:24:21 +05:00
.gitignore init 2026-01-28 16:24:21 +05:00
Makefile init 2026-01-28 16:24:21 +05:00
README.md init 2026-01-28 16:24:21 +05:00
go.mod init 2026-01-28 16:24:21 +05:00
go.sum init 2026-01-28 16:24:21 +05:00

README.md

AEVS - Environment Variables Sync

A CLI tool for syncing .env files between machines using S3-compatible storage.

Features

  • 🔄 Sync .env files across multiple development machines
  • ☁️ Works with S3-compatible storage (AWS S3, MinIO, Cloudflare R2, DigitalOcean Spaces)
  • 🔒 Secure storage with proper permissions (files stored with 0600)
  • 📦 Automatic tar.gz compression
  • Fast and efficient
  • 🎯 Simple workflow

Installation

From Source

git clone https://github.com/user/aevs.git
cd aevs
make build
make install

Or using Go:

go install github.com/user/aevs/cmd/aevs@latest

Quick Start

1. Configure Storage (one-time setup per machine)

aevs config

You'll be prompted for:

  • Storage type (s3)
  • S3 endpoint
  • AWS region
  • Bucket name
  • Access key ID
  • Secret access key

2. Initialize a Project

cd your-project
aevs init

This will:

  • Scan for .env files in your project
  • Create aevs.yaml configuration
  • List all found env files

3. Push Files to Storage

aevs push

4. Pull Files on Another Machine

# First, configure storage on the new machine
aevs config

# Then pull your project
aevs pull my-project

# Or if you already have aevs.yaml:
aevs pull

Commands

aevs config

Configure S3-compatible storage credentials.

aevs config

Configuration is stored in ~/.config/aevs/config.yaml with secure permissions (0600).

aevs init [project-name]

Initialize project in current directory.

# Auto-detect project name from directory
aevs init

# Specify project name
aevs init my-project

# Overwrite existing config
aevs init --force

Creates aevs.yaml with list of found .env files.

aevs push

Upload .env files to storage.

# Push current project
aevs push

# Dry run (see what would be uploaded)
aevs push --dry-run

# Use custom config path
aevs push --config path/to/aevs.yaml

aevs pull [project-name]

Download .env files from storage.

# Pull using local aevs.yaml
aevs pull

# Pull specific project
aevs pull my-project

# Overwrite all files without confirmation
aevs pull --force

# Dry run
aevs pull --dry-run

Conflict resolution:

  • o - overwrite this file
  • s - skip this file
  • d - show diff
  • O - overwrite all files
  • S - skip all files

aevs list

List all projects in storage.

# Table output
aevs list

# JSON output
aevs list --json

aevs status

Show sync status of current project.

aevs status

Shows:

  • Files up to date
  • Files modified locally
  • Files modified remotely
  • Missing files
  • New files

Configuration

Global Config (~/.config/aevs/config.yaml)

storage:
  type: s3
  endpoint: https://s3.amazonaws.com
  region: us-east-1
  bucket: my-envs-bucket
  access_key: AKIA...
  secret_key: ****

Project Config (aevs.yaml)

project: my-project
files:
  - .env
  - .env.production
  - .env.development
  - docker/.env

File Scanning

Included Patterns

  • .env - exact match
  • .env.* - e.g., .env.production, .env.local
  • *.env - e.g., docker.env, app.env

Excluded Directories

  • node_modules/, .git/, vendor/
  • venv/, .venv/, __pycache__/
  • .idea/, .vscode/
  • dist/, build/

Excluded Files

  • .env.example
  • .env.sample
  • .env.template

Storage Providers

AWS S3

aevs config
# Endpoint: https://s3.amazonaws.com
# Region: us-east-1 (or your preferred region)

MinIO

aevs config
# Endpoint: https://minio.yourdomain.com:9000
# Region: (leave empty or use default)

Cloudflare R2

aevs config
# Endpoint: https://[account-id].r2.cloudflarestorage.com
# Region: auto

DigitalOcean Spaces

aevs config
# Endpoint: https://[region].digitaloceanspaces.com
# Region: [region] (e.g., nyc3)

Security

  • Configuration files are stored with 0600 permissions (owner read/write only)
  • .env files are never committed to version control
  • All data is transmitted over HTTPS
  • Consider enabling S3 versioning for backup/recovery

Error Handling

Exit codes:

  • 0 - Success
  • 1 - General error
  • 2 - Configuration error
  • 3 - File system error
  • 4 - Storage error
  • 5 - Network error
  • 130 - Interrupted (Ctrl+C)

Development

Build

make build

Run Tests

make test

Clean

make clean

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.