20 lines
770 B
Go
20 lines
770 B
Go
|
|
var analyzeCmd = &cobra.Command{
|
||
|
|
Use: "analyze [flags]",
|
||
|
|
Short: "Deep project analysis → educational Markdown report",
|
||
|
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
|
dir := viper.GetString("dir") // or flag
|
||
|
|
output := viper.GetString("output")
|
||
|
|
|
||
|
|
// 1. Discover files via internal/linter
|
||
|
|
files, err := linter.DiscoverFiles(dir)
|
||
|
|
// 2. Build context (tree, git remote, go.mod, etc.)
|
||
|
|
context := buildProjectContext(dir, files)
|
||
|
|
// 3. Send to Grok (silent stream)
|
||
|
|
report := grokClient.StreamSilent(buildAnalyzePrompt(context), model)
|
||
|
|
// 4. Clean + preview (unified diff style against existing analyze.md if present)
|
||
|
|
// 5. Confirm unless --yes
|
||
|
|
// 6. Write or print
|
||
|
|
},
|
||
|
|
}
|
||
|
|
|