summaryrefslogtreecommitdiff
path: root/internal/cmd/root.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-10-31 20:13:32 +0200
committerPaul Buetow <paul@buetow.org>2025-10-31 20:13:32 +0200
commit11eea6a82cbfdde40ec1457c6ea080da4da6b7dc (patch)
tree8026068f6a3beb3ee02c45f06f4487f4b89caaf1 /internal/cmd/root.go
parent5c3e0b5cf99d028c4f06be7a825388b296e37a22 (diff)
feat: implement amp AI tool support and replace Taskfile with Magev0.10.0
- Add amp as default AI tool for release notes and showcase generation - Fallback chain: amp → hexai → claude → aichat - Replace Taskfile.yaml with magefile.go for build automation - Update all documentation (README.md, AGENTS.md, doc/development.md) - Update version to 0.10.0 Amp-Thread-ID: https://ampcode.com/threads/T-735ba1e2-0255-4b43-8ed1-6c0d2f78301b Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/cmd/root.go')
-rw-r--r--internal/cmd/root.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/internal/cmd/root.go b/internal/cmd/root.go
index bf4f64a..caf89f1 100644
--- a/internal/cmd/root.go
+++ b/internal/cmd/root.go
@@ -5,15 +5,15 @@ import (
"os"
"path/filepath"
- "github.com/spf13/cobra"
"codeberg.org/snonux/gitsyncer/internal/config"
"codeberg.org/snonux/gitsyncer/internal/version"
+ "github.com/spf13/cobra"
)
var (
- cfgFile string
- workDir string
- cfg *config.Config
+ cfgFile string
+ workDir string
+ cfg *config.Config
rootCmd = &cobra.Command{
Use: "gitsyncer",
Short: "Synchronize git repositories across multiple platforms",
@@ -25,7 +25,7 @@ keeps all branches in sync across different git hosting platforms.`,
if cmd.Use == "version" {
return
}
-
+
// Load configuration
var err error
cfg, err = config.Load(cfgFile)
@@ -35,7 +35,7 @@ keeps all branches in sync across different git hosting platforms.`,
fmt.Fprintf(os.Stderr, "See 'gitsyncer help' for more information.\n")
os.Exit(1)
}
-
+
// Use config WorkDir if no flag was explicitly provided
if !cmd.Flags().Changed("work-dir") && cfg.WorkDir != "" {
workDir = cfg.WorkDir
@@ -54,16 +54,16 @@ func Execute() {
func init() {
// Global flags
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "configuration file (default: ~/.config/gitsyncer/config.json)")
-
+
// Set default work directory
home, err := os.UserHomeDir()
defaultWorkDir := ".gitsyncer-work"
if err == nil {
defaultWorkDir = filepath.Join(home, "git", "gitsyncer-workdir")
}
-
+
rootCmd.PersistentFlags().StringVarP(&workDir, "work-dir", "w", defaultWorkDir, "working directory for operations")
-
+
// Version command
rootCmd.AddCommand(&cobra.Command{
Use: "version",
@@ -72,6 +72,5 @@ func init() {
fmt.Println(version.GetVersion())
},
})
-
-}
+}