Skip to main content

CLI tool to fetch Terraform provider documentation from the official Terraform Registry

Project description

terraform-provider-cli (tpc)

CLI tool to fetch Terraform provider documentation from the official Terraform Registry. Supports AWS, Azure, GCP, Kubernetes, and other providers.

Installation

# Install from PyPI
pip install terraform-provider-cli

# Or install from source
pip install -e .

First Run Setup

On first run, you need to configure the default provider and version:

# Set default provider
tpc config set-provider aws

# Set default version
tpc config set-version 5.0.0

# Or use environment variables
export TERRAFORM_PROVIDER=aws
export TERRAFORM_PROVIDER_VERSION=5.0.0

Usage

Configuration

# Set default provider
tpc config set-provider aws
tpc config set-provider google
tpc config set-provider azurerm

# Set default version
tpc config set-version 5.0.0

# Show current configuration
tpc config show

# Clear configuration
tpc config clear

Fetch documentation

# Fetch resource documentation (uses default provider/version)
tpc doc aws_instance

# Fetch from specific provider
tpc doc google_compute_instance --provider google

# Fetch data source
tpc doc aws_vpc --category data-sources

# Fetch specific version
tpc doc aws_instance --version 4.0.0

# Save to file
tpc doc aws_instance --output docs/instance.md

List resources

# List all resources (uses default provider)
tpc list resources

# List data sources
tpc list data-sources

# List for specific provider
tpc list resources --provider google

# List for specific version
tpc list resources --version 4.0.0

Search

# Search resources
tpc search s3

# Search data sources
tpc search vpc --category data-sources

# Search with version
tpc search lambda --version 4.0.0

Options

  • --verbose, -V: Enable verbose output
  • --version: Show version information
  • --provider, -p: Override default provider

Supported Providers

This CLI supports all providers from the Terraform Registry. Some popular providers:

Cloud Providers

  • aws - Amazon Web Services
  • azurerm - Microsoft Azure
  • google - Google Cloud Platform
  • alicloud - Alibaba Cloud
  • oci - Oracle Cloud Infrastructure

Container & Orchestration

  • kubernetes - Kubernetes
  • helm - Helm
  • docker - Docker

Identity & Access Management

  • ad - Active Directory (Microsoft)
  • azuread - Azure Active Directory
  • okta - Okta
  • awscc - AWS Control Tower

Data & Analytics

  • databricks - Databricks
  • snowflake - Snowflake
  • mongodb - MongoDB Atlas

Infrastructure

  • tfe - Terraform Enterprise
  • tfc - Terraform Cloud
  • vmware - VMware vSphere
  • openstack - OpenStack

And many more...

You can browse all available providers at: https://registry.terraform.io/browse/providers

Example Usage

# Kubernetes
tpc config set-provider kubernetes
tpc config set-version 2.0.0
tpc doc kubernetes_pod

# Azure AD
tpc config set-provider azuread
tpc doc azuread_application

# Helm
tpc config set-provider helm
tpc doc helm_release

# Databricks
tpc config set-provider databricks
tpc doc databricks_workspace

# Terraform Enterprise
tpc config set-provider tfe
tpc doc tfe_workspace

Configuration

The config file is stored at ~/.terraform-provider-cli/config.

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with verbose
python -m terraform_provider_cli doc aws_instance -V

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terraform_provider_cli-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terraform_provider_cli-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file terraform_provider_cli-0.1.0.tar.gz.

File metadata

  • Download URL: terraform_provider_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for terraform_provider_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6220b8bdd7466e2c27ac07c95b086cc6eaa41ca7173b5ab065b2c1b4e3833969
MD5 af72c9889b1fa466b5d69d6bc27dee0a
BLAKE2b-256 dab35a745272df6202d6da4c0ed11e3e95e5a008d5a2ac5f4dd0536c39a62853

See more details on using hashes here.

File details

Details for the file terraform_provider_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for terraform_provider_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af2d42e3910e815de5e2efc8cdb03fd7cf9b43ce1c8c53a7ffdf15d13bb6d21e
MD5 cee06d857e34b22cd9808a408122ea16
BLAKE2b-256 32e6f82286079979da9742217c0306b1f15461492c34f30bce4c7bc5a0cb0fe5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page