Skip to content

Your first run

The first run needs no cloud account. The kind-crd example in turf-examples builds a local Kubernetes® cluster with kind, registers a CustomResourceDefinition on it, and creates one custom resource of that kind. With plain Terraform® this takes targeted applies, because the provider cannot connect until the cluster exists. Turf™ deploys it in one run, and asks you before each apply.

You need Docker running and kind on your PATH, and the example checked out. The provider runs docker from inside the engine, and an engine the server started looks for it in Homebrew’s and the system’s directories (/opt/homebrew/bin, /usr/local/bin, /usr/bin), not on your shell’s PATH.

Terminal window
git clone https://github.com/turfbuild/turf-examples
cd turf-examples/terraform/kubernetes/kind-crd

Three resources, and a provider configured from the first of them:

main.tf and providers.tf (trimmed)
resource "kind_cluster" "demo" {
name = "${var.cluster_name}-${var.generation}"
node_image = var.node_image
wait_for_ready = true
}
provider "kubernetes" {
host = kind_cluster.demo.endpoint
client_certificate = kind_cluster.demo.client_certificate
client_key = kind_cluster.demo.client_key
cluster_ca_certificate = kind_cluster.demo.cluster_ca_certificate
}
resource "kubernetes_manifest" "crd" {
manifest = { # a CustomResourceDefinition: demo.local/v1, kind Turf
apiVersion = "apiextensions.k8s.io/v1"
kind = "CustomResourceDefinition"
metadata = { name = "turfs.demo.local" }
# …
}
}
resource "kubernetes_manifest" "instance" {
depends_on = [kubernetes_manifest.crd]
manifest = {
apiVersion = "demo.local/v1"
kind = "Turf"
metadata = { name = "example-turf", namespace = var.namespace }
spec = { message = var.cr_message }
}
}

In Claude Code, Turf’s prompts are slash commands. Start with the guide:

/turf:guide

The agent loads Turf’s skills and offers a short tour. In another client, ask in words: “show me how Turf works”.

/turf:up terraform/kubernetes/kind-crd

Slash-command arguments are one word each, so the path has no spaces. In any client you can also say “deploy the configuration in terraform/kubernetes/kind-crd with Turf”. What follows is the shape of the session:

✦Your agentin Claude Code
You
/turf:up terraform/kubernetes/kind-crd
Agent
  • init→ok
  • open→default
  • up→awaiting_plan
  • plan→awaiting_approval

Plan: 1 to add now, 2 to follow.

+ kind_cluster.demo
name: turf-crd-demo-1

The CRD and the custom resource are planned once the cluster is up. Ready to apply these changes?

You
Yes.
Agent
  • apply→awaiting_plan
  • plan→awaiting_approval

The cluster is up. Next, the CRD:

+ kubernetes_manifest.crd turfs.demo.local

Ready to apply these changes?

You
Yes.
Agent
  • apply→awaiting_plan
  • plan→awaiting_approval
  • apply→converged
  • output

The CRD is in. The last plan was the custom resource, a single create, so I approved it. Apply complete: 3 added, 0 changed, 0 destroyed.

Outputs: cluster_name = turf-crd-demo-1, cr_name = example-turf, cr_message = Hello from Turf.

The run is in the console: http://127.0.0.1:8873/…

illustrative · the shape of a session, not a transcript

Notice what the agent did and did not do. Turf made each plan; the agent read it, explained it and asked. The last plan was a single create with nothing risky in it, so the agent approved it itself, as its rules allow, and told you. Every result the agent saw carried a link to the console.

TOOL RESULTplan→awaiting_approval
convergence_id: cv_8f3a…
outcome: awaiting_approval ended: false round: 1
plan:
uri: turf://workspaces/default/convergences/cv_8f3a…/rounds/1/plan
digest: sha256:4c1e…
add: 1 deferred: 2
next: apply with convergence_id and plan_digest to approve, or decline
console_url: http://127.0.0.1:8873/w/…?round=…

Open the console link. The first time, run turf console in a terminal to sign your browser in (npx -y @turfbuild/turf-mcp-server engine console with the npx install); after that every link opens directly. The round’s page tells its story: the plan gate, the plan with its counts, the approval point with who approved and the plan’s digest, the apply, and how the round ended the run. The Timeline tab draws every resource’s lane. The console is read-only: approvals are given by the agent or the CLI, as above.

Terminal window
kind get clusters
kubectl get turfs.demo.local
/turf:destroy terraform/kubernetes/kind-crd
✦Your agentin Claude Code
You
/turf:destroy terraform/kubernetes/kind-crd
Agent
  • init→ok
  • open→default
  • destroy→awaiting_plan
  • plan→awaiting_approval

Plan: 3 to destroy.

- kubernetes_manifest.instance
- kubernetes_manifest.crd
- kind_cluster.demo

Dependents go first, so the custom resource before the CRD that defines it, then the cluster. Ready to destroy these resources? This cannot be undone.

You
Yes, destroy them.
Agent
  • apply→converged

Destroy complete: 3 destroyed.

illustrative · the shape of a session, not a transcript

A destroy plan is never approved by the agent. It presents the plan, asks in those words, and waits for your explicit yes.

The Turf CLI is Turf’s own agent; it needs a model key (or a local model). The run is the same loop, with the approval questions in the terminal.

Terminal window
export ANTHROPIC_API_KEY=sk-...
cd terraform/kubernetes/kind-crd && turf up
cd terraform/kubernetes/kind-crd && turf destroy

More in The Turf CLI.

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