Skip to content

Getting Started

Installation

Terminal window
brew install straubt1/tap/tfx

Configuration

Each command accepts flags, but the three required flags can be placed in a config file so you don’t have to pass them every time.

FlagEnvironment VariableDefault
--tfeHostnameTFE_HOSTNAMEapp.terraform.io
--tfeOrganizationTFE_ORGANIZATION(required)
--tfeTokenTFE_TOKEN(required)

Create .tfx.hcl in your home directory (~/.tfx.hcl) or the directory where you run tfx:

tfeHostname = "tfe.rocks"
tfeOrganization = "my-awesome-org"
tfeToken = "<token from HCP Terraform or TFE>"

You can also specify a config file explicitly with --config /path/to/.tfx.hcl.

Output

Most commands output a formatted table by default. Add --json (or -j) to get machine-readable JSON for scripting and CI pipelines.

$ tfx variable list -w tfx-test
╭──────────────────────┬───────────┬──────────────┬───────────┬───────┬───────────┬──────────────────────╮
│ ID │ KEY │ VALUE │ SENSITIVE │ HCL │ CATEGORY │ DESCRIPTION │
├──────────────────────┼───────────┼──────────────┼───────────┼───────┼───────────┼──────────────────────┤
│ var-7XYNuuo4tMjXeXG4 │ variable7 │ {"a":"1"...} │ false │ true │ terraform │ I am a map in a file │
│ var-MJaLJ7czxKuU48eu │ variable3 │ It is friday │ false │ false │ env │ I am environmental │
╰──────────────────────┴───────────┴──────────────┴───────────┴───────┴───────────┴──────────────────────╯
Terminal window
$ tfx variable list -w tfx-test --json | jq '.[].Key'
"variable7"
"variable3"