Skip to content

Netherframe CLI Reference

The nf command-line interface manages Netherframe apps using direct hybrid execution (default) and supports legacy Terraform/OpenTofu synthesis, discovery, drift detection, provider generation, linting, and an interactive terminal UI.

Every nf command is also available programmatically via nf.sdk.


Commands by category

Core lifecycle

Command Summary
nf plan Preview changes and optionally save an immutable whole-app plan (--out).
nf apply Apply a saved plan (--plan-file) or plan and apply an app or stack.
nf deploy Plan and apply in one command (or synth + init + apply on legacy stacks).
nf destroy Preview and delete managed infrastructure (honoring retain and recorded deployment inputs).
nf show Inspect a saved plan (--plan-file) or state.
nf diff Display a formatted planned diff.
nf output Display output values from a stack.

Exploration, inputs, and automation

Command Summary
nf tui Interactive k9s-style terminal UI (:graph, diffs, runs, approvals, record/replay).
nf follow Stream progress of an apply or destroy running in another terminal or CI.
nf list nf list apps lists configured apps; nf list stacks lists synthesized stacks.
nf vars List an app's typed inputs (++name=value, ++@file) and resolved values.
nf completion Print shell completion scripts (bash, zsh, fish).
nf skill Read or export the versioned Netherframe skill for AI coding agents.

State, backends, and drift

Command Summary
nf state List, inspect, move (mv), forget (rm), taint/untaint, force-unlock, runs, verify, abandon, recover.
nf backend show resolved backend, bootstrap storage, and validate resources.
nf drift detect, check (CI exit code 3), and fix drift between code and live state.
nf import Import existing infrastructure into a legacy synthesized stack.

Providers, linting, and migration

Command Summary
nf generate providers Generate pinned, typed Python provider packages.
nf providers List sets, describe, and search provider packages.
nf discover resources, validate, and codify live infrastructure.
nf convert Translate a Terraform HCL module into typed Netherframe Python and an adoption manifest.
nf lint Run offline schema and policy packs (such as netherframe.lint.hashicorp.aws).
nf encode Add the # coding: nf_autoid header to Python files.
nf synth Export Terraform JSON under .nf.out/ for legacy compatibility apps.

Global options and settings

Options of nf itself may be written before or after the subcommand (nf --log-level INFO plan = nf plan --log-level INFO):

  • --version — Print the installed CLI version and exit.
  • --user-config FILE — Load machine-local defaults from FILE instead of ~/.config/nf/config.toml.
  • --no-user-config — Ignore ~/.config/nf/config.toml (recommended in CI).
  • --log-level [TRACE|DEBUG|INFO|WARNING|ERROR] — Enable CLI logging at the given level.
  • --log-format [text|json|pretty] — Choose log output format.
  • --trace — Shorthand for --log-level TRACE.
  • --help — Display help and grouped global settings.

All global setting flags (--max-concurrent-resources, --backend-type, --provider-mirror, --graph-lease-ttl, etc.) are listed in Settings.

App inputs syntax

For app specs naming a factory function, pass inputs anywhere before --:

  • ++name=value — Set a typed input (++flag sets a bool input to true).
  • ++@file.toml / ++@file.json / ++@<(...) — Load inputs from a TOML or JSON file (required for Secret[T] inputs).

Exit codes

Code Meaning
0 Success (no changes / no drift)
1 Runtime, execution, config, or check error
2 CLI usage error
3 Changes or drift detected (nf plan --expect-no-changes, nf drift check|detect)
4 Incomplete apply with deferred changes remaining (default incomplete_exit_code)

See Exit Codes for full details and SDK error codes.

Project registration

[tool.nf]
apps = ["app:app"]                          # hybrid apps (alias: hybrid_apps)
terraform_apps = ["legacy_app:app"]         # optional Terraform JSON export (alias: legacy_apps)

For full details of any command installed in your environment, run nf <command> --help.