Docs
Developer Cheatsheet
Complete step-by-step cheatsheet from web setup to CLI, SDK, and CI/CD integration.
Architecture at a Glance
Organization (e.g., Acme Corp)
└── Project (e.g., my-api, web-dashboard)
└── Environments (development, staging, production)
└── Encrypted Secrets (DATABASE_URL, STRIPE_KEY, etc.)
1. Web Console Setup (2 Minutes)
- Sign Up / Log In: Navigate to your Eanvi web console and log in.
- Create Organization: Create your workspace (e.g.,
acme-corp). - Create Project: Click Projects → New Project (e.g. slug:
backend-api). - Select Environment: Default environments (
development,staging,production) are ready. - Add Secrets:
- Manually: Click Add Secret (e.g.,
DATABASE_URL=postgres://...). - Bulk: Click Import and drag-and-drop your existing
.envfile.
- Manually: Click Add Secret (e.g.,
- Generate API Key (for CLI & CI/CD):
- Go to Settings → API Keys → Create Key.
- Copy the key (
eanvi_live_...oreanvi_sk_...).
2. CLI Setup & Project Linking
Step 2.1: Install CLI
# Global install (recommended)
npm install -g @eanvi/cli
# Verify installation
eanvi --version
Step 2.2: Authenticate
# Interactive login (browser / email / token)
eanvi login
# Or non-interactive login via API Key (for CI/CD or scripts)
eanvi login --api-key <YOUR_API_KEY>
Step 2.3: Link Your Local Project
Run this in the root directory of your codebase:
# Interactive selection
eanvi init
# Or one-liner specification
eanvi init --project backend-api --environment development --env-file .env
This creates a
.eanvi/config.jsonlinking your directory to Eanvi.
3. Daily Developer Workflows
Pull Secrets (Remote → Local .env)
# Pull into configured .env file
eanvi pull
# Pull for a specific environment (e.g. production)
eanvi pull --environment production --output .env.production
# Hard reset local keys to match remote exactly
eanvi pull --force
Push Secrets (Local .env → Remote)
# Push local .env changes to remote
eanvi push
# Preview changes before pushing
eanvi push --dry-run
# Push and delete remote keys that are missing locally
eanvi push --delete-missing
Compare Local & Remote Differences
# View diff between local .env and remote vault
eanvi diff
Bidirectional Sync (Merge & Resolve Conflicts)
eanvi sync
# Auto-accept non-conflicting changes
eanvi sync --yes
Inspect Secrets
# List all keys with masked values
eanvi list
# Reveal secret values in terminal
eanvi list --reveal
Diagnostics & Account Check
# Verify connection, auth, and local configuration
eanvi doctor
# Check active user and organization
eanvi whoami
4. Using the TypeScript SDK (Runtime Access)
If your application needs to fetch secrets dynamically at runtime:
Step 4.1: Install SDK
npm install @eanvi/sdk
Step 4.2: Fetch Secrets in Code
import { createClient } from '@eanvi/sdk';
const eanvi = createClient({
apiKey: process.env.EANVI_API_KEY, // Set in hosting provider or runtime env
});
async function loadConfig() {
// 1. Fetch all secrets as a key-value map for an environment
const config = await eanvi.cli.pull({
project: 'backend-api',
environment: process.env.NODE_ENV || 'development',
});
console.log('Database URL:', config.secrets['DATABASE_URL']);
return config.secrets;
}
// 2. Fetch individual secret details
const secret = await eanvi.secrets.get('secret_id');
const decrypted = await eanvi.secrets.reveal('secret_id');
console.log('Decrypted Secret:', decrypted.value);
5. CI/CD & Production Integration
GitHub Actions Workflow Example
Store EANVI_API_KEY in GitHub Repo Secrets (Settings → Secrets and variables → Actions).
name: Deploy Application
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Eanvi CLI
run: npm install -g @eanvi/cli
- name: Pull Production Secrets
env:
EANVI_API_KEY: ${{ secrets.EANVI_API_KEY }}
run: |
eanvi pull \
--project backend-api \
--environment production \
--output .env.production
- name: Build Application
run: npm run build
Docker Container Example
FROM node:20-alpine AS builder
WORKDIR /app
# Copy files
COPY package*.json ./
RUN npm install
# Install Eanvi CLI
RUN npm install -g @eanvi/cli
COPY . .
# Pass build-time API Key argument
ARG EANVI_API_KEY
RUN eanvi pull --project backend-api --environment production --output .env
RUN npm run build
CMD ["npm", "start"]
6. Command Quick Reference
| Action | Command |
|---|---|
| Authenticate | eanvi login or eanvi login --api-key <key> |
| Check Session | eanvi whoami |
| Link Project | eanvi init -p <project-slug> -e <env-slug> |
Pull to .env | eanvi pull |
| Pull Production | eanvi pull -e production -o .env.production |
Push .env to Cloud | eanvi push |
| Preview Push | eanvi push --dry-run |
| Diff Local vs Cloud | eanvi diff |
| Two-way Sync | eanvi sync -y |
| List Secrets | eanvi list (or eanvi list --reveal) |
| Import from File | eanvi import ./secrets.json --format json |
| Export to File | eanvi export --format yaml --output secrets.yaml |
| Troubleshoot | eanvi doctor |
| Logout | eanvi logout |
7. Security Best Practices & Git Rules
- Always Gitignore Secret Files:
Add this to your project's
.gitignore:# Eanvi local state and downloaded secret files .env .env.* !.env.example .eanvi/secrets-state.json - Commit Project Link Configuration:
You should commit
.eanvi/config.jsonso all team members automatically link to the correct project & environment. - Use Scoped API Keys: Use read-only or environment-specific keys for CI/CD runners.
- Audit Logs: Track who accessed or revealed any secret in Organization Settings → Audit Logs.