Basic CLI Usage
Now that you have UserFrosting installed, it's important to understand how to use Bakery, the command-line interface (CLI) tool. You'll rely on Bakery throughout your development workflow—from starting the development server to managing your database and clearing caches. This page covers the essential commands you'll use most frequently. For a complete reference of all available commands and how to create your own, see the Bakery CLI chapter.
Note
All Bakery commands are executed in your terminal or command prompt—the same one you used during installation. Make sure you're in your project's root directory before running any commands.
Running Commands
All Bakery commands are run from your project's root directory using:
php bakery <command>
You can see a list of all available commands by running:
php bakery list
For help with a specific command:
php bakery help <command>
Essential Commands
Starting the Development Server
The serve command starts UserFrosting's built-in development server:
php bakery serve
By default, this starts the server at http://localhost:8080. You can specify a different host and port:
php bakery serve --host=0.0.0.0 --port=8000
Warning
The built-in server is for development only. Never use it in production. See the Going Live chapter for production deployment options.
Initial Setup
When setting up a new project or after pulling updates, run the bake command to execute all setup tasks:
php bakery bake
This single command runs multiple setup operations:
- Clears the cache
- Runs database migrations
- Compiles frontend assets
- Sets up configuration files (on first run)
For a fresh installation, you can also use the interactive setup wizard:
php bakery setup
This guides you through:
- Environment configuration (.env file)
- Database connection
- SMTP configuration (optional)
- Running migrations
- Creating the root user account
Database Migrations
Run pending database migrations without the full bake process:
php bakery migrate
To see which migrations have been run or are pending:
php bakery migrate:status
Clearing the Cache
When you make configuration changes or template updates, clear the cache:
php bakery clear-cache
Debugging Information
Get helpful debugging information about your UserFrosting installation:
php bakery debug
This shows:
- UserFrosting version
- PHP version and configuration
- Database connection status
- Loaded sprinkles
- Environment settings
What's Next?
These commands will get you through most day-to-day development work. As you build your application, you'll discover many more commands for:
- Creating and managing users
- Running database seeders
- Testing email configuration
- Building and watching assets
- Creating custom commands for your own tasks
For a complete reference and advanced features, see the Bakery CLI chapter.