git clone go mod tity
go run main.go
OR
go build . ./sdv-m2-renf-backend-go-cobra.exe
you can also name the executable as you wish with
go build -o tournoi-cli.exe ./tournoi-cli.exe
for the following, I will be using ./tournoi-cli.exe
When the command is ran, it will list the commands you can use. Commands can also contain subcommands (like auth) So if you run ./tournoi-cli.exe
it will list the subcommands you can use (login, signup)
./tournoi-cli init
auth login implementeded mais pas le temps de l'integrer init Initializes the database
team
create try -i command
delete A brief description of your command
list List the teams
match
create v
delete v
list v
tournament
create
delete
list
sports create delete
JWT Authentication in Go (Gin/Gorm)
How to write beautiful Golang CLI
go install github.com/spf13/cobra-cli@latest
go get github.com/manifoldco/promptui
go get -u gorm.io/gorm go get -u gorm.io/driver/sqlite
go get -u golang.org/x/crypto/bcrypt
go get -u github.com/golang-jwt/jwt/v5
go get github.com/joho/godotenv