logo Buffalo slack logo
Overview
CLI

Overview of the Buffalo CLI

The Buffalo CLI is the tool that facilitates the development of applications that use the Buffalo framework and libraries, workflow steps like running the development server or building the application are done by the CLI. The CLI is the one we invoke when calling buffalo in our terminal or VSCode.

Commands

The Buffalo CLI ships with a set of commands that can be used to perform common tasks. In order to see the list of commands we could invoke the CLI help with:

$ buffalo help

Usage: buffalo [command] [flags] [...]

Available Commands:
help          Provides help for a given command, p.e. buffalo help list.
plugins       List plugins loaded to the CLI.
test          Runs application tests by invoking related plugins.
version       Prints the version of the CLI in plan 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
db            A tasty treat for all your database needs

For command specific information use the help command, p.e.
$ buffalo help [command]

Which as you can see will render the list of available commands as well as a brief description for each of them. One could get more detailed on each of these by using the help command. p.e:

$ buffalo help db

Usage: buffalo db <subcommand> [flags] [options] 

A tasty treat for all your database needs

Aliases:
  pop, database

Subcommands
  create     Creates databases for you
  drop       Drops databases for you
  fix        Brings pop, soda, and fizz files in line with the latest APIs
  migrate    Runs migrations up or down. Also, provides the status of the migrations.
  reset      Drop, then recreate databases
  generate   Generates config, model, and migrations files.
  schema     Tools for working with your database schema


Flags:
  --config   the path to the config file
  --env      the environment to use

And get detailed information on the command that we want to use.