This page reflects the options available in the most recent version of batect.
If you are not running the most recent version, run
./batect --help to see what options are available in your version.
Run a task¶
Run a task by running
./batect <task-name>. For example, to run
You can also pass arguments to the task command by passing those arguments by running
./batect <task-name> -- <args...>.
For example, to run the task
the-task with the arguments
arg1 arg2, run
./batect the-task -- arg1 arg2.
Disable cleaning up (
By default, batect will automatically cleanup all containers and other resources it creates while running a task. However, sometimes it can be useful to leave all the created containers running to diagnose issues running a task.
--no-cleanup-after-failureto not clean up if any task fails to start for any reason.
--no-cleanup-after-successto not clean up the containers and other resources created for the main task (the one specified on the command line) if it succeeds.
--no-cleanupto enable both of the above.
./batect --no-cleanup-after-failure the-task
Disable propagation of proxy-related environment variables (
By default, batect will automatically propagate proxy-related environment variables as described here. Use this option to disable this behaviour.
./batect --no-proxy-vars the-task
See a list of available tasks (
batect can produce a short summary of all tasks in the current configuration file along with their
grouped by their
./batect --list-tasks produces output like this:
Build tasks: - build: Build the application. Test tasks: - continuousUnitTest: Run the unit tests in watch mode. - unitTest: Run the unit tests once. Utility tasks: - outdated: Check for outdated dependencies. - shell: Start a shell in the development environment.
Upgrade batect (
./batect --upgrade will automatically upgrade batect in the current project to the latest
Get help for batect's CLI (
./batect --help will show a summary of the options available on the command line.
Get batect, Docker and OS version information (
./batect --version will show a summary of the versions of batect, Docker and your operating
system, which can be useful when diagnosing issues with batect.
Use a non-standard configuration file name (
By default, batect will use a configuration file called
batect.yml in the current directory.
Use this option to instruct batect to use a different file.
./batect --config-file my-other-config-file.yml the-task
Use a non-standard Docker host (
By default, batect will connect to the Docker daemon using the path provided in the
DOCKER_HOST environment variable, or
the default path for your operating system if
DOCKER_HOST is not set. Use this option to instruct batect to use a different path.
./batect --docker-host unix:///var/run/other-docker.sock the-task
Create a debugging log (
Use this option to instruct batect to generate a debugging log at the specified path as it runs. This may be requested if you submit an issue.
If the log file already exists, batect will append further log messages to the end of the file.
./batect --log-file /tmp/debugging-log.json the-task
Disable coloured output (
By default, batect will produce coloured output if it detects that your console supports it. However, sometimes batect may incorrectly believe your console supports coloured output, or your console may incorrectly report that it supports coloured output when it does not. (This is a common issue with some CI systems.) This can lead to garbled or difficult to read output.
Passing this flag will disable all coloured output, even if batect believes your console supports it.
./batect --no-color the-task
Disable update notification (
batect automatically checks for updates at most once every 24 hours and displays a notification if a newer version is available.
Passing this flag will disable both the update check and notification.
Force a particular output style (
batect offers four styles of output:
fancyis best for interactive use, providing very clean output about the current state of execution and showing output from only the task container
fancyoutput mode example
simpleis best for non-interactive use (eg. on CI), providing a log of what happened and showing output from only the task container
simpleoutput mode example
alldisplays output from all containers
alloutput mode example
quietdisplays only the output from the task and error messages from batect
quietoutput mode example
By default, batect will automatically pick an output style that it believes is appropriate for the environment it is running in -
fancy if it believes your environment supports it, or
Passing this flag allows you to override what batect believes is appropriate.
./batect --output simple the-task
- All command line options that take a value can be provided in