Metadata-Version: 2.4
Name: terraform-provider-cli
Version: 0.1.0
Summary: CLI tool to fetch Terraform provider documentation from the official Terraform Registry
Author-email: Utkarsh Jaiswal <utkarshjaiswal2580@gmail.com>
License: MIT
Keywords: terraform,aws,gcp,azure,cli,documentation,provider
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# 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

```bash
# 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:

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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
