Install安装
Clone, dry-run, install — or migrate an existing .zshrc.克隆、预演、安装 —— 或迁移已有 .zshrc。
Quick start快速上手
$ git clone https://github.com/huiyonghkw/hekouwang-terminal-lite-skill $ cd hekouwang-terminal-lite-skill $ ./scripts/install.sh --dry-run $ ./scripts/install.sh # China network:国内网络: CN=1 ./scripts/install.sh
--dry-runlists every file and defaults it would touch — nothing written yet.--dry-run先列出要动的文件与系统设置,此时一个字节都没改。- Already have a carefully built
~/.zshrc? Run./scripts/migrate.shfirst (then--apply). It moves your aliases into~/.zshrc.localinstead of overwriting.已有多年攒的~/.zshrc?先跑./scripts/migrate.sh(再--apply)。它把别名搬进~/.zshrc.local,不是覆盖。 - Node manager: interactive pick, or
./scripts/install.sh --node fnm|nvm|brew|vfox(remembered).Node 管理器:交互选择,或./scripts/install.sh --node fnm|nvm|brew|vfox(会记住)。 - Language:
--lang zhor answer once; stored under~/.config/hekouwang-terminal/lang.语言:--lang zh或首次问答;记在~/.config/hekouwang-terminal/lang。
~/.zshrc, a copy goes to ~/.hekouwang-terminal-backups/ — not scattered in your home root. Legacy ~/.zshrc.bak.* files are swept into that folder on install/migrate.覆盖 ~/.zshrc 前会备份进 ~/.hekouwang-terminal-backups/,不再散落家目录根。旧的 ~/.zshrc.bak.* 会在装机/迁移时收进去。
Preview and roll back预演与回滚
--dry-run shows the complete list first — not a byte is written. ② A failed write rolls back automatically (a theme switch is a transaction). ③ uninstall.sh restores ~/.zshrc from backup and resets the iTerm2 GUI to factory defaults.三条承诺,都是现成能力。① --dry-run 先看完整清单,一个字节不写。② 写入失败自动回滚(换肤按事务执行)。③ uninstall.sh 从备份还原 ~/.zshrc,GUI 用 defaults delete 恢复出厂。
--dry-run runs before the language and Node prompts and writes nothing. It lists the packages it would install, every file it would write, the defaults keys it would change, and what it never touches.--dry-run 在语言与 Node 提问之前就退出,一个字节都不写。它会列出要装的包、要写的每个文件、要改的 defaults 键,以及绝不碰的东西。
# 1) See the whole install plan1) 看清整份安装计划 $ ./scripts/install.sh --dry-run # 2) Install for real2) 真装 $ ./scripts/install.sh # 3) Undo the install: same list first, then restore3) 撤销安装:先看同一份清单,再执行 $ ./scripts/uninstall.sh --dry-run $ ./scripts/uninstall.sh # 4) Undo a theme switch (latest snapshot)4) 撤销换肤(最近一份快照) $ ./scripts/theme.sh --history $ ./scripts/theme.sh --rollback # 5) Undo a paid zip update (Pro build only)5) 撤销付费 zip 更新(仅专业档) $ ./scripts/unlock.sh --rollback
install.sh itself has no --rollback flag — its real undo path is uninstall.sh, which restores ~/.zshrc from the latest backup under ~/.hekouwang-terminal-backups/ and resets the GUI keys with defaults delete. The default tier keeps Homebrew packages and oh-my-zsh.install.sh 本身没有 --rollback 参数 —— 真正的撤销路径是 uninstall.sh:从 ~/.hekouwang-terminal-backups/ 最新备份还原 ~/.zshrc,并用 defaults delete 还原 GUI 键。默认档保留 Homebrew 包与 oh-my-zsh。
Theme switches are transactional: --history lists the five retained snapshots, --rollback restores the latest (or a named one). Preview a switch without writing with ./scripts/theme.sh --plan <theme>.换肤按事务执行:--history 列出保留的五份快照,--rollback 恢复最近一份(也可指定名字)。只想看会改哪些文件、不落盘,用 ./scripts/theme.sh --plan <主题>。