Getting Started
CLI
Request handling
- Routing
- Action Controller
- Resources
- Context
- Request Binding
- Middleware
- Error Handling
- Sessions
- Cookies
Frontend
Database
- Getting started with Pop
- Soda CLI
- Database Configuration
- Buffalo Integration
- Models
- Generators
- Migrations
- Fizz
- Mutations
- Querying
- Raw Queries
- Callbacks
- Scoping
- Associations and Relationships
- One to one associations
- One to many associations
Guides
- API Applications
- File Uploads
- Background Job Workers
- Mailers
- Tasks
- Local Authentication
- Third Party Authentication
- Events
- Go Modules
- Localization
- Logging
- Template Engines
- Testing
- Videos
Deploy
CLI
Base Commands
The Buffalo CLI ships with a set of commands that are used to accelerate the development of applications that use the Buffalo framework and libraries. On this page we will describe each of these as well as the options to extend them (when extensible).
Help
Provides help for a given command or in general about the CLI, This is one of the mandatory commands, every CLI instance has it. When invoked without any arguments it will print the list of available commands. Otherwise will list the help for the given command.
p.e.
$ buffalo help plugins
Usage: buffalo plugins [options]
List plugins loaded to the CLI.
Interfaces it considers:
- HelpTexter
- LongHelpTexter
- Usager
- Aliaser
Plugins
The plugins command lists the plugins that the CLI has loaded, his is handy when trying to modify the CLI plugins. It considers the Command interface to sort the plugins by showing first the commands and then the rest. p.e:
Plugins loaded (38):
help [command] Provides help for a given command, p.e. buffalo help list.
...
new [command] Creates a new Buffalo application
destroy [command] Destroys files generated by Buffalo
build [command] Build the application binary, including bundling of webpack assets
dev [command] Run the Buffalo app in 'development' mode
db [command] A tasty treat for all your database needs
create [other] Creates databases for you
drop [other] Drops databases for you
fix [other] Brings pop, soda, and fizz files in line with the latest APIs
migrate [other] Runs migrations up or down. Also, provides the status of the migrations.
reset [other] Drop, then recreate databases
...
Test
Runs application tests after invoking the BeforeTester
plugins. It could be overriden by changing the Tester
it runs or adding additional testers.
$ buffalo help test
Usage: buffalo test [options]
Runs application tests by invoking related plugins.
BeforeTesters:
test_environment Sets the GO_ENV environment to be 'test'.
pop/setup-database Sets the database up before the tests run.
Testers:
buffalo/tester buffalo/tester
Interfaces it considers:
- BeforeTester: Plugins to run before running the tests
- Tester: Tests to run.
Version
Prints the version of the CLI in plain and JSON formats.
Task
Runs grift tasks with the passed arguments.
Routes
Prints a list of all defined routes
Setup
Setups a newly created, or recently checked out application.
Info
Prints diagnostic information (useful for debugging)
Generate
Generates code blocks in the source code, aiming to accelerate software development.
Fix
Attempt to fix a Buffalo application’s API to match version v0.18.4
New
Creates a new Buffalo application
Destroy
Destroys files generated by Buffalo
Build
Build the application binary, including bundling of webpack assets
Dev
Run the Buffalo app in ‘development’ mode
Pop (db)
A tasty treat for all your database needs