AgentSkillsCN

tfdc-policy-get

使用 tfdc 根据策略 ID 获取 Terraform 策略集详情。适用于已从先前搜索中获得 terraform_policy_id,并需获取包含 README 内容在内的完整策略文档时使用。

SKILL.md
--- frontmatter
name: tfdc-policy-get
description: Fetch Terraform policy set details by policy ID using tfdc. Use when you have a terraform_policy_id from a previous search and need the full policy documentation including readme content.

tfdc policy get

Fetch policy details by exact policy ID.

Usage

bash
tfdc policy get -id <policy_id> [-format text]

Flags

FlagRequiredDefaultDescription
-idYesPolicy ID in policies/namespace/name/version format
-formatNotextOutput format: text, json, markdown

ID format

The policy ID must start with policies/ and follow the format: policies/namespace/name/version

Example: policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1

Examples

bash
# Fetch policy readme as plain text
tfdc policy get -id policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1

# Fetch as structured JSON
tfdc policy get -id policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1 -format json

JSON output

json
{
  "id": "policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1",
  "content": "# CIS Policy Set\n\nThis policy set contains CIS benchmark rules...",
  "content_type": "text/markdown"
}

Workflow

Typically used after tfdc policy search:

bash
# Search for policies
tfdc policy search -query cis -format json

# Get full details
tfdc policy get -id policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1