summaryrefslogtreecommitdiff
path: root/internal/cmd/showcase.go
blob: 6f9f9849fa7b20d3203f2248038b53c79b9aa2bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package cmd

import (
	"fmt"
	"os"

	"github.com/spf13/cobra"
	"codeberg.org/snonux/gitsyncer/internal/cli"
)

var (
    forceRegenerate bool
    outputPath      string
    outputFormat    string
    excludePattern  string
    showcaseAITool  string
    showcaseRepo    string
)

var showcaseCmd = &cobra.Command{
	Use:   "showcase",
	Short: "Generate AI-powered project showcase",
    Long: `Generate a comprehensive showcase of all your projects using AI.
This feature creates a formatted document with project summaries, statistics,
and code snippets. By default uses Claude, but will try hexai first if available,
and can also use aichat.`,
	Example: `  # Generate showcase with cached summaries
  gitsyncer showcase
  
  # Force regeneration of all summaries
  gitsyncer showcase --force
  
  # Custom output path
  gitsyncer showcase --output ~/my-showcase.md
  
  # Different output format
  gitsyncer showcase --format markdown
  
  # Exclude certain repositories
  gitsyncer showcase --exclude "test-.*"
  
  # Use a specific AI tool
  gitsyncer showcase --ai-tool hexai`,
    Run: func(cmd *cobra.Command, args []string) {
        flags := buildFlags()
        flags.Showcase = true
        flags.Force = forceRegenerate
        flags.AITool = showcaseAITool
        if showcaseRepo != "" {
            flags.SyncRepo = showcaseRepo
        }
        
        fmt.Println("Running showcase generation for all repositories...")
        exitCode := cli.HandleShowcaseOnly(cfg, flags)
        os.Exit(exitCode)
    },
}

func init() {
    rootCmd.AddCommand(showcaseCmd)
    
    // Showcase flags
    showcaseCmd.Flags().BoolVarP(&forceRegenerate, "force", "f", false, "force regeneration of cached summaries")
    showcaseCmd.Flags().StringVarP(&outputPath, "output", "o", "", "custom output path (default: ~/git/foo.zone-content/gemtext/about/showcase.gmi.tpl)")
    showcaseCmd.Flags().StringVar(&outputFormat, "format", "gemtext", "output format: gemtext, markdown, html")
    showcaseCmd.Flags().StringVar(&excludePattern, "exclude", "", "exclude repos matching pattern")
    showcaseCmd.Flags().StringVar(&showcaseAITool, "ai-tool", "claude", "AI tool for summaries: hexai, claude, claude-code, or aichat (default tries hexai→claude→aichat)")
    showcaseCmd.Flags().StringVar(&showcaseRepo, "repo", "", "only generate showcase for a single repository")
}