clone
Clone environment variables from one environment to another.
The clone command copies secrets from a source environment to a destination environment.
Usage#
redenv clone [key]Arguments#
| Name | Required | Description |
|---|---|---|
key | No | Clone only a specific key (all if omitted) |
Options#
| Flag | Description |
|---|---|
-f, --from <env> | Source environment |
-t, --to <env> | Destination environment |
-p, --project <name> | Project name |
--skip-config | Ignore local project config |
Examples#
# Clone interactively
redenv clone
# Clone from production to staging
redenv clone --from production --to staging
# Clone a specific key
redenv clone API_KEY --from production --to developmentInteractive Flow#
$ redenv clone
? Select project: my-app
? Enter your Master Password: ********
? Select source environment: production
? Select destination environment:
❯ staging
development
New environment
Variables loaded.
? Select keys to clone into staging:
◉ API_KEY
◉ DATABASE_URL
◯ DEBUG
Keys to clone:
• API_KEY=sk_live_...
• DATABASE_URL=postgresql://...
? Proceed? Yes
✔ Successfully cloned 2 key(s) from production → staging!Info
You can create a new environment directly by selecting "New environment" as the destination.
Behavior#
- Only missing keys are shown — keys that already exist in the destination are skipped
- If a key already exists in the destination, it won't be overwritten
- Use sync for bidirectional synchronization with conflict resolution
Info
Clone copies the encrypted data directly, so version history is preserved. The cloned secret retains its full audit trail.
Related Commands#
- sync - Two-way synchronization with merging
- diff - Compare environments without modifying
- switch env - Change active environment