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>
39 lines
790 B
Go
39 lines
790 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/muyue/muyue/internal/config"
|
|
"github.com/muyue/muyue/internal/profiler"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var setupCmd = &cobra.Command{
|
|
Use: "setup",
|
|
Short: "Run first-run wizard (profiler)",
|
|
RunE: runSetup,
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(setupCmd)
|
|
}
|
|
|
|
func runSetup(cmd *cobra.Command, args []string) error {
|
|
cfg, err := profiler.RunFirstTimeSetup()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for i := range cfg.AI.Providers {
|
|
if cfg.AI.Providers[i].Active && cfg.AI.Providers[i].APIKey == "" {
|
|
key, err := profiler.AskAPIKey(cfg.AI.Providers[i].Name)
|
|
if err == nil && key != "" {
|
|
cfg.AI.Providers[i].APIKey = key
|
|
}
|
|
}
|
|
}
|
|
if err := config.Save(cfg); err != nil {
|
|
return err
|
|
}
|
|
fmt.Println("Setup complete!")
|
|
return nil
|
|
} |