Reading state and outputs
Three tools read what a workspace holds and change nothing: show, output and state_list. None of
them plans. Two tools edit state at once: taint marks an instance for replacement on the next up,
and untaint clears the mark. Turf™ reads the state from the engine’s records of the workspace.
Example configuration: turf-examples/terraform/kubernetes/kind-crd
state_listoutput
Three resources: kind_cluster.demo, kubernetes_manifest.crd and kubernetes_manifest.instance.
The output cluster_name is turf-crd-demo-1, so the context is kind-turf-crd-demo-1.
TOOL RESULTstate_list
workspace_alias: "default" lineage: "…" serial: …resources: [ { address: "kind_cluster.demo", provider_name: "registry.opentofu.org/tehcyx/kind", … }, { address: "kubernetes_manifest.crd", create_before_destroy: true, … }, { address: "kubernetes_manifest.instance", depends_on: ["kubernetes_manifest.crd", …], create_before_destroy: true, … } ]outputs: { cluster_name: …, cluster_endpoint: …, crd_name: …, cr_name: …, cr_message: … }state_list (include_values)
kubernetes_manifest.instance: kind Turf, name example-turf in namespace default,
spec.message “Hello from Turf”. Nothing in it is sensitive.
illustrative · the shape of a session, not a transcript
Ask in words: “what’s in the state?”, “show me the outputs”, “show me round 2’s plan”, “taint
kubernetes_manifest.instance”. The agent reads with the values open was given. It reads a sensitive
value in the clear only when it needs it, since the value then enters the conversation.
The CLI has no state or output commands. Ask its agent, interactively or in one shot:
cd path/to/config && turf chatcd path/to/config && turf exec "show me the outputs"How it works
Section titled “How it works”show prints a plan or the state as the OpenTofu® machine-readable document (tofu show -json):
- a round’s plan (the default): the round waiting at its approval point, or else the latest, or any
round by
convergence_idandround. It is the document the engine captured as the round sealed, so it reads the same after the round applies, for as long as the engine keeps the round; - a planfile’s document, by
planfile; - the workspace’s state, with
what: "state".
output reads the root output values the last apply recorded (tofu output -json), all of them
or one by name. A module’s outputs are not kept: to keep one, the configuration exposes it as a root
output.
state_list lists the resources in state (tofu state list): one row per instance in address
order, with its provider, schema version, taint, dependencies and identity, plus the root outputs.
include_values adds each resource’s attributes.
Sensitive values print as __cty_sensitive__ unless show_sensitive is set. Set it only when the
secret is needed: it enters the conversation.
taint and untaint are state edits, made at once, with no plan and no approval. taint marks
instances so the next up plans each one destroyed and created again (replace_because_tainted).
untaint clears the mark, so the next up plans them as their configuration says. To replace
something without editing state, use plan’s replace in an up instead: it replaces in that round
only. Both edits need a server at the full tier, and a taint makes any planfile on the workspace
stale.
Arguments
Section titled “Arguments”| Tool | Argument | Meaning |
|---|---|---|
show |
what |
plan (default) or state. |
convergence_id |
For a plan: the run (default: the one holding the workspace). | |
round |
For a plan: the round (default: the one at its approval point, else the latest). | |
planfile |
For a plan: a planfile’s ref; convergence_id and round are then not read. |
|
show_sensitive |
Print sensitive values in the clear. A plan read so is the document plan.digest hashes. |
|
output |
name |
One output (default: every output). |
show_sensitive |
Print a sensitive output’s value. | |
state_list |
include_values |
Include each resource’s attribute values. |
show_sensitive |
Print sensitive values in the clear. | |
taint, untaint |
addrs |
Resource instance addresses (aws_instance.web, module.m.aws_instance.x[0]). |
Every one also takes workspace_alias; omit it for the default workspace.
Related
Section titled “Related”- Refresh state: bring state up to date with the world.
- Import existing objects
- Policy checks on a plan: what to do with
show’s document. - Plan now, apply later
Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.
© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub