Getting Started

CLI Reference

The lattice CLI manages cluster lifecycle, authentication, and fleet operations.

lattice install

Provision a new cluster from a LatticeCluster manifest. Creates a temporary kind bootstrap cluster, provisions infrastructure via Cluster API, then pivots CAPI resources into the new cluster.

terminal
$ lattice install -f cluster.yaml
lattice install flags
Flag Type Description
-f, --file path Path to LatticeCluster YAML file. Required.
--image string Lattice container image. Default: ghcr.io/evan-hines-js/lattice:latest.
--registry-credentials-file path Path to .dockerconfigjson for private registries.
--bootstrap string Override bootstrap provider: rke2 or kubeadm.
--kubeconfig-out path Write cluster kubeconfig to this path after installation.
--keep-bootstrap-on-failure bool Skip kind cluster deletion on failure (for debugging).
--dry-run bool Show what would be done without making changes.
--run-id string Auto-generated unique ID for parallel runs.

lattice uninstall

Tear down a cluster. Unpivots CAPI resources to a temporary bootstrap cluster, then deletes all infrastructure.

terminal
$ lattice uninstall --kubeconfig /path/to/cluster-kubeconfig
lattice uninstall flags
Flag Type Description
-k, --kubeconfig path Path to kubeconfig for the cluster to uninstall. Required.
-n, --name string Cluster name (if different from context).
-y, --yes bool Skip confirmation prompt.
--keep-bootstrap-on-failure bool Skip kind cluster deletion on failure.
--run-id string Auto-generated unique ID for parallel runs.

lattice login

Authenticate with a Lattice cluster. Discovers the proxy server and fetches a kubeconfig with exec-based token refresh.

terminal
# Auto-discover from management kubeconfig
$ lattice login --kubeconfig /path/to/mgmt-kubeconfig

# Direct server URL
$ lattice login --server https://lattice.example.com --token <token>

# Refresh existing login
$ lattice login --refresh
lattice login flags
Flag Type Description
--kubeconfig path Path to management cluster kubeconfig (for auto-discovery).
--server string Lattice proxy server URL (overrides auto-discovery).
--token string Bearer token (overrides auto-generated SA token).
--namespace string ServiceAccount namespace. Default: lattice-system.
--service-account string ServiceAccount name. Default: default.
--refresh bool Re-fetch kubeconfig using saved configuration.
--insecure bool Skip TLS certificate verification.

lattice logout

Clear saved credentials and proxy kubeconfig.

terminal
$ lattice logout

lattice use

Switch the active cluster context.

terminal
$ lattice use prod
lattice use arguments
Argument Type Description
cluster string Cluster name to switch to. Required.

lattice token

Generate an ExecCredential token for kubectl exec-based authentication.

terminal
$ lattice token --kubeconfig /path/to/cluster-kubeconfig
lattice token flags
Flag Type Description
--kubeconfig path Path to kubeconfig. Falls back to KUBECONFIG env.
-n, --namespace string ServiceAccount namespace. Default: lattice-system.
-s, --service-account string ServiceAccount name. Default: default.
-d, --duration string Token duration. Default: 1h.

lattice get

Query cluster resources.

lattice get clusters

List all LatticeCluster resources.

terminal
$ lattice get clusters
NAME       PHASE   PROVIDER  K8S     CP   WORKERS  ROLE    AGE
mgmt       Ready   aws       1.32.0  3/3  10/10    parent  45d
prod       Ready   aws       1.32.0  3/3  20/20    parent  30d
staging    Ready   proxmox   1.32.0  1/1  5/5      parent  15d

lattice get cluster <name>

Show detailed status for a single cluster.

terminal
$ lattice get cluster production

lattice get hierarchy

Display the parent-child cluster topology as an ASCII tree.

terminal
$ lattice get hierarchy
mgmt  [Ready] (parent)
├── prod  [Ready] (parent)
│   ├── us-east  [Ready]
│   └── us-west  [Ready]
└── staging  [Ready] (parent)
    ├── dev-1  [Ready]
    └── dev-2  [Ready]

lattice get health

Fleet health overview with node counts and heartbeat information.

terminal
$ lattice get health
NAME       STATUS    NODES    CP     HEARTBEAT
mgmt       Healthy   13/13    3/3    -
prod       Healthy   23/23    3/3    2s ago
staging    Healthy   6/6      1/1    5s ago
lattice get health flags
Flag Type Description
-o, --output string Output format: table (default) or json.