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
Summary
Clone an existing environment to create a variant with the same configuration but a fresh identity.
Proposed API
Behavior
Default (fresh identity):
--keep-identity:Implementation
_env_cmd_clonetosrc/cmd_env.sh_env_cmd_createclonetocmd_envdispatcher and help text