From 63a67f0fc71e85500cc0b79bb82e50e937dbabe5 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:40:31 +0000 Subject: [PATCH 1/2] feat: add claude configuration support to dotfiles push/pull - Add ClaudeApp implementation in model/dotfile_claude.go - Support common Claude config paths (~/.claude/settings.json, .claude/, CLAUDE.md) - Enable claude app in dotfiles push and pull commands - Users can now sync Claude Code configuration using dotfiles functionality Resolves #84 Co-authored-by: Le He --- commands/dotfiles_pull.go | 3 ++- commands/dotfiles_push.go | 3 ++- model/dotfile_claude.go | 31 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 model/dotfile_claude.go diff --git a/commands/dotfiles_pull.go b/commands/dotfiles_pull.go index 7af264d..7c78c2e 100644 --- a/commands/dotfiles_pull.go +++ b/commands/dotfiles_pull.go @@ -64,6 +64,7 @@ func pullDotfiles(c *cli.Context) error { "zsh": model.NewZshApp(), "bash": model.NewBashApp(), "ghostty": model.NewGhosttyApp(), + "claude": model.NewClaudeApp(), } // Process fetched dotfiles @@ -138,7 +139,7 @@ func pullDotfiles(c *cli.Context) error { // Filter out files that are already equal filesToUpdate := make(map[string]string) var pathsToActuallyBackup []string - + for path, content := range filesToProcess { if isEqual, exists := equalityMap[path]; exists && isEqual { logrus.Debugf("Skipping %s - content is identical", path) diff --git a/commands/dotfiles_push.go b/commands/dotfiles_push.go index 6bbb152..e23ba1b 100644 --- a/commands/dotfiles_push.go +++ b/commands/dotfiles_push.go @@ -42,6 +42,7 @@ func pushDotfiles(c *cli.Context) error { model.NewZshApp(), model.NewBashApp(), model.NewGhosttyApp(), + model.NewClaudeApp(), } // Filter apps based on user input @@ -97,4 +98,4 @@ func pushDotfiles(c *cli.Context) error { fmt.Printf("📁 Manage your dotfiles at: %s\n", webLink) return nil -} \ No newline at end of file +} diff --git a/model/dotfile_claude.go b/model/dotfile_claude.go new file mode 100644 index 0000000..536c863 --- /dev/null +++ b/model/dotfile_claude.go @@ -0,0 +1,31 @@ +package model + +import "context" + +// ClaudeApp handles Claude Code configuration files +type ClaudeApp struct { + BaseApp +} + +func NewClaudeApp() DotfileApp { + return &ClaudeApp{} +} + +func (c *ClaudeApp) Name() string { + return "claude" +} + +func (c *ClaudeApp) GetConfigPaths() []string { + return []string{ + "~/.claude/settings.json", + "~/.config/claude/settings.json", + "~/.claude/config.json", + "~/.config/claude/config.json", + ".claude/settings.json", + "CLAUDE.md", + } +} + +func (c *ClaudeApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) { + return c.CollectFromPaths(ctx, c.Name(), c.GetConfigPaths()) +} From e73827536b02b389d5005775c417664c0786bc91 Mon Sep 17 00:00:00 2001 From: AnnatarHe Date: Mon, 1 Sep 2025 22:44:35 +0800 Subject: [PATCH 2/2] fix(dotfiles): update Claude config paths to match actual usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove unused config paths and add CLAUDE.md support for Claude configuration. Only keep the primary settings.json path and add the global CLAUDE.md path which is actively used by Claude Code. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- model/dotfile_claude.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/model/dotfile_claude.go b/model/dotfile_claude.go index 536c863..4aa0850 100644 --- a/model/dotfile_claude.go +++ b/model/dotfile_claude.go @@ -18,11 +18,7 @@ func (c *ClaudeApp) Name() string { func (c *ClaudeApp) GetConfigPaths() []string { return []string{ "~/.claude/settings.json", - "~/.config/claude/settings.json", - "~/.claude/config.json", - "~/.config/claude/config.json", - ".claude/settings.json", - "CLAUDE.md", + "~/.claude/CLAUDE.md", } }