Step 1: Replace C++ prototype with Go project scaffolding.

Remove all old C++ source files, proto definitions, CMake build,
clang configs, IDE files, and Trunk linter config. Initialize Go
module (github.com/kisom/sgard) with cobra and yaml.v3 deps.
Set up cobra root command with --repo persistent flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 21:19:37 -07:00
parent b678ce572a
commit 6cadda01a8
23 changed files with 71 additions and 420 deletions

33
cmd/sgard/main.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/spf13/cobra"
)
var repoFlag string
var rootCmd = &cobra.Command{
Use: "sgard",
Short: "Shimmering Clarity Gardener: dotfile management",
}
func defaultRepo() string {
home, err := os.UserHomeDir()
if err != nil {
return ".sgard"
}
return filepath.Join(home, ".sgard")
}
func main() {
rootCmd.PersistentFlags().StringVar(&repoFlag, "repo", defaultRepo(), "path to sgard repository")
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}