agai

command module
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

README ΒΆ

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!

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL