Hatchet CLI

The Hatchet Command Line Interface is build around the Symfony2 Console Component. You can read more about it here including how to create a command.

Using the CLI

Make sure you've changed to the directory of the project in Terminal/Command Prompt.

You can run the following to see what commands are available:


Writing your own commands

This sections assumes you already have a Bundle created. To learn more about Bundles click here.

All commands must follow the following rules:

  • The class name must end with Command.php
  • All commands must be in a Command folder within your Bundle

Below is an example of a command:

You can run the above command by running the following:

app/hatchet hello

Using the DI Container in a command

If you have your command implement Tomahawk\DI\ContainerAwareInterface it will get passed in for you. You will they have access to it through $this->container (if you named the property container that is).