Tokaido Command Reference

Tokaido is a powerful utility with a large command line interface. This page documents all of these commands in alphabetical order.

You can also run tok help at any time for a quick reference point.

tok config-get

Retreive a configuration setting, whether it has been explicitly defined in the config YAML, or if it is th default value.

$ tok config-get tokaido betacontainers
false

$ tok config-get drupal
{
  Path: "/docroot",
  Majorversion: "",
}

tok config-set

Used to specify a config value. See the full configuration guide for more detail.

$ tok config-set tokaido betacontainers true

tok destroy

Used to destroy a Tokaido environment and all of it's contents, except the database. Use the --force flag to skip the confirmation prompt.

$ tok destroy --force

tok exec

Run commands via the Tokaido Shell (Drush) container.

$ tok exec "cd /tokaido/site/docroot && drush status"

Drupal version : 8.5.6
Site URI : default
DB driver : mysql
DB hostname : mysql
DB port : 3306
DB username : tokaido
...

tok logs

Get Docker logs from the specified Docker container

$ tok logs fpm

Attaching to project_fpm_1
fpm_1 | + shopt -s nullglob
fpm_1 | + drupal_root=docroot
fpm_1 | + tok_provider=
fpm_1 | + [[ -d /tokaido/site/docroot ]]
fpm_1 | + cd /tokaido/site/docroot

...

tok new

Generate a brand new Drupal project from the Ironstar template. Gives you everything you need to get started on your new site with Tokaido.

$ tok new fresh-drupal-project

🍚 Creating a brand new Drupal 8 site with Tokaido!
🏯 Generating a new docker-compose.tok.yml file

...

This command uses a combination of Tokaido docker images and Composer to install all the required modules. There is quite a bit to download during this process and can take between 5 to 20 minutes depending on your machine specs and internet connection.

tok open

Open the default browser pointing to this Tokaido instance.

$ tok open

You can also open the site logged in as an administrator with the --admin flag

$  tok open --admin

tok ports

List available ports for a Docker container

$ tok ports haproxy

32773

tok ps

Alias for the docker-compose ps command. Shows the Tokaido containers and their status.

$ tok ps

Name                          Command                                    State     Ports
--------------------------------------------------------------------------------------------------------------
myproject_drush_1      /usr/local/bin/entrypoint.sh    Up      0.0.0.0:32769->22/tcp
myproject_fpm_1         /usr/local/bin/entrypoint.sh    Up      0.0.0.0:32770->9000/tcp
myproject_haproxy_1 /usr/local/bin/entrypoint.sh     Up      0.0.0.0:32774->8080/tcp, 0.0.0.0:32773->8443/tcp

...<snip>

tok status

Perform a systems self-check to test the readiness of the various Tokaido components.

$ tok status

✅ All containers are running
✅ SSH access is configured
✅ Background sync service is running
✅ Drupal is listening on HTTPS
🍜 Checks have passed successfully
🌎 Run 'tok open' to open the environment at 'https://localhost:32773' in your default browser

tok stop

Stop or pause the Tokaido Docker environment without deleting the database. You can revert this with tok up at any time.

$ tok stop

🚉 Tokaido stopped your containers successfully!
🔄 Removed the background sync process

tok sync

Perform a one-time sync of files between your local system and the Tokaido environment. This command doesn't provide any output

$ tok sync

tok syscheck

Perform a self-check for your system's readiness to run Tokaido

$ tok syscheck

🚅 Checking Drupal for compatibility with Tokaido

...

tok test

Configure and run all tests in the test suite. Currently this only supports the Drupal Nightwatch test suite, but more will be added in the future.

See: https://www.lullabot.com/articles/nightwatch-in-drupal-core for more information on Drupal Nightwatch.

$ tok test

Info

Note that Drupal Nightwatch requires a Drupal version of 8.6 or higher in order to run.

tok test:nightwatch

Run the Drupal Nightwatch test suite

See: https://www.lullabot.com/articles/nightwatch-in-drupal-core for more information on Drupal Nightwatch.

$ tok test:nightwatch

tok up

Start a Tokaido environment, either for the first time or to initialise a new project.

$ tok up

🚀 Tokaido is starting up!
🔄 Creating a background process to sync your local repo into the Tokaido environment
...

tok version

Print the Tokaido version

$ tok version

Tokaido Version: v0.0.12-1-14-g9cc4124
Build Date: 2018-08-04T06:17:18Z
Compiler: go1.10.3
Platform: linux/amd64

tok watch

Run the Unison sync service in the foreground until closed (with CTRL+C)

$ tok watch

Watching your files for changes and synchronising with your container
Please keep this command running in order to retain sync
Unison 2.51.2 (ocaml 4.06.0): Contacting server...
Connected [//32ca98257524//tokaido/site -> //forge//code/myproject]
Looking for changes
Waiting for changes from server
Notice something wrong? Shoot us a PR!