Agai Handler
Program to manage Agai Projects and it's files and functionality to make it smooth for the users
How to initialise the application
go mod tidy
go mod vendor
Argument/ Flags for the application
βοΈ Runtime & Utility Flags
| Flag |
Description |
| --start-app, -sa |
Launch the application server. |
| --start-handler, -sh |
Start development handler (for auto-reload, background tasks). |
| --migrate-model, -mm |
Apply database migrations for models. |
| --migrate-component, -mc |
Migrate components to keep in sync with the database. |
π§ Creation Flags
| Flag |
Description |
| --create-app, -ca |
Create a new application.Example: --create-app blog |
| --create-controller, -cc |
Generate a new controller.Example: --create-controller post |
| --create-model, -cm |
Generate a new model.Example: --create-model user |
| --create-component |
Create a component (like a reusable layout part).Example: --create-component nav |
| --create-view, -cv |
Create views for a controller.Optionally specify controller: --create-view post |
π Help & Configuration Flags
| Flag |
Description |
| --help, -h |
Display general help and available flags. |
| --help-web-config, -hwc |
Show help for web server configuration (port, host, static folders, etc.). |
| --help-database-config, -hdc |
Show help for database configuration and environment overrides. |
| --help-session-config, -hsc |
Show help for session store settings. |
| --help-smtp-config, -hsm |
Show help for configuring SMTP settings for email. |
π§ͺ Example
go run . --create-app blog \
--create-controller post \
--create-model post \
--create-view \
--start-app
ποΈ Create a Full Application with Controller, Model & View
go run . --create-app blog \
--create-controller post \
--create-model post \
--create-view \
--start-app
What it does:
- Creates a new app called
blog
- Adds a
post controller and model
- Generates default views for the
post controller
- Immediately starts the server
π§± Create Only a Controller and View (for existing app)
go run . --create-controller comment \
--create-view comment
What it does:
- Adds a new
comment controller
- Generates views for
comment controller only
π Generate Multiple Controllers in One Go
go run . --create-controller post \
--create-controller comment \
--create-controller user
What it does:
- Adds three new controllers:
post, comment, and user
You can also generate views in the same command:
go run . --create-controller user --create-view user
go run . --create-component navbar
What it does:
- Creates a reusable component named
navbar
π οΈ Run Dev Handler for Auto Reloading
go run . --start-handler
What it does:
- Starts the CLIβs built-in dev handler to automatically reload on changes or run background tasks
π§³ Migrate Models and Components
go run . --migrate-model --migrate-component
What it does:
- Runs database migrations for all models and syncs component data
π Show Config Help
go run . --help-web-config
go run . --help-database-config
go run . --help-smtp-config
What it does:
- Prints helpful explanations and examples for each config file (
web.json, database.json, etc.)
π Show General Help
go run . --help
What it does:
- Lists all available CLI flags with short descriptions
π Combine Any Flags
go run . --create-app shop \
--create-controller product \
--create-model product \
--create-component cart \
--create-view \
--start-handler
This sets up a full eCommerce scaffold with product model, controller, component, and auto-handler.
Let me know if you'd like a web-config snippet, flag groupings by use-case, or badges (Go version, build status) added to the README!