You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reconcile append mode tool installation with config repair (#24)
`append` only updated shell config blocks, so partially failed setups
could still leave required tooling missing. In particular, selecting
`tools-init` did not retry installation when commands like `fnm` were
absent, leaving CLI state and config state out of sync.
- **Append now repairs capability, not just config**
- `tools-init` is treated as a combined reconciliation step for both:
- the `suitup/tools-init` block in `.zshrc`
- the required commands behind that block: `atuin`, `fzf`, `zoxide`,
`fnm`
- If the config block already exists but any of those commands are
missing, append still surfaces the item and applies repair.
- **Reuse existing installers instead of duplicating logic**
- Missing shell tools are routed through the existing
`installCliTools()` flow.
- Missing `fnm` triggers the existing frontend installer path via
`installFrontendTools()`, so append reuses the same install/retry
behavior as setup.
- **Idempotent config behavior is preserved**
- The init block is only appended when missing.
- If config is already present, append can still perform the install
side of the repair without duplicating markers or rewriting unrelated
content.
- **Focused append coverage**
- Added coverage for:
- config present + `fnm` missing
- mixed missing dependencies across CLI tools and frontend tools
- no-op behavior when both tools and config are already present
- **Docs updated**
- `README.md` and `README.zh-CN.md` now describe append as repairing
missing tool dependencies in addition to appending config blocks.
Example of the repaired behavior:
```js
// Existing ~/.zshrc already contains:
# >>> suitup/tools-init >>>
command -v atuin &>/dev/null && eval "$(atuin init zsh)"
command -v fzf &>/dev/null && eval "$(fzf --zsh)"
command -v zoxide &>/dev/null && eval "$(zoxide init zsh)"
command -v fnm &>/dev/null && eval "$(fnm env --use-on-cd --version-file-strategy=recursive --shell zsh)"
# <<< suitup/tools-init <<<
// Before:
// append would skip this block entirely because the marker already existed.
// After:
// append detects missing commands (for example `fnm`),
// reruns the relevant installer(s),
// and only appends the block if the config itself is missing.
```
<!-- START COPILOT CODING AGENT TIPS -->
---
🔒 GitHub Advanced Security automatically protects Copilot coding agent
pull requests. You can protect all pull requests by enabling Advanced
Security for your repositories. [Learn more about Advanced
Security.](https://gh.io/cca-advanced-security)
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Suitup can bootstrap Zsh and Homebrew for you, but the most reliable path is to
35
35
- Recommended: install Zsh first, switch into a Zsh session, then run suitup
36
36
- Recommended: install Homebrew first so later package/tool steps run in a known-good environment
37
37
- Optional: if you skip either one, keep the `Bootstrap` step selected and let suitup set them up for you
38
-
- If your setup stopped halfway, run `node src/cli.js append` to add missing blocks or switch the prompt preset without replacing your whole `.zshrc`
38
+
- If your setup stopped halfway, run `node src/cli.js append` to add missing blocks, re-install missing tools tied to those blocks, or switch the prompt preset without replacing your whole `.zshrc`
39
39
- When suitup detects existing suitup-managed config or already-installed frontend prerequisites, setup now deselects those completed steps by default so reruns stay focused
40
40
41
41
### Install and run
@@ -121,7 +121,7 @@ For users who already have a `.zshrc` and want to cherry-pick suitup configs:
Uses idempotent marker blocks (`# >>> suitup/... >>>`) to safely append selected configs and re-run related installers when required tools are missing:
0 commit comments