Terraform Plugin Docs banner
hashicorp hashicorp

Terraform Plugin Docs

DevOps community

Description

Generate and validate Terraform plugin/provider documentation.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

terraform-plugin-docs

This repository contains tools and packages for creating Terraform plugin docs (currently only provider plugins). The primary way users will interact with this is the `tfplugindocs` CLI tool to generate and validate plugin documentation.

`tfplugindocs`

The `tfplugindocs` CLI has three main commands, `migrate`, `validate` and `generate` (`generate` is the default). This tool will let you generate documentation for your provider from live example `.tf` files and markdown templates. It will also export schema information from the provider (using `terraform providers schema -json`), and sync the schema with the reference documents.

If your documentation only consists of simple examples and schema information, the tool can also generate missing template files to make website creation extremely simple for most providers.

Installation

You can install a copy of the binary manually from the [releases](https://github.com/hashicorp/terraform-plugin-docs/releases), or you can optionally use the [tools.go model](https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md) for tool installation.

[!NOTE]

Here is a brief `./tools/tools.go` example from https://github.com/hashicorp/terraform-provider-scaffolding-framework:

//go:build tools

package tools

import (
  // Documentation generation
  _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs"
)

Then run the following to install and verify `tfplugindocs`:

export GOBIN=$PWD/bin
export PATH=$GOBIN:$PATH
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
which tfplugindocs

Usage

$ tfplugindocs --help
Usage: tfplugindocs [--version] [--help]  []

Available commands are:
                the generate command is run by default
    generate    generates a plugin website from code, templates, and examples
    migrate     migrates website files from either