From 05e0cbba60a6662518f78144dc08e6cf5db2c6d1 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 7 Jul 2026 11:56:39 +0800 Subject: [PATCH 1/3] feat: force autoUpdate on all claude plugin marketplaces The claude CLI has no flag to enable autoUpdate when adding a marketplace, so force it true for every existing entry on each chezmoi apply instead of hand-maintaining it in settings.json. --- chezmoi/private_dot_claude/modify_settings.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chezmoi/private_dot_claude/modify_settings.json b/chezmoi/private_dot_claude/modify_settings.json index 3e0cb554..657f7d06 100644 --- a/chezmoi/private_dot_claude/modify_settings.json +++ b/chezmoi/private_dot_claude/modify_settings.json @@ -4,4 +4,10 @@ {{- $current = fromJson .chezmoi.stdin -}} {{- end -}} {{- $chezmoi := includeTemplate "claude-settings.json" . | fromJson -}} -{{ mergeOverwrite $current $chezmoi | toPrettyJson }} +{{- $merged := mergeOverwrite $current $chezmoi -}} +{{- if hasKey $current "extraKnownMarketplaces" -}} +{{- range $name, $marketplace := $current.extraKnownMarketplaces -}} +{{- $merged = setValueAtPath (list "extraKnownMarketplaces" $name "autoUpdate") true $merged -}} +{{- end -}} +{{- end -}} +{{ $merged | toPrettyJson }} From e57cb3346682d6d279a2e7fe8f05b7537c623175 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:38:03 +0800 Subject: [PATCH 2/3] fix: reference merged result instead of pre-merge current in marketplace autoUpdate loop $current and $chezmoi mutate in place via mergeOverwrite, but relying on that implicit aliasing is fragile. Rename $chezmoi to $template to avoid shadowing the .chezmoi builtin, and iterate over $merged directly. --- chezmoi/private_dot_claude/modify_settings.json | 8 ++++---- chezmoi/private_dot_config/mcp/modify_mcp_servers.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chezmoi/private_dot_claude/modify_settings.json b/chezmoi/private_dot_claude/modify_settings.json index 657f7d06..e322847d 100644 --- a/chezmoi/private_dot_claude/modify_settings.json +++ b/chezmoi/private_dot_claude/modify_settings.json @@ -3,10 +3,10 @@ {{- if .chezmoi.stdin | trim -}} {{- $current = fromJson .chezmoi.stdin -}} {{- end -}} -{{- $chezmoi := includeTemplate "claude-settings.json" . | fromJson -}} -{{- $merged := mergeOverwrite $current $chezmoi -}} -{{- if hasKey $current "extraKnownMarketplaces" -}} -{{- range $name, $marketplace := $current.extraKnownMarketplaces -}} +{{- $template := includeTemplate "claude-settings.json" . | fromJson -}} +{{- $merged := mergeOverwrite $current $template -}} +{{- if hasKey $merged "extraKnownMarketplaces" -}} +{{- range $name, $marketplace := $merged.extraKnownMarketplaces -}} {{- $merged = setValueAtPath (list "extraKnownMarketplaces" $name "autoUpdate") true $merged -}} {{- end -}} {{- end -}} diff --git a/chezmoi/private_dot_config/mcp/modify_mcp_servers.json b/chezmoi/private_dot_config/mcp/modify_mcp_servers.json index f1ffde49..98a3cca2 100644 --- a/chezmoi/private_dot_config/mcp/modify_mcp_servers.json +++ b/chezmoi/private_dot_config/mcp/modify_mcp_servers.json @@ -3,5 +3,5 @@ {{- if .chezmoi.stdin | trim -}} {{- $current = fromJson .chezmoi.stdin -}} {{- end -}} -{{- $chezmoi := includeTemplate "mcp_servers.json" . | fromJson -}} -{{ mergeOverwrite $current $chezmoi | toPrettyJson }} +{{- $template := includeTemplate "mcp_servers.json" . | fromJson -}} +{{ mergeOverwrite $current $template | toPrettyJson }} From faa01f36d1ded839a51ffe3f703d5bdab48f56ca Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:39:20 +0800 Subject: [PATCH 3/3] rename template --- chezmoi/private_dot_config/opencode/modify_opencode.json | 4 ++-- chezmoi/private_dot_config/opencode/modify_tui.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chezmoi/private_dot_config/opencode/modify_opencode.json b/chezmoi/private_dot_config/opencode/modify_opencode.json index d02160a8..9199e519 100644 --- a/chezmoi/private_dot_config/opencode/modify_opencode.json +++ b/chezmoi/private_dot_config/opencode/modify_opencode.json @@ -3,5 +3,5 @@ {{- if .chezmoi.stdin | trim -}} {{- $current = fromJson .chezmoi.stdin -}} {{- end -}} -{{- $chezmoi := includeTemplate "opencode.json" . | fromJson -}} -{{ mergeOverwrite $current $chezmoi | toPrettyJson }} +{{- $template := includeTemplate "opencode.json" . | fromJson -}} +{{ mergeOverwrite $current $template | toPrettyJson }} diff --git a/chezmoi/private_dot_config/opencode/modify_tui.json b/chezmoi/private_dot_config/opencode/modify_tui.json index 05b52ac2..1c2e0c13 100644 --- a/chezmoi/private_dot_config/opencode/modify_tui.json +++ b/chezmoi/private_dot_config/opencode/modify_tui.json @@ -3,5 +3,5 @@ {{- if .chezmoi.stdin | trim -}} {{- $current = fromJson .chezmoi.stdin -}} {{- end -}} -{{- $chezmoi := includeTemplate "opencode-tui.json" . | fromJson -}} -{{ mergeOverwrite $current $chezmoi | toPrettyJson }} +{{- $template := includeTemplate "opencode-tui.json" . | fromJson -}} +{{ mergeOverwrite $current $template | toPrettyJson }}