About Commands
Test Kitchen is driven entirely from the kitchen command line tool. Every subcommand follows the same shape:
kitchen SUBCOMMAND [INSTANCE|REGEXP|all] [FLAGS]
Run kitchen help for the full list, or kitchen help SUBCOMMAND for the flags a single subcommand accepts.
Choosing which instances to act on
An instance is one suite paired with one platform. If your kitchen.yml defines two suites and three platforms, you have six instances. Every subcommand that operates on instances accepts the same target argument:
| Target | Meaning |
|---|---|
| (omitted) | Every instance. Equivalent to all for most subcommands. |
all |
Every instance. |
default-ubuntu-2204 |
One instance, matched by its full name. |
default |
A Ruby regular expression. Matches every instance whose name contains default. |
^default.*2204$ |
Anchored regular expression, for when a loose match is too broad. |
The argument is a regular expression, not a glob. kitchen converge ubuntu converges every instance with ubuntu anywhere in its name, and kitchen converge '.*' is the same as kitchen converge all.
*, ?, and | are meaningful to your shell and will be expanded before kitchen ever sees them.The instance lifecycle
Instances move through a fixed sequence of states. Each state has a subcommand, and running any subcommand also runs every earlier action the instance has not completed yet.
destroy → create → converge → setup → verify → destroy
| State | Subcommand | What happens |
|---|---|---|
| create | kitchen create |
The driver builds the compute instance. |
| converge | kitchen converge |
The provisioner configures the instance. |
| setup | kitchen setup |
The verifier installs whatever it needs to run tests. |
| verify | kitchen verify |
The verifier runs the tests. |
| destroy | kitchen destroy |
The driver tears the instance down. |
Because the actions are cumulative, kitchen verify on a fresh checkout will create the instance, converge it, and set it up before running a single test. You rarely need to call create or setup yourself.
kitchen test runs the whole cycle from a clean slate and is the command you want in CI.
Flags shared by most subcommands
Every instance-oriented subcommand accepts these logging flags:
| Flag | Alias | Description |
|---|---|---|
--log-level LEVEL |
-l |
Set the log level: debug, info, warn, error, or fatal. |
--log-overwrite |
Set to false to keep previous log files instead of overwriting them on each run. |
|
--color |
Toggle color output on STDOUT. Defaults to on when STDOUT is a TTY. | |
--test-base-path PATH |
-t |
Set the base path Test Kitchen searches for tests. |
The five lifecycle subcommands and kitchen test additionally accept:
| Flag | Alias | Description |
|---|---|---|
--concurrency [N] |
-c |
Act on matching instances concurrently. With no number, all matching instances run at once. |
--parallel |
-p |
Deprecated. Use --concurrency. |
The five lifecycle subcommands — but not kitchen test — also accept --fail-fast (-f), which stops as soon as any instance fails instead of letting the rest finish. kitchen converge and kitchen verify accept --debug (-D) to run the provisioner or verifier in debug mode.
--concurrency with no argument means unlimited, which on a large matrix will happily start dozens of cloud instances at once. Pass a number you actually want: kitchen test -c 4.
Command reference
Lifecycle
kitchen create— start instanceskitchen converge— apply your configurationkitchen setup— prepare instances for testingkitchen verify— run testskitchen destroy— tear instances downkitchen test— run the full cycle
Inspecting and debugging
kitchen list— show instances and their statekitchen doctor— check for common problemskitchen diagnose— dump the fully computed configurationkitchen logs— read structured logskitchen login— open a shell on an instancekitchen exec— run one command on instances
Project and environment
kitchen init— add Test Kitchen to a projectkitchen package— turn an instance into an artifactkitchen console— interactive Ruby consolekitchen version— print the version
Configuration file locations
kitchen reads up to three YAML files and merges them, in increasing order of precedence:
| File | Environment variable | Purpose |
|---|---|---|
~/.kitchen/config.yml |
KITCHEN_GLOBAL_YAML |
Personal defaults across every project. |
kitchen.yml |
KITCHEN_YAML |
The project’s committed configuration. |
kitchen.local.yml |
KITCHEN_LOCAL_YAML |
Uncommitted local overrides. |
Use KITCHEN_YAML to keep several configurations side by side:
KITCHEN_YAML=kitchen.dokken.yml kitchen test
.kitchen.yml filename, with a leading dot, still works. kitchen.yml is preferred for new projects.