Skip to content

nf plan

Preview the changes Netherframe would make to a configured app. Use --out to save a whole-app plan for review and later apply. For Terraform/OpenTofu compatibility, pass a synthesized stack directory to --stack.

Synopsis

nf plan [OPTIONS] [TERRAFORM_ARGS]...

Main Modes

App-Scoped Direct Plan

Use --app with the selector shown by nf list apps.

nf plan --app demo --out reviewed-plan.json
nf show --plan-file reviewed-plan.json

Both hybrid_apps and legacy_apps entries can use app-scoped direct execution. In a project with only hybrid apps, nf plan without a selector plans each configured app. Saving a plan with --out requires one app.

A direct plan names the app and its state backend, shows its changes as a tree of the app, its stacks and their resources, as Pulumi's preview does (each with the action's symbol: + create, ~ update, ± replace, - delete, → import, < read; and in Info, which attributes an update changes, by name, and why), and ends with a Resources: block counting them, with how many resources stay unchanged:

Planning demo · local .nf.out/nf.tfstate

   Type              Name       Plan     Info
   nf:app            demo
   └─ nf:stack       compute
±     ├─ random_pet  host       replace  [diff: ~length]; replace: length
+     └─ random_pet  worker_12  create

Resources:
    + 1 to create
    ± 1 to replace
    18 unchanged

A stack is the deepest level: resources belong to stacks, and Construct classes that group them in Python are not recorded in the plan.

--diff adds each change's attributes under it. Sensitive attributes, as the provider schema marks them, show as (sensitive); a value whose sensitivity cannot be told (no cached schema for the provider version) shows as (hidden: sensitivity unknown), so a plan's output can go to CI logs. --show-secrets shows them all.

  ± compute.random_pet.host  (replace: length)
      ~ id        = "eminently-curious-dane" → (known after apply)
      ~ length    = 3 → 4  # forces replacement

JSON output

--json prints {"format": "nf.plan/1", "plans": [...]} with one entry per planned app (or stack): its changes (address, stack, type, action, reasons, replace and known-after-apply paths), output_changes, counts by action, unchanged, has_changes and notes. Values are left out unless --diff is given (masked as above unless --show-secrets).

nf plan --app demo --json --expect-no-changes > plan.json   # exit 3 when there are changes

Configured App Stack Direct Plan

Use --app with --stack to target a stack in a configured app directly.

nf plan --app platform --stack network

The direct engine uses its internal phase planner for circular dependencies. Stack-targeted plans cannot be saved with --out. --stack platform/network can also select a configured stack when the selector does not resolve to synthesized output.

Legacy Stack Plan

Pass an explicit synthesized stack directory and omit --app.

nf plan --stack .nf.out/platform/network

The external Terraform or OpenTofu CLI plans against the synthesized configuration.

Options

  • --app TEXT: app selector for direct execution
  • --stack, -s TEXT: configured app/stack or synthesized legacy stack selector
  • --legacy-bin TEXT: path to the legacy CLI binary
  • --out FILE: save an immutable whole-app direct plan for nf apply --plan-file (one app; not a stack-only plan)
  • --outdir PATH: synthesized output directory override
  • --adopt-from FILE: adoption manifest; the plan imports the existing objects it names (direct execution; see Adopting Existing Infrastructure)
  • --terraform-state FILE: the Terraform state the manifest's terraform_address entries come from
  • --adopt-missing [create|error]: an object to adopt that is not found is created (default) or fails the plan
  • --allow-duplicate-adoption: adopt an object state already holds under another address
  • --diff: show each change's attributes, before → after (direct execution)
  • --show-secrets: show sensitive values in --diff and --json output instead of masking them
  • --json: print the plan as JSON instead (direct execution; see JSON output)
  • --expect-no-changes: exit 3 when the plan has changes (direct execution), for drift checks in CI

Direct execution controls

These controls apply to configured hybrid apps and directly executed legacy apps:

Option Behavior
--parallelism N Concurrent resource mutations; default 10 (nf --max-concurrent-resources for every command)
--read-parallelism N Concurrent refresh/plan calls and independent provider startup; default 40 (nf --max-concurrent-reads)
--refresh=false Plan using stored values without refreshing managed objects; default true
--target ADDRESS Select a full state address, such as platform.aws_vpc.main, plus its dependencies; repeatable
--plan-scope changed Inspect edited configurations and their dependency closure; full drift inspection is the default
--quiet Hide per-resource progress; keep the final result summary
--graph-plan-scope full\|affected Graph planning qualification policy; affected requires a retained baseline
--baseline FILE Retained graph branch origin (uses nf.baseline when present)
--prefer-mine ADDRESS Resolve a graph intent conflict using this branch's configuration; repeatable
--provenance-report Report observed reads, writes and estimated lease requirements

Changed scope and targets leave unrelated drift uninspected. Unknown evaluation effects make changed scope fall back to full configuration inspection. Existing rows without configuration fingerprints are inspected once. Saved plans preserve their scope; scope flags cannot alter --plan-file. --graph-plan-scope affected cannot be combined with these targets, changed scope or refresh=false. Stack selection uses --stack app/stack or --app app --stack stack.

Raw Terraform/OpenTofu arguments and --legacy-bin are rejected for hybrid apps. Synthesized legacy stacks retain their subprocess passthrough path.

App Inputs

An app whose spec names a function takes its parameters as inputs: ++name=value anywhere on the line, or ++@file (TOML or JSON) for a file of them (nf plan --app web ++env=prod ++replicas=3). The header shows them (with env=prod replicas=3). A plan saved with --out records them, and nf apply --plan-file builds the app with them again. See nf vars.

Important Behavior

  • --app selects app-scoped direct execution on this command
  • --stack can target either a synthesized legacy stack or a configured app stack for direct execution
  • if you pass raw Terraform/OpenTofu arguments, stay on the legacy --stack path instead of --app
  • explicit filesystem stack paths and synthesized stack selectors stay on the legacy subprocess path
  • stack directories that only contain legacy phased Terraform artifacts are rejected on the --stack path; use --app direct execution instead