CLI Commands
The beans CLI provides powerful commands to scaffold, manage, and develop your Lua on Beans applications.
Scaffold controllers, models & more
Migrations & database setup
Dev server & file watching
add_box Generator Commands
Quickly scaffold new components for your application.
$ beans create controller posts
Creates app/controllers/posts_controller.lua with basic CRUD actions
$ beans create model post
Creates app/models/post.lua with standard database operations
$ beans create scaffold posts
Creates controller, model, and views for a complete CRUD resource
$ beans create migration add_indexes_to_posts
Creates a new migration file in migrations/ for schema changes
storage Database Commands
Manage your database schema with migrations.
$ beans db:setup
Sets up the database according to your configuration
$ beans db:migrate
Executes all pending database migrations
$ beans db:rollback
Reverts the last applied migration
play_arrow Development Commands
Commands for local development workflow.
$ beans dev
Starts the development server with live reload on port 8080
$ beans specs
Runs the test suite for your application
list Command Reference
Quick reference for all available commands.
| Command | Description |
|---|---|
beans new <name> |
Create a new Lua on Beans project |
beans dev |
Start development server |
beans -w |
Watch mode (auto-rebuild CSS/JS) |
beans create controller <name> |
Generate a new controller |
beans create model <name> |
Generate a new model |
beans create scaffold <name> |
Generate controller, model, and views |
beans create migration <name> |
Generate a database migration |
beans db:setup |
Set up the database |
beans db:migrate |
Run pending migrations |
beans db:rollback |
Rollback last migration |
beans specs |
Run test suite |
Usage Tips
After migrations: Always run beans db:migrate after creating a new migration or pulling changes that include new migrations.
Rapid prototyping: Use beans create scaffold to quickly prototype new features with a complete CRUD setup.
Testing: Run beans specs regularly to ensure your changes haven't broken existing functionality.
Watch mode: Use beans -w during development to automatically recompile Tailwind CSS and Riot.js when you make changes.