Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chezmoidata/claude.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Claude Code marketplace configuration
# This data is merged into ~/.claude/settings.json via run_onchange_after_ script

marketplace:
extraKnownMarketplaces:
fx-cc:
source:
source: git
url: git@github.com:fx/cc.git

settings:
includeCoAuthoredBy: false
enableAllProjectMcpServers: true
enabledPlugins:
fx-dev@fx-cc: true
6 changes: 5 additions & 1 deletion .chezmoiignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ test-*.sh
*.bak

# Note: shared directory stays in source for symlink targets, not installed to home
shared/
shared/

# .claude directory is managed by run_onchange_after_update-claude-settings.sh script
# Not by chezmoi's file management (allows symlinks to work in Coder)
.claude
8 changes: 0 additions & 8 deletions .chezmoiscripts/run_before_00_remove-claude-symlink.sh.tmpl

This file was deleted.

36 changes: 36 additions & 0 deletions .chezmoiscripts/run_onchange_after_update-claude-settings.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Update ~/.claude/settings.json with marketplace configuration
# Works with both real directories and symlinks

{{ if .include_defaults -}}
set -e

# Ensure ~/.claude exists (as directory or symlink)
if [ ! -e "$HOME/.claude" ]; then
mkdir -p "$HOME/.claude"
fi

SETTINGS_FILE="$HOME/.claude/settings.json"

# Read existing settings or start with empty object
if [ -f "$SETTINGS_FILE" ]; then
existing=$(cat "$SETTINGS_FILE")
else
existing='{}'
fi

# Our required settings from .chezmoidata/claude.yaml
required_settings='{{ .settings | toJson }}'
marketplace_config='{{ .marketplace | toJson }}'

# Merge: existing settings + our required settings + marketplace config
# Our settings take precedence (using * operator for recursive merge)
result=$(echo "$existing" | jq --argjson required "$required_settings" \
--argjson marketplace "$marketplace_config" \
'. * $required * $marketplace')

# Write the merged result
echo "$result" > "$SETTINGS_FILE"

echo "✓ Updated $SETTINGS_FILE"
{{ end -}}
Loading