CLI tool for querying Terraform/OpenTofu provider schemas directly from the registry. Retrieves schemas for resources, data sources, ephemeral resources, functions, and provider configuration without needing a local Terraform init.
Source: https://github.com/matt-FFFFFF/tfpluginschema
Download the latest release and extract the binary:
# Linux (amd64)
curl -sSfL https://github.com/matt-FFFFFF/tfpluginschema/releases/latest/download/tfpluginschema_0.8.0_linux_amd64.tar.gz | tar -xz -C /usr/local/bin tfpluginschema
# macOS (Apple Silicon)
curl -sSfL https://github.com/matt-FFFFFF/tfpluginschema/releases/latest/download/tfpluginschema_0.8.0_darwin_arm64.tar.gz | tar -xz -C /usr/local/bin tfpluginschema
# macOS (Intel)
curl -sSfL https://github.com/matt-FFFFFF/tfpluginschema/releases/latest/download/tfpluginschema_0.8.0_darwin_amd64.tar.gz | tar -xz -C /usr/local/bin tfpluginschema# Windows (amd64)
$url = "https://github.com/matt-FFFFFF/tfpluginschema/releases/latest/download/tfpluginschema_0.8.0_windows_amd64.zip"
$dest = Join-Path $HOME ".tfpluginschema"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
Invoke-WebRequest -Uri $url -OutFile (Join-Path $dest "tfpluginschema.zip")
Expand-Archive -Path (Join-Path $dest "tfpluginschema.zip") -DestinationPath $dest -Force
Remove-Item (Join-Path $dest "tfpluginschema.zip")
# Add to PATH if not already present
if ($env:PATH -notlike "*$dest*") { $env:PATH += ";$dest" }Check latest version at: https://github.com/matt-FFFFFF/tfpluginschema/releases
| Flag | Short | Description |
|---|---|---|
--namespace |
-n |
Provider namespace (e.g., Azure, hashicorp) |
--name |
-p |
Provider name (e.g., azapi, azurerm, aws) |
--provider-version |
--pv |
Version or constraint (e.g., 2.5.0, ~>2.4). Empty for latest |
--registry |
-r |
Registry: opentofu (default) or terraform |
tfpluginschema -n Azure -p azapi version listtfpluginschema -n Azure -p azapi resource list
tfpluginschema -n Azure -p azapi datasource list
tfpluginschema -n Azure -p azapi function list
tfpluginschema -n Azure -p azapi ephemeral listtfpluginschema -n Azure -p azapi resource schema azapi_resourcetfpluginschema -n Azure -p azapi datasource schema azapi_client_configtfpluginschema -n Azure -p azapi function schema build_resource_idtfpluginschema -n Azure -p azapi ephemeral schema azapi_resource_actiontfpluginschema -n Azure -p azapi provider schematfpluginschema -n Azure -p azapi --pv 2.5.0 resource schema azapi_resourcetfpluginschema -n hashicorp -p azurerm --pv "~>4.0" resource listOutput is JSON matching the Terraform plugin schema format. Key fields for resource/data source schemas:
{
"version": 2,
"block": {
"attributes": {
"<name>": {
"type": "<type>",
"description": "<description>",
"required": true,
"optional": true,
"computed": true
}
},
"block_types": {
"<name>": {
"nesting_mode": "list|set|single|map",
"block": { ... },
"min_items": 0,
"max_items": 1
}
}
}
}required: Must be set by the useroptional: May be set by the usercomputed: Set by the provider (read-only if not also optional)optional+computed: Can be set by user, has a provider default