cleancli is a command-line tool designed to simplify the creation of boilerplate code for projects following the Clean Architecture pattern. This tool, built in Go, is fast, safe, and user-friendly.
- Add the executable to the path
$ cleancli
-
When prompted, input details such as:
- API URL:
v1/login/{type}
- Request Model (Picker with search):
LoginRequest
orNone
- Response Model (Picker with search):
LoginResponse
- Function Name:
userLogin
- File/Group Name:
user_authentication
- API URL:
-
The CLI will generate or update files in the appropriate directories, adhering to the Clean Architecture structure.
Here’s an example of the directory structure that is needed to us this tool
proj/
├── lib/
│
├── data/
│ ├── di
│ ├── network/
│ ├── entity/
│ ├── source/
│ └── repository/
└── domain/
├── di
├── usecase/
└── repository/
- Automation:
- Automatically generates:
- Data source files (e.g., network, local source) along with implementations and providers.
- Repository files with their implementations and providers.
- Use cases and their respective providers.
- Accepts minimal inputs such as:
- API URL
- Request model
- Response model
- Function name
- File name
- Smart Updates: If the file already exists, the tool intelligently updates it without overwriting the existing logic.
- Automatically generates:
- Ensure that Go is installed on your machine. Download Go
- Install Dart and Flutter on your machine. Flutter Install Guide
-
Clone the repository:
git clone https://github.com/vineeshvk/cleancli.git cd cleancli
-
Build the CLI:
go build -o cleancli
-
Run the CLI:
./cleancli