lessgo-cli
is a command-line tool designed to scaffold and manage projects using the LessGo framework. It simplifies the process of setting up a new project with pre-defined directory structures, boilerplate code, and configurations.
- Quick Project Initialization: Scaffold a new LessGo project in seconds with a single command.
- Pre-configured Boilerplate: Includes a basic project structure with ready-to-use controllers, modules, and services.
- Easy Version Management: Check the CLI version with the
--version
flag. - Modular Structure: Follow a modular approach similar to the one used in NestJS, tailored for Go.
To install the lessgo-cli
, run the following command:
go install github.com/hokamsingh/lessgo-cli@latest
Make sure $GOPATH/bin
is added to your system's PATH to run the CLI tool from anywhere.
For Windows users, you can add the GOPATH to your system’s PATH as follows:
- Press
Win + R
, typesysdm.cpl
, and press Enter. - Go to the "Advanced" tab and click "Environment Variables."
- Under "System variables," find the
Path
variable and click "Edit." - Add a new entry with
$(go env GOPATH)\bin
. - Click "OK" to save and apply the changes.
For Linux users, ensure that your GOPATH
binaries directory (usually ~/go/bin
) is included in your system's PATH
. Follow these steps:
- Open your terminal.
- Edit your shell configuration file (
~/.bashrc
,~/.zshrc
, etc.) with your favorite text editor:ornano ~/.bashrc
nano ~/.zshrc
- Add the following line at the end of the file:
export PATH=$PATH:$(go env GOPATH)/bin
- Save the file and exit the editor.
- Reload your shell configuration:
or
source ~/.bashrc
source ~/.zshrc
- Now you should be able to run
lessgo-cli
from anywhere in your terminal.
To create a new LessGo project, run:
lessgo-cli new myapp
Replace myapp
with your desired project name. The CLI will create a new directory with the specified name, containing the scaffolded project structure.
To check the version of the CLI, run:
lessgo-cli --version
This will display the current version of lessgo-cli
you have installed.
When you run lessgo-cli new myapp
, the following project structure is created:
myapp/
├── app/
│ ├── cmd/
│ │ └── main.go
│ └── src/
│ ├── app_controller.go
│ ├── app_module.go
│ └── app_service.go
├── go.mod
└── go.sum
cmd/main.go
: Entry point of your application.src/
: Contains controllers, modules, and services for your application.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or feedback, feel free to reach out:
- GitHub: hokamsingh/lessgo-cli
- Email: hokamsingh07@gmail.com