A simple, powerful CLI generator for Node.js in general and Total.js specicially, with AI-enhanced output and custom project configuration.
npm install -g totalgen
Run in terminal:
tg <command> <name> [--prompt="enhance with AI"]
- Template files generation commands
tg generate:migration create_users_table
tg generate:controller user
tg generate:plugin auth --prompt="secure JWT login system"
- Migrations specific commands
tg migrate # Run migrations
tg migration:migrate # Run migrations
tg migration:rollback # Run migrations rollback operation to revert
-
Generate files for:
migration
controller
schema
plugin
-
AI Integration with
--prompt
: -
Enhance generated files using your prompt (e.g. "add validation", "make RESTful", etc.)
-
Configurable via
tgconfig.json
: -
Set your preferred structure
-
Define AI integration keys and presets
You can place a tgconfig.json
at the root of your project:
{
"debug": false,
"location": "/",
"table": "migrations",
"db": {
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "postgres",
"database": "tgconfig",
"link": "postgresql://user:password@hostname:5432/database"
},
"ai": {
"enabled": true,
"provider": "openai",
"apiKey": "YOUR_API_KEY"
}
}
tg plugin notification --prompt="create a plugin to send email and SMS alerts"
The output will be enhanced based on your prompt using your preferred AI provider.
- CLI Generator: controller, migration, schema, plugin
-
tgconfig.json
support - AI prompt enhancement (
--prompt
) - Route auto-injection
- Custom file templates
Built with precision by Louis Bertson GitHub: @louisbertson
Found a bug or want to add a new generator? Pull requests welcome. Open an issue or fork it!
MIT