summaryrefslogtreecommitdiff
path: root/internal/cli/showcase_handler.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-07 23:25:10 +0300
committerPaul Buetow <paul@buetow.org>2025-07-07 23:25:10 +0300
commit4526c8a171dbe40762c116e5b8a404f20131d2b1 (patch)
treeea3d544cbad995dabb616f4b6136e6e24a097524 /internal/cli/showcase_handler.go
parent64095a2c8d5a3a72c55d7bd0737c5542a5aeee09 (diff)
feat: add comprehensive showcase generation with metadata and images
- Add --showcase flag to generate project showcases using Claude - Extract repository metadata (languages, commits, LOC, dates, license) - Support image extraction from README files (local and remote) - Add caching with --force flag to regenerate - Add exclude_from_showcase config option - Add standalone showcase mode (--showcase without sync) - Sort projects by recent activity (avg age of last 100 commits) - Output in Gemini Gemtext template format (.gmi.tpl) - Fix backup location fetching when --backup flag not set 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/cli/showcase_handler.go')
-rw-r--r--internal/cli/showcase_handler.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/cli/showcase_handler.go b/internal/cli/showcase_handler.go
new file mode 100644
index 0000000..a3dfd26
--- /dev/null
+++ b/internal/cli/showcase_handler.go
@@ -0,0 +1,35 @@
+package cli
+
+import (
+ "fmt"
+ "log"
+
+ "codeberg.org/snonux/gitsyncer/internal/config"
+ "codeberg.org/snonux/gitsyncer/internal/showcase"
+)
+
+// HandleShowcase handles the showcase generation after syncing
+func HandleShowcase(cfg *config.Config, flags *Flags) int {
+ // Determine which repositories to process
+ var repoFilter []string
+ if flags.SyncRepo != "" {
+ // Only process the specific repository that was synced
+ repoFilter = []string{flags.SyncRepo}
+ fmt.Printf("\nGenerating showcase for %s...\n", flags.SyncRepo)
+ } else {
+ // Process all repositories for --sync-all or public sync operations
+ fmt.Println("\nGenerating project showcase for all repositories...")
+ }
+
+ // Create showcase generator
+ generator := showcase.New(cfg, flags.WorkDir)
+
+ // Generate showcase with optional filter
+ if err := generator.GenerateShowcase(repoFilter, flags.Force); err != nil {
+ log.Printf("ERROR: Failed to generate showcase: %v\n", err)
+ return 1
+ }
+
+ fmt.Println("Showcase generated successfully!")
+ return 0
+} \ No newline at end of file