-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.go
More file actions
37 lines (32 loc) · 940 Bytes
/
root.go
File metadata and controls
37 lines (32 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cobrax
import (
"github.com/onexstack/cobrax/internal/cfgmgr/cmd/claude"
"github.com/onexstack/cobrax/internal/cfgmgr/cmd/cursor"
"github.com/onexstack/cobrax/internal/cfgmgr/cmd/vscode"
"github.com/spf13/cobra"
)
// Command creates MCP server management commands for a Cobra CLI.
// Pass nil for default configuration or provide a Config for customization.
func Command(config *Config) *cobra.Command {
name := config.commandName()
var defaultEnv map[string]string
if config != nil {
defaultEnv = config.DefaultEnv
}
cmd := &cobra.Command{
Use: name,
Short: "MCP server management",
Long: `Manage MCP servers for AI assistants and code editors`,
}
// Add subcommands
cmd.AddCommand(
startCommand(config),
toolCommand(config),
streamCommand(config),
restCommand(config),
claude.Command(name, defaultEnv),
vscode.Command(name, defaultEnv),
cursor.Command(name, defaultEnv),
)
return cmd
}