CLI Overview
Learn about the Redenv CLI, its features, installation, and basic usage patterns.
The Redenv CLI is a command-line tool for managing encrypted secrets across environments. It handles the complete secret management lifecycle — from project creation to deployment.
Info
Zero-Knowledge by Design — All encryption happens on your machine. The CLI uses AES-256-GCM with PBKDF2 key derivation. Your Master Password never leaves your device.
Installation#
bash npm install -g @redenv/cli bash pnpm add -g @redenv/cli bash yarn global add @redenv/cli bash bun add -g @redenv/cli See the Installation Guide for detailed instructions and troubleshooting.
First-Time Setup#
Connect the CLI to your Upstash Redis instance:
redenv setupYou'll be prompted for your Upstash Redis REST URL and REST Token — both available in your Upstash Console. Credentials are stored securely in your system keychain.
Commands#
The CLI provides 20+ commands organized by function:
| Category | Commands |
|---|---|
| Setup & Projects | setup, register, switch, drop |
| Secrets | add, edit, view, list, remove |
| Import & Export | import, export, clone, diff, sync |
| History | history, rollback |
| Tokens | token |
| Backup | backup, restore |
| Utilities | shell, doctor, change-password, logout |
Quick Examples#
Create a project and add secrets:
redenv register my-app
redenv add API_KEY "sk_test_123"
redenv add DATABASE_URL "postgresql://localhost/myapp"
redenv listWork with multiple environments:
redenv switch env production
redenv add API_KEY "sk_live_xyz"
redenv diff development productionMigrate from .env file:
redenv register my-app
redenv import .envEnter interactive mode:
redenv shell
# Now run commands without 'redenv' prefix
> add API_KEY "value"
> list
> exitConfiguration#
Create a redenv.config.ts in your project root:
import { defineConfig } from "@redenv/core";
export default defineConfig({
name: "my-app",
environment: "development",
plugins: [],
});The CLI discovers configuration in this order:
redenv.config.tsin current directoryredenv.config.tsin parent directories- Global config from
redenv setup