Skip to content

feat: cac env export/import — portable environment config #35

@nmhjklnm

Description

@nmhjklnm

Summary

Export environment configuration as JSON for backup or cross-machine sync. Import on another machine to recreate the environment.

Proposed API

cac env export <name> [--config-only] > work.json
cac env import <name> --from work.json

JSON format

{
  "name": "work",
  "proxy": "socks5://u:p@host:port",
  "version": "2.1.83",
  "tz": "Asia/Shanghai",
  "lang": "en_US.UTF-8",
  "settings": { "permissions": { "defaultMode": "bypassPermissions" }, ... },
  "claude_md": "# My CLAUDE.md content..."
}

Design decisions

  • Identity info (uuid, stable_id, mac, hostname, machine_id) is never exported — each machine generates its own
  • --config-only: export only config (proxy, version, tz, settings) — no sessions or credentials
  • Without --config-only: include .claude/ directory content (sessions, memory) for full backup
  • On import: auto-generate identity, auto-install Claude Code version if not present

Use cases

  1. Backup: export full environment before system reinstall
  2. Multi-machine: share proxy + settings config across machines
  3. Team onboarding: share a standard config file

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions