Skip to content

Commit 3bc5cb0

Browse files
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 <AnnatarHe@users.noreply.github.com>
1 parent f7a7d1a commit 3bc5cb0

6 files changed

Lines changed: 120 additions & 8 deletions

File tree

commands/dotfiles_pull.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,18 @@ func pullDotfiles(c *cli.Context) error {
5858

5959
// Initialize all available app handlers
6060
allApps := map[string]model.DotfileApp{
61-
"nvim": model.NewNvimApp(),
62-
"fish": model.NewFishApp(),
63-
"git": model.NewGitApp(),
64-
"zsh": model.NewZshApp(),
65-
"bash": model.NewBashApp(),
66-
"ghostty": model.NewGhosttyApp(),
67-
"claude": model.NewClaudeApp(),
68-
"starship": model.NewStarshipApp(),
61+
"nvim": model.NewNvimApp(),
62+
"fish": model.NewFishApp(),
63+
"git": model.NewGitApp(),
64+
"zsh": model.NewZshApp(),
65+
"bash": model.NewBashApp(),
66+
"ghostty": model.NewGhosttyApp(),
67+
"claude": model.NewClaudeApp(),
68+
"starship": model.NewStarshipApp(),
69+
"npm": model.NewNpmApp(),
70+
"ssh": model.NewSshApp(),
71+
"kitty": model.NewKittyApp(),
72+
"kubernetes": model.NewKubernetesApp(),
6973
}
7074

7175
// Process fetched dotfiles

commands/dotfiles_push.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func pushDotfiles(c *cli.Context) error {
4444
model.NewGhosttyApp(),
4545
model.NewClaudeApp(),
4646
model.NewStarshipApp(),
47+
model.NewNpmApp(),
48+
model.NewSshApp(),
49+
model.NewKittyApp(),
50+
model.NewKubernetesApp(),
4751
}
4852

4953
// Filter apps based on user input

model/dotfile_kitty.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package model
2+
3+
import "context"
4+
5+
// KittyApp handles Kitty terminal configuration files
6+
type KittyApp struct {
7+
BaseApp
8+
}
9+
10+
func NewKittyApp() DotfileApp {
11+
return &KittyApp{}
12+
}
13+
14+
func (k *KittyApp) Name() string {
15+
return "kitty"
16+
}
17+
18+
func (k *KittyApp) GetConfigPaths() []string {
19+
return []string{
20+
"~/.config/kitty/",
21+
}
22+
}
23+
24+
func (k *KittyApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) {
25+
return k.CollectFromPaths(ctx, k.Name(), k.GetConfigPaths())
26+
}

model/dotfile_kubernetes.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package model
2+
3+
import "context"
4+
5+
// KubernetesApp handles Kubernetes configuration files
6+
type KubernetesApp struct {
7+
BaseApp
8+
}
9+
10+
func NewKubernetesApp() DotfileApp {
11+
return &KubernetesApp{}
12+
}
13+
14+
func (k *KubernetesApp) Name() string {
15+
return "kubernetes"
16+
}
17+
18+
func (k *KubernetesApp) GetConfigPaths() []string {
19+
return []string{
20+
"~/.kube/config",
21+
}
22+
}
23+
24+
func (k *KubernetesApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) {
25+
return k.CollectFromPaths(ctx, k.Name(), k.GetConfigPaths())
26+
}

model/dotfile_npm.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package model
2+
3+
import "context"
4+
5+
// NpmApp handles npm configuration files
6+
type NpmApp struct {
7+
BaseApp
8+
}
9+
10+
func NewNpmApp() DotfileApp {
11+
return &NpmApp{}
12+
}
13+
14+
func (n *NpmApp) Name() string {
15+
return "npm"
16+
}
17+
18+
func (n *NpmApp) GetConfigPaths() []string {
19+
return []string{
20+
"~/.npmrc",
21+
}
22+
}
23+
24+
func (n *NpmApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) {
25+
return n.CollectFromPaths(ctx, n.Name(), n.GetConfigPaths())
26+
}

model/dotfile_ssh.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package model
2+
3+
import "context"
4+
5+
// SshApp handles SSH configuration files
6+
type SshApp struct {
7+
BaseApp
8+
}
9+
10+
func NewSshApp() DotfileApp {
11+
return &SshApp{}
12+
}
13+
14+
func (s *SshApp) Name() string {
15+
return "ssh"
16+
}
17+
18+
func (s *SshApp) GetConfigPaths() []string {
19+
return []string{
20+
"~/.ssh/config",
21+
}
22+
}
23+
24+
func (s *SshApp) CollectDotfiles(ctx context.Context) ([]DotfileItem, error) {
25+
return s.CollectFromPaths(ctx, s.Name(), s.GetConfigPaths())
26+
}

0 commit comments

Comments
 (0)