Fullform: Gen
erate G
olang Project
- Inspired by Nest CLI
geng
is command-line interface tool that helps you to initialize, develop, and maintain your Go gin applications - By default it will generate the clean code architecture of wesionaryTEAM
- Pre-requisite: You need to install the golang in your system: golang installation
go install github.com/mukezhz/geng@latest
Alternative Install
- Download and execute binary by downloading from assets
Add binary dir to your PATH variable [If geng command didn't work after installation]
// For zsh: [Open.zshrc] & For bash: [Open .bashrc]
// Add the following:
export GO_HOME="$HOME/go"
export PATH="$PATH:$GO_HOME/bin"
// For fish: [Open config.fish]
// Add the following:
fish_add_path -aP $HOME/go/bin
- Get help
geng help
- Create a new project
geng new <project-name> -m <project-module-name> [-d <directory>]
- Use Interactive to create new project
geng new
- Start project
cd <directory>
cp .env.example .env
go mod tidy
go run main.go
- Generate module in already existing project
// Project needs to initialize git repository to work module generation
geng gen module <module-name>
NOTE: default supported version is of golang 1.20
- generate a new project
- get project module, project name and directory as command line argument
- generate a module
- refactor the code -> make code clean
- modify the parent features
module.go
when new module is added - implement CI for assets build
- add option to generate constructor of aws, gcp while project generation
- allow different template options when building project
- generate test case template
- generate hexagonal architecture
- generate route, controller and dtos from bru file
![image](https://private-user-images.githubusercontent.com/43813670/287495316-a0b11d39-e077-4038-852f-7b5b0adb27c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyODQ5MzcsIm5iZiI6MTcyNDI4NDYzNywicGF0aCI6Ii80MzgxMzY3MC8yODc0OTUzMTYtYTBiMTFkMzktZTA3Ny00MDM4LTg1MmYtN2I1YjBhZGIyN2M4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDIzNTcxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyMzBiMjc1Y2RmMzY1ZGIwOGIxYjRiZDgwYTI0MmI4YjNkZGJkYTM5NGM4OWRhYjVhYmQ3ZTE1NWFhZGUxNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Isqa_EMVIGF1BtrNRUWoekWxXWA2jNj3QpR4K2N29L0)
![image](https://private-user-images.githubusercontent.com/43813670/346583752-da07d8cc-8896-4a13-9b31-099958e65cb4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyODQ5MzcsIm5iZiI6MTcyNDI4NDYzNywicGF0aCI6Ii80MzgxMzY3MC8zNDY1ODM3NTItZGEwN2Q4Y2MtODg5Ni00YTEzLTliMzEtMDk5OTU4ZTY1Y2I0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDIzNTcxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIzOTVlYjViMThlMzY4MTEwMDIwY2VkMzkzMDFkYWVhMDZiMjdmNDkyZGExNzM2ZDIzODk0YWMzN2QwM2U2MjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.n9imdm3RElTcAstRnX7HY1csyTrn_JnXaULbWosfoxA)
Thank You!!!