From dae59eda95076677c96c6f0ee5799260d96ea243 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Sun, 22 Jun 2025 13:52:46 -0400 Subject: [PATCH] Initial setup --- .gitea/template | 5 +++++ README.md | 18 +++++++++++++++++- cmd/root.go | 28 ++++++++++++++++++++++++++++ go.mod | 7 +++++++ main.go | 13 +++++++++++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .gitea/template create mode 100644 cmd/root.go create mode 100644 go.mod create mode 100644 main.go diff --git a/.gitea/template b/.gitea/template new file mode 100644 index 0000000..b598082 --- /dev/null +++ b/.gitea/template @@ -0,0 +1,5 @@ +# This file tells Gitea to process variable substitution in the following files. +go.mod +README.md +cmd/${REPO_NAME}/main.go + diff --git a/README.md b/README.md index dd05182..b793c9d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ -# go-cli-template +# ${REPO_NAME} +A new Go CLI application. + +## Description + +${REPO_DESCRIPTION} + +## Getting Started + +### Prerequisites + +* Go (version 1.24 or later) + +### Installation + +```sh +go install [github.com/\]\(https\://github\.com/){REPO_OWNER}/${REPO_NAME}@latest diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..c7faf99 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,28 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "${REPO_NAME}", + Short: "A brief description of your application", + Long: `A longer description that spans multiple lines and likely contains +examples and usage of using your application.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Hello from your new Go CLI!") + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() error { + return rootCmd.Execute() +} + +func init() { + // Here you will define your flags and configuration settings. +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ed82ab6 --- /dev/null +++ b/go.mod @@ -0,0 +1,7 @@ +module git.runcible.com/${REPO_OWNER}/${REPO_NAME} + +go 1.24 + +require ( + github.com/spf13/cobra v1.9.1 +) diff --git a/main.go b/main.go new file mode 100644 index 0000000..d1a3c3c --- /dev/null +++ b/main.go @@ -0,0 +1,13 @@ +package main + +import ( + "log" + + "github.com/${REPO_OWNER}/${REPO_NAME}/cmd" +) + +func main() { + if err := cmd.Execute(); err != nil { + log.Fatalf("error executing command: %v", err) + } +}