From 952eb4f4c8d3dfa4863e01a601d9dda665c1ba0f Mon Sep 17 00:00:00 2001 From: steven carpenter Date: Wed, 23 Jul 2025 22:25:38 -0400 Subject: [PATCH 1/2] updated root.go to add config support --- templates/cmd/root.go.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/cmd/root.go.tmpl b/templates/cmd/root.go.tmpl index d989af0..e357b20 100644 --- a/templates/cmd/root.go.tmpl +++ b/templates/cmd/root.go.tmpl @@ -5,6 +5,7 @@ import ( "github.com/spf13/cobra" "{{.ModName}}/tui" + "{{.ModName}}/config" "{{.ModName}}/internal/logger" ) @@ -20,6 +21,7 @@ var rootCmd = &cobra.Command{ } func Execute() { + config.Init() cobra.CheckErr(rootCmd.Execute()) } From 767806875d8cf1d212721e6d05aa143571879195 Mon Sep 17 00:00:00 2001 From: steven carpenter Date: Thu, 24 Jul 2025 00:25:57 -0400 Subject: [PATCH 2/2] updated readme to breakdown project structure and show requirements of nix and direnv --- templates/README.md.tmpl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/templates/README.md.tmpl b/templates/README.md.tmpl index cf09e00..74775fd 100644 --- a/templates/README.md.tmpl +++ b/templates/README.md.tmpl @@ -2,3 +2,35 @@ ## TLDR; {{.ProgramDesc}} + + +## Getting started + +- make sure you have [nix](https://nixos.org/download/) and [direnv](https://direnv.net/) installed +- run `direnv allow` +- start coding in your desired editor + +### Project structure +./ +├── cmd +│   ├── root.go -> the entrypoint for your cli +│   └── version.go -> an example sub command +├── config +│   └── config.go -> viper configuration init +├── flake.nix -> project flake for packaging and devshell +├── go.mod -> go module config +├── go.sum +├── internal +│   └── logger +│   └── logger.go -> charmbracelet/log logger init +├── justfile -> rusty makefile used to ease development environment commands +├── main.go -> app entrypoint +├── README.md -> YOU ARE HERE. +└── tui + ├── model.go -> bubbletea model data goes here + ├── run.go -> tui entrypoint + ├── update.go -> bubbletea model update functions go here + └── view.go -> bubbletea view functions go here + +### Generating sub-commands +use cobra-cli to generate sub-commands