summaryrefslogtreecommitdiff
path: root/internal/cmd/showcase.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-13 17:37:16 +0300
committerPaul Buetow <paul@buetow.org>2025-07-13 17:37:16 +0300
commitfa5ef028ec9a7af801710eed190057d3b3c172f0 (patch)
tree41ef41dd1edace0438be20c4f35328c0fbfd8090 /internal/cmd/showcase.go
parent79225d4df3a181f08a2160ff8ec361001b9dea18 (diff)
refactor: restructure CLI with cobra command framework
- Replace flat flags with organized command structure - Add commands: sync, list, manage, release, showcase, test - Implement subcommands for better organization: - sync: repo, all, codeberg-to-github, github-to-codeberg, bidirectional - list: orgs, repos - manage: delete-repo, clean, batch-run - release: check, create (with --ai-notes support) - showcase: with --force, --output, --format, --exclude - test: github-token, codeberg-token, config - Add comprehensive help with examples for all commands - Fix config loading bug when path is empty - Update README.md with new command structure and examples - Maintain backward compatibility (old flags still work with warnings) The new structure provides better discoverability, consistent naming, and logical grouping of related functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/cmd/showcase.go')
-rw-r--r--internal/cmd/showcase.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/internal/cmd/showcase.go b/internal/cmd/showcase.go
new file mode 100644
index 0000000..e184700
--- /dev/null
+++ b/internal/cmd/showcase.go
@@ -0,0 +1,57 @@
+package cmd
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/spf13/cobra"
+ "codeberg.org/snonux/gitsyncer/internal/cli"
+)
+
+var (
+ forceRegenerate bool
+ outputPath string
+ outputFormat string
+ excludePattern string
+)
+
+var showcaseCmd = &cobra.Command{
+ Use: "showcase",
+ Short: "Generate AI-powered project showcase",
+ Long: `Generate a comprehensive showcase of all your projects using Claude AI.
+This feature creates a formatted document with project summaries, statistics,
+and code snippets.`,
+ 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-.*"`,
+ Run: func(cmd *cobra.Command, args []string) {
+ flags := buildFlags()
+ flags.Showcase = true
+ flags.Force = forceRegenerate
+
+ 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")
+} \ No newline at end of file