From 3bc5cb0afb6aa05d4c2cf308a96e817c7f23ed3e Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 06:04:33 +0000 Subject: [PATCH] feat: add npm, ssh, kitty, and kubernetes dotfile support - Add NpmApp for ~/.npmrc configuration - Add SshApp for ~/.ssh/config configuration - Add KittyApp for ~/.config/kitty/ directory - Add KubernetesApp for ~/.kube/config configuration - Update dotfiles_pull.go and dotfiles_push.go to include all new apps Co-authored-by: Le He --- commands/dotfiles_pull.go | 20 ++++++++++++-------- commands/dotfiles_push.go | 4 ++++ model/dotfile_kitty.go | 26 ++++++++++++++++++++++++++ model/dotfile_kubernetes.go | 26 ++++++++++++++++++++++++++ model/dotfile_npm.go | 26 ++++++++++++++++++++++++++ model/dotfile_ssh.go | 26 ++++++++++++++++++++++++++ 6 files changed, 120 insertions(+), 8 deletions(-) create mode 100644 model/dotfile_kitty.go create mode 100644 model/dotfile_kubernetes.go create mode 100644 model/dotfile_npm.go create mode 100644 model/dotfile_ssh.go diff --git a/commands/dotfiles_pull.go b/commands/dotfiles_pull.go index 9206a89..ed505ff 100644 --- a/commands/dotfiles_pull.go +++ b/commands/dotfiles_pull.go @@ -58,14 +58,18 @@ func pullDotfiles(c *cli.Context) error { // Initialize all available app handlers allApps := map[string]model.DotfileApp{ - "nvim": model.NewNvimApp(), - "fish": model.NewFishApp(), - "git": model.NewGitApp(), - "zsh": model.NewZshApp(), - "bash": model.NewBashApp(), - "ghostty": model.NewGhosttyApp(), - "claude": model.NewClaudeApp(), - "starship": model.NewStarshipApp(), + "nvim": model.NewNvimApp(), + "fish": model.NewFishApp(), + "git": model.NewGitApp(), + "zsh": model.NewZshApp(), + "bash": model.NewBashApp(), + "ghostty": model.NewGhosttyApp(), + "claude": model.NewClaudeApp(), + "starship": model.NewStarshipApp(), + "npm": model.NewNpmApp(), + "ssh": model.NewSshApp(), + "kitty": model.NewKittyApp(), + "kubernetes": model.NewKubernetesApp(), } // Process fetched dotfiles diff --git a/commands/dotfiles_push.go b/commands/dotfiles_push.go index 422f244..a4ee1b3 100644 --- a/commands/dotfiles_push.go +++ b/commands/dotfiles_push.go @@ -44,6 +44,10 @@ func pushDotfiles(c *cli.Context) error { model.NewGhosttyApp(), model.NewClaudeApp(), model.NewStarshipApp(), + model.NewNpmApp(), + model.NewSshApp(), + model.NewKittyApp(), + model.NewKubernetesApp(), } // Filter apps based on user input diff --git a/model/dotfile_kitty.go b/model/dotfile_kitty.go new file mode 100644 index 0000000..796454c --- /dev/null +++ b/model/dotfile_kitty.go @@ -0,0 +1,26 @@ +package model + +import "context" + +// KittyApp handles Kitty terminal configuration files +type KittyApp struct { + BaseApp +} + +func NewKittyApp() DotfileApp { + return &KittyApp{} +} + +func (k *KittyApp) Name() string { + return "kitty" +} + +func (k *KittyApp) GetConfigPaths() []string { + return []string{ + "~/.config/kitty/", + } +} + +func (k *KittyApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) { + return k.CollectFromPaths(ctx, k.Name(), k.GetConfigPaths()) +} diff --git a/model/dotfile_kubernetes.go b/model/dotfile_kubernetes.go new file mode 100644 index 0000000..9d997f7 --- /dev/null +++ b/model/dotfile_kubernetes.go @@ -0,0 +1,26 @@ +package model + +import "context" + +// KubernetesApp handles Kubernetes configuration files +type KubernetesApp struct { + BaseApp +} + +func NewKubernetesApp() DotfileApp { + return &KubernetesApp{} +} + +func (k *KubernetesApp) Name() string { + return "kubernetes" +} + +func (k *KubernetesApp) GetConfigPaths() []string { + return []string{ + "~/.kube/config", + } +} + +func (k *KubernetesApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) { + return k.CollectFromPaths(ctx, k.Name(), k.GetConfigPaths()) +} diff --git a/model/dotfile_npm.go b/model/dotfile_npm.go new file mode 100644 index 0000000..3917517 --- /dev/null +++ b/model/dotfile_npm.go @@ -0,0 +1,26 @@ +package model + +import "context" + +// NpmApp handles npm configuration files +type NpmApp struct { + BaseApp +} + +func NewNpmApp() DotfileApp { + return &NpmApp{} +} + +func (n *NpmApp) Name() string { + return "npm" +} + +func (n *NpmApp) GetConfigPaths() []string { + return []string{ + "~/.npmrc", + } +} + +func (n *NpmApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) { + return n.CollectFromPaths(ctx, n.Name(), n.GetConfigPaths()) +} diff --git a/model/dotfile_ssh.go b/model/dotfile_ssh.go new file mode 100644 index 0000000..cff6da9 --- /dev/null +++ b/model/dotfile_ssh.go @@ -0,0 +1,26 @@ +package model + +import "context" + +// SshApp handles SSH configuration files +type SshApp struct { + BaseApp +} + +func NewSshApp() DotfileApp { + return &SshApp{} +} + +func (s *SshApp) Name() string { + return "ssh" +} + +func (s *SshApp) GetConfigPaths() []string { + return []string{ + "~/.ssh/config", + } +} + +func (s *SshApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) { + return s.CollectFromPaths(ctx, s.Name(), s.GetConfigPaths()) +}