Major changes: - Refactor CLI entry point to Cobra commands (root, setup, scan, doctor, install, update, lsp, mcp, skills, config, version) - Add LSP registry with health checks, auto-install, and editor config generation - Add MCP registry with editor detection, status tracking, and per-editor configuration - Add workflow engine with planner and step execution for automated task chains - Add conversation search, export (Markdown/JSON), and detailed token counting - Add streaming shell chat handler with tool call/result events - Add skill validation, dry-run testing, and export endpoints - Enrich dashboard with Tools/Activity/Status tabs and tool cards grid - Add PRD documentation - Complete i18n for both EN and FR 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/muyue/muyue/internal/lsp"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var lspCmd = &cobra.Command{
|
|
Use: "lsp",
|
|
Short: "LSP management",
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(lspCmd)
|
|
lspCmd.AddCommand(&cobra.Command{
|
|
Use: "scan",
|
|
Short: "Scan for installed LSPs",
|
|
RunE: runLSPScan,
|
|
})
|
|
lspCmd.AddCommand(&cobra.Command{
|
|
Use: "install [name]",
|
|
Short: "Install LSP server(s)",
|
|
Args: cobra.RangeArgs(0, 1),
|
|
RunE: runLSPInstall,
|
|
})
|
|
}
|
|
|
|
func runLSPScan(cmd *cobra.Command, args []string) error {
|
|
servers := lsp.ScanServers()
|
|
fmt.Printf("%-25s %-15s %-10s\n", "Name", "Language", "Status")
|
|
fmt.Println("──────────────────────────────────────────")
|
|
for _, s := range servers {
|
|
status := "✗ missing"
|
|
if s.Installed {
|
|
status = "✓ installed"
|
|
}
|
|
fmt.Printf("%-25s %-15s %-10s\n", s.Name, s.Language, status)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func runLSPInstall(cmd *cobra.Command, args []string) error {
|
|
if len(args) == 0 {
|
|
return fmt.Errorf("server name required")
|
|
}
|
|
name := args[0]
|
|
fmt.Printf("Installing %s...\n", name)
|
|
if err := lsp.InstallServer(name); err != nil {
|
|
return err
|
|
}
|
|
fmt.Printf("✓ %s installed\n", name)
|
|
return nil
|
|
} |