Skip to main content

fh CLI

Beta

fh is ready to use. Command shapes may still change before 1.0.

fh is a single binary for Kpow, Flex, Iglu and Factor Platform. It calls the same REST API as the web UI.

Install

brew install factorhouse/tap/fh

Or download an archive, extract it and put fh on your PATH:

PlatformDownload
macOS (Apple silicon)fh_darwin_arm64.tar.gz
macOS (Intel)fh_darwin_amd64.tar.gz
Linux (arm64)fh_linux_arm64.tar.gz
Linux (x86-64)fh_linux_amd64.tar.gz
Windows (x86-64)fh_windows_amd64.zip

Versioned archives, checksums.txt and its cosign signature are at https://downloads.factorhouse.io/fh/<tag>/.

First run

fh config configure     # API URL, context name, sign-in, default tenant and cluster
fh kafka topic list

configure asks how the deployment authenticates: nothing (Community Edition), username and password, or OpenID Connect. See Authentication.

Config file

~/.fh/config.yaml, mode 0600. One context per deployment:

current_context: kpow-dev
theme: fh-dark
contexts:
kpow-dev:
base_url: https://kpow-api.dev.example.com
tenant: Everything
cluster: 9FzrorVMTLCt0eq6RIOr8g
oidc_client_id: <public-client-id>

Keys per context: base_url, username, password, insecure, tenant, cluster, oidc_client_id, oidc_callback_port. theme is file-wide. Edit the file or use fh config set <key> <value>.

Precedence: flag or environment variable, then the context, then the built-in default. FH_BASE_URL, FH_USERNAME, FH_PASSWORD, FH_TENANT, FH_OUTPUT, FH_CONTEXT, FH_AUTH, FH_THEME and FH_PAGER map to the flags of the same name. --config points at another file.

Shape

fh <product> <resource> <verb> [arguments] [flags]

The target is an argument; scope such as the cluster is a flag or a configured default.

fh kafka topic get orders
fh kafka group get analytics --cluster abc123
fh platform user get

--help works at every level. A product name may be shortened to an unambiguous prefix: fh k topic list.

Output

Tables by default. -o json or -o yaml prints the unmodified API response:

fh kafka topic list -o json | jq -r '.topics[].topic_name'

Tables take --limit N, --sort-by <column>[:desc] and repeatable --filter column=value. --no-pager and --no-wrap are available. --debug prints each request, status and duration to stderr.