Command Line Interface (CLI)
Terramate comes with a rich command-line interface, supporting verbosity levels, logging levels, multiple sub-commands (+experimental), autocompletion and more.
To view a list of available commands and global flags, execute
terramate --help. All sub-commands support the
--help flag as well for specific details.
-h, --helpShow context-sensitive help..
-C, --chdir=STRINGSets working directory.
-B, --git-change-base=STRINGGit base ref for computing changes.
-v, --verbose=0Increase verboseness of output.
--tags=TAGSFilter stacks by tags. Use ":" for logical AND and "," for logical OR. Example: --tags app:prod filters. Stacks containing tag "app" AND "prod". If multiple --tags are provided, an OR expression is created. Example: "--tags a --tags b" is the same as "--tags a,b".
--no-tags=NO-TAGS,...Filter stacks that do not have the given tags.
--log-level="warn"Log level to use: 'disabled', 'trace', 'debug', 'info', 'warn', 'error', or 'fatal'
--log-fmt="console"Log format to use: 'console', 'text', or 'json'.
--log-destination="stderr"Destination of log messages.
Terramate supports autocompletion of commands for
fish. To install the completion just run the following command:
CLI Configuration File
Terramate supports a per-user configuration file called
terramate.rc on Windows) which applies to all Terramate projects in the user's machine by setting up default values for some CLI flags.
The configuration file is a simple HCL file containing top-level attributes. The attribute expressions must only contain literal values (
string, etc) and no function calls.
Not all CLI flags can be configured by the configuration file.
Below is a list of options:
Configures an alternative location for the local
%APPDATA%/.terramate.d on Windows).
When set to
true, disables upgrade and security bulletin checks. This is similar to exporting the
DISABLE_CHECKPOINT=1 environment variable.
when set to
true, still allows the upgrade and security bulletin checks described above but disables the use of an anonymous id used to de-duplicate warning messages.
The configuration should be placed in a different path depending on the operating system:
On Windows, the file must be named
terraform.rc and placed in the user's
%APPDATA% directory. The location of this directory depends on your Windows version and system configuration. You can use the command below in PowerShell to find its location:
On Unix-based systems (Linux, MacOS, *BSD, etc), the file must be named
.terraformrc and placed in the home directory of the relevant user.
The default location of the Terramate CLI configuration file can also be specified using the
TM_CLI_CONFIG_FILE environment variable. Example:
TM_CLI_CONFIG_FILE=/etc/terramaterc terramate run -- <cmd>