gardenCLI is how you work with Garden in most scenarios, during development and in CI pipelines. It features a fairly large number of commands, so we'll list the most common ones below. You can run
garden --helpto list them, and use
garden <command> --helpto learn more about individual commands, arguments, option flags, usage examples etc. You can also find a full reference here.
--envsets the environment (and optionally namespace) that the command should act on. Most Garden commands only act on a specific environment, so in most cases you'll specify this, unless you're working on the default environment for the project. See here for more about environments and namespaces.
-lsets the log level. Use e.g.
-l=debugto get debug logs for the command.
--logger-type=basicdisables the fancy log output (with spinners etc.) and just prints a simple line-by-line output. Setting
GARDEN_LOGGER_TYPE=basicdoes the same thing. You should set that environment variable in CI and other automated environments.
-osets the output format. Use this to get structured output from the commands.
--output=jsonoutputs JSON, and
--output=yamloutputs YAML. The structure of the outputs is documented in the reference for most commands.
=between the flag and the value.
shis available in the container.
integtest, defined in
my-module, and watches for changes (including changes in modules and services that the test depends on).
garden test, in comparison, is more meant to run multiple ones or watch for changes, and is less suitable for getting log output).
garden devcommand builds, deploys and tests all parts of your project, and also runs any tasks that are listed as dependencies for your services and tests. It then waits for any code changes, and automatically re-builds, re-deploys and re-runs any parts affected by your code changes.
garden.ymlwith a project definition in the current directory, and a
garden.ymlwith a module definition in the current directory. You'll get an interactive menu to select a module type. You may get suggestions for appropriate module types, depending on which files are found in the directory (such as a
containermodule when a
providersin your project configuration) may include specific commands that help with their usage and operation. The available commands will depend on which providers are configured in your project.
garden pluginswithout arguments to list the available commands.
garden toolscommand exposes these tools, so that you can use them without having to install them separately. You can also use these to ensure that you're using the exact same versions as the Garden plugins.
gt docker build .to run
docker build .using the Garden-provided version of the
garden toolsto get a full list of available tools, and
garden tools --helpfor more usage information.
--is necessary to distinguish between Garden options, and kubectl arguments. See above for a shorthand function you can put in your shell profile.
kubectlbinary defined by the
kubernetesprovider, downloading it first if necessary.