Compare commits
2 commits
f0b5035232
...
767806875d
| Author | SHA1 | Date | |
|---|---|---|---|
| 767806875d | |||
| 952eb4f4c8 |
2 changed files with 34 additions and 0 deletions
|
|
@ -2,3 +2,35 @@
|
||||||
|
|
||||||
## TLDR;
|
## TLDR;
|
||||||
{{.ProgramDesc}}
|
{{.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
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"{{.ModName}}/tui"
|
"{{.ModName}}/tui"
|
||||||
|
"{{.ModName}}/config"
|
||||||
"{{.ModName}}/internal/logger"
|
"{{.ModName}}/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -20,6 +21,7 @@ var rootCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
config.Init()
|
||||||
cobra.CheckErr(rootCmd.Execute())
|
cobra.CheckErr(rootCmd.Execute())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue