Skip to content

feat: cac env clone — duplicate environment with fresh identity #34

@nmhjklnm

Description

@nmhjklnm

Summary

Clone an existing environment to create a variant with the same configuration but a fresh identity.

Proposed API

cac env clone <source> <new-name>               # copy config, regenerate identity
cac env clone work work-test --keep-identity     # keep identity (debug only)

Behavior

Default (fresh identity):

  • Copy: proxy, version, tz, lang, settings.json, CLAUDE.md
  • Regenerate: uuid, stable_id, user_id, machine_id, hostname, mac_address, mTLS cert
  • Do NOT copy: sessions, credentials (need to re-login)

--keep-identity:

  • Copy everything (only for debugging/testing)

Implementation

  • Add _env_cmd_clone to src/cmd_env.sh
  • Reuse identity generation functions from _env_cmd_create
  • Add clone to cmd_env dispatcher and help text

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions