From 4526c8a171dbe40762c116e5b8a404f20131d2b1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 7 Jul 2025 23:25:10 +0300 Subject: feat: add comprehensive showcase generation with metadata and images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- cmd/gitsyncer/main.go | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/gitsyncer/main.go b/cmd/gitsyncer/main.go index ddf00e3..9828776 100644 --- a/cmd/gitsyncer/main.go +++ b/cmd/gitsyncer/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "path/filepath" @@ -59,25 +60,61 @@ func main() { // Handle sync operation if flags.SyncRepo != "" { - os.Exit(cli.HandleSync(cfg, flags)) + exitCode := cli.HandleSync(cfg, flags) + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + os.Exit(exitCode) } // Handle sync all operation if flags.SyncAll { - os.Exit(cli.HandleSyncAll(cfg, flags)) + exitCode := cli.HandleSyncAll(cfg, flags) + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + os.Exit(exitCode) } // Handle sync Codeberg public repos if flags.SyncCodebergPublic { exitCode := cli.HandleSyncCodebergPublic(cfg, flags) if exitCode != 0 || !flags.SyncGitHubPublic { + if exitCode == 0 && flags.Showcase && !flags.SyncGitHubPublic { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } os.Exit(exitCode) } } // Handle sync GitHub public repos if flags.SyncGitHubPublic { - os.Exit(cli.HandleSyncGitHubPublic(cfg, flags)) + exitCode := cli.HandleSyncGitHubPublic(cfg, flags) + + // Run showcase generation if requested and sync was successful + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + + os.Exit(exitCode) + } + + // Handle standalone showcase mode (no sync operations specified) + if flags.Showcase { + fmt.Println("Running showcase generation for all repositories (clone-only mode)...") + os.Exit(cli.HandleShowcaseOnly(cfg, flags)) } // Default: show usage -- cgit v1.2.3