feat: Introduce analyze Command for Deep Educational Codebase Analysis
#6
19
cmd/analyze.go
Normal file
19
cmd/analyze.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user