AgentSkillsCN

tfdc-provider-search

使用 tfdc 根据服务 Slug 搜索 Terraform 提供者文档。适用于需要查找特定资源、数据源或其他提供者文档类型的 provider_doc_id 时使用。返回的候选文档 ID 可直接传递给 tfdc 提供者获取功能。

SKILL.md
--- frontmatter
name: tfdc-provider-search
description: Search Terraform provider documentation by service slug using tfdc. Use when you need to find provider_doc_id values for a specific resource, data source, or other provider doc type. Returns candidate doc IDs that can be passed to tfdc provider get.

tfdc provider search

Search candidate provider docs and return provider_doc_id list.

Usage

bash
tfdc provider search \
  -name aws \
  -service ec2 \
  -type resources \
  [-namespace hashicorp] \
  [-version latest] \
  [-limit 20] \
  [-format text]

Flags

FlagRequiredDefaultDescription
-nameYesProvider name (e.g., aws, google, azurerm)
-serviceYesSlug-like search token to match against doc slugs
-typeYesDoc category (see below)
-namespaceNohashicorpProvider namespace
-versionNolatestProvider version (semver or latest)
-limitNo20Max results
-formatNotextOutput format: text, json, markdown

-type values

resources, data-sources, ephemeral-resources, functions, guides, overview, actions, list-resources

Output fields

FieldDescription
provider_doc_idNumeric ID for use with provider get
titleDocument title
categoryDocument category
descriptionDocument slug/description
providerProvider name
namespaceProvider namespace
versionResolved provider version

Examples

bash
# Search AWS EC2 resources
tfdc provider search -name aws -service ec2 -type resources

# Search data sources with JSON output
tfdc provider search -name aws -service ami -type data-sources -format json

# Search specific version
tfdc provider search -name google -service compute -type resources -version 5.0.0

# Search guides
tfdc provider search -name aws -service ec2 -type guides

JSON output

json
{
  "items": [
    {
      "provider_doc_id": "10595066",
      "title": "aws_instance",
      "category": "resources",
      "description": "aws_instance",
      "provider": "aws",
      "namespace": "hashicorp",
      "version": "6.32.1"
    }
  ],
  "total": 1
}

Workflow

Use with tfdc provider get to fetch full doc content:

bash
# Find doc IDs
tfdc provider search -name aws -service ec2 -type resources -format json | jq '.items[].provider_doc_id'

# Fetch content by ID
tfdc provider get -doc-id 10595066