Jay Overview
Basic Usage
The command-line tool, Jay, has been mentioned throughout this documentation quite a few times now so it’s a good time to talk a little about the tool.
Jay uses the brilliant github.com/alecthomas/kingpin package to manage the help documents, commands, subcommands, and arguments. It takes care of groundwork so it can focus on the actual tasks.
If you ever want to see the help documents for a command or subcommand, add
-h
or --help
to the end and the help documentation should be able to assist.
If you are still having problems, check out the
Jay GoDoc.
When using Jay, there are flags, commands, and subcommands.
The available flags throughout are:
-h
or--help
for help documentation-v
or--version
for version information-c
or--config
to specify the env.json config file (otherwise JAYCONFIG environment variable will be used)
The available commands are:
jay env
for managing the env.json filejay find
for locating text inside files in subfoldersjay replace
for replacing text inside files in subfolderjay generate
for creating code based on templates using the text/template packagejay migrate:mysql
for managing the MySQL database state
The available subcommands are:
jay env make
for creating env.json from env.json.examplejay env keyshow
for showing newly generated session keysjay env updateshow
for updating env.json with newly generation session keysjay migrate:mysql make
for creating a new migration ‘up’ file and ‘down’ filejay migrate:mysql all
for applying all ‘up’ migrationsjay migrate:mysql reset
for applying all ‘down’ migrationsjay migrate:mysql refresh
for applying all ‘down’ then ‘up’ migrationsjay migrate:mysql status
for displaying the current database statejay migrate:mysql up
for applying only one ‘up’ migrationjay migrate:mysql down
for applying one one ‘down’ migration
There is also a common syntax used by each of the commands, subcommands, and arguments that make the help documents easy to follow.
- Flags have one or two dashes in the front:
-h, --help
- Commands follow the application name (jay):
jay migrate:mysql
- Subcommands follow the command:
jay migrate:mysql make
- Arguments follow the command or subcommand:
jay migrate:mysql make <description>
- Required arguments:
<required>
- Optional arguments:
[<optional>]