feat: Introduce analyze Command for Deep Educational Codebase Analysis #6

Merged
gmgauthier merged 9 commits from feature/analyze_cmd into master 2026-03-28 16:11:39 +00:00
Showing only changes of commit 78379aa557 - Show all commits

19
cmd/analyze.go Normal file
View 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
},
}