Skip to content

Reconcile append mode tool installation with config repair#24

Merged
ChangeHow merged 3 commits intomainfrom
copilot/fix-append-mode-installation-checks
Mar 20, 2026
Merged

Reconcile append mode tool installation with config repair#24
ChangeHow merged 3 commits intomainfrom
copilot/fix-append-mode-installation-checks

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

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:

// 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.

🔒 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.

Copilot AI and others added 2 commits March 20, 2026 09:07
Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com>
Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix append mode implementation to include installation checks Reconcile append mode tool installation with config repair Mar 20, 2026
Copilot AI requested a review from ChangeHow March 20, 2026 09:10
@ChangeHow ChangeHow marked this pull request as ready for review March 20, 2026 09:17
@ChangeHow ChangeHow merged commit 02623e4 into main Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants