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 setup

You'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:

CategoryCommands
Setup & Projectssetup, register, switch, drop
Secretsadd, edit, view, list, remove
Import & Exportimport, export, clone, diff, sync
Historyhistory, rollback
Tokenstoken
Backupbackup, restore
Utilitiesshell, 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 list

Work with multiple environments:

redenv switch env production
redenv add API_KEY "sk_live_xyz"
redenv diff development production

Migrate from .env file:

redenv register my-app
redenv import .env

Enter interactive mode:

redenv shell
# Now run commands without 'redenv' prefix
> add API_KEY "value"
> list
> exit

Configuration#

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:

  1. redenv.config.ts in current directory
  2. redenv.config.ts in parent directories
  3. Global config from redenv setup