Skip to content

fix: clone external zsh plugins referenced by dotfiles .zshrc#122

Merged
fullstackjam merged 3 commits into
mainfrom
claude/clone-dotfiles-zsh-plugins
Jun 2, 2026
Merged

fix: clone external zsh plugins referenced by dotfiles .zshrc#122
fullstackjam merged 3 commits into
mainfrom
claude/clone-dotfiles-zsh-plugins

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

Fixes oh-my-zsh logging plugin '...' not found at shell startup after
openboot install <slug> for configs whose shell setup comes entirely from
dotfiles.

Root cause: when a remote config carries no shell block (rc.Shell == nil) but does set a dotfiles_repo, the theme/plugins live only in the
dotfiles' stowed .zshrc. OpenBoot's plugin-cloning only ever ran off
rc.Shell.Plugins, so the external plugins named in the dotfiles .zshrc
(zsh-autosuggestions, zsh-syntax-highlighting, fast-syntax-highlighting,
zsh-autocomplete, …) were never git-cloned into $ZSH_CUSTOM/plugins. PR
#121's plan-level fix could not help here — there was no shell block to carry
through.

Fix: add shell.CloneExternalPluginsFromZshrc and call it from the
dotfiles step after linking. It reads the effective ~/.zshrc, parses
plugins=(), and clones any catalog (external) plugins not already present.
Built-in/unknown names are left untouched and a failed clone stays non-fatal,
matching the existing cloneExternalPlugins. It is a no-op when oh-my-zsh
isn't installed or .zshrc is absent, and is dry-run safe.

Test plan

  • go vet ./internal/shell/... ./internal/installer/...
  • go test ./internal/shell/... ./internal/installer/... ./internal/archtest/...
  • New unit tests: clones external plugins from a dotfiles .zshrc, skips
    built-ins, no-op without OMZ / without .zshrc, dry-run safe
  • Manual on macOS: openboot install fullstackjam → new shell tab has no
    "plugin not found" warnings; ~/.oh-my-zsh/custom/plugins is populated
    (pending user confirmation)

https://claude.ai/code/session_019iBMJXrKC2FXQ4hWay8Lds


Generated by Claude Code

When a remote config carries no shell block (rc.Shell == nil) but does set a
dotfiles_repo, the shell setup comes entirely from the stowed .zshrc. Its
plugins=() list — e.g. zsh-autosuggestions, fast-syntax-highlighting,
zsh-autocomplete — never flowed through RestoreFromSnapshot, so the external
plugins it names were never git-cloned into $ZSH_CUSTOM/plugins. oh-my-zsh
then logged "plugin '...' not found" on every shell startup.

Add shell.CloneExternalPluginsFromZshrc: after dotfiles are linked, read the
effective ~/.zshrc, extract plugins=(), and clone any catalog (external)
plugins not already present. Built-in/unknown names are left untouched and a
failed clone stays non-fatal, matching cloneExternalPlugins. No-op when
oh-my-zsh isn't installed or .zshrc is absent, and dry-run safe.

This is the path `openboot install <slug>` takes for configs like
fullstackjam, where #121's plan-level fix could not help because there was no
shell block to carry through.
@github-actions github-actions Bot added installer Package installation logic tests Tests only labels Jun 2, 2026
claude added 2 commits June 2, 2026 05:57
gosec G703 flagged cloneExternalPlugins now that plugin names can originate
from a user-authored .zshrc (via CloneExternalPluginsFromZshrc) and flow into
filepath.Join. Add an explicit path-segment guard rejecting names that aren't
a plain single segment, and annotate the os.Stat with a justified nolint. A
name only reaches here after matching the curated catalog, so this guard only
ever rejects malicious input — it's defense in depth, not a behavior change.
An unreadable .zshrc now warns and returns nil instead of aborting the
dotfiles step. By the time CloneExternalPluginsFromZshrc runs the dotfiles
are already cloned and linked, and plugin setup is best-effort everywhere
else (cloneExternalPlugins warns and continues on a failed clone), so a
marginal read error should not fail the whole step. Add a test covering the
non-NotExist read-error path.
@fullstackjam fullstackjam merged commit 92f4e4e into main Jun 2, 2026
12 checks passed
@fullstackjam fullstackjam deleted the claude/clone-dotfiles-zsh-plugins branch June 2, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installer Package installation logic tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants