Getting Started
Installation
brew install straubt1/tap/tfxFrom Go version 1.19+:
go install github.com/straubt1/tfx@latest@latest can be replaced with a specific version, e.g. @v0.2.1.
docker pull ghcr.io/straubt1/tfx:latestDownload the latest binary from the Releases page.
Authentication
The fastest way to authenticate is with tfx login. It walks you through creating a profile, validating your API token, and selecting an organization.
# HCP Terraform (default: app.terraform.io)tfx login
# Terraform Enterprisetfx login tfe.mycompany.comThe login flow will:
- Ask for a profile name (defaults to
default) - Let you open a browser to create a token or enter one directly
- Validate the token against the API
- Let you select a default organization
- Save the profile to
~/.tfx.hcl
Once login completes, run tfx to launch the TUI or use CLI commands directly.
TUI vs CLI
TFx provides two ways to interact with your infrastructure:
| Interactive TUI | CLI Commands | |
|---|---|---|
| Launch | tfx | tfx <command> (e.g., tfx ws list) |
| Best for | Exploring, browsing, investigating | Scripting, automation, CI/CD |
| Output | Terminal UI with keyboard navigation | Tables or JSON (--json) |
| Authentication | Same config file and profiles | Same config file and profiles |
Both modes share the same configuration, API client, and authentication. Use whichever fits your workflow — or both.
Config file
tfx login writes profiles to ~/.tfx.hcl. You can also create or edit this file manually.
Profile format
Each profile is a named block containing your connection details:
profile "default" { hostname = "app.terraform.io" organization = "my-org" token = "my-token"}You can define multiple profiles for different environments:
profile "staging" { hostname = "tfe.staging.myco.internal" organization = "my-org-staging" token = "staging-token"}
profile "production" { hostname = "tfe.myco.internal" organization = "my-org" token = "my-token"}Profile properties
| Property | HCL key | Default | Required |
|---|---|---|---|
| Hostname | hostname | app.terraform.io | No |
| Organization | organization | (none) | No |
| Token | token | (none) | Yes |
Selecting a profile
By default, TFx uses the profile named default. To use a different profile:
# Launch the TUI with a specific profiletfx --profile staging
# Use with CLI commandstfx workspace list --profile staging
# Via environment variableTFX_PROFILE=staging tfx workspace listThe TUI also reads the active profile and displays it in the profile bar at the top of the screen.
Config file discovery
TFx looks for .tfx.hcl automatically — no flag required:
./.tfx.hcl— current working directory (checked first)~/.tfx.hcl— home directory (fallback)
To use a specific file instead, set either:
--config-file /path/to/.tfx.hclflag, orTFX_CONFIG_FILE=/path/to/.tfx.hclenvironment variable
The flag takes precedence over the env var; both override auto-discovery.
Configuration precedence
When the same setting is specified in multiple places, the highest-precedence source wins:
- CLI flags (
--hostname,--organization,--token) — highest - Environment variables (
TFE_HOSTNAME,TFE_ORGANIZATION,TFE_TOKEN) - Profile values from
.tfx.hcl - Defaults (
hostnamedefaults toapp.terraform.io)