Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 72 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

FTF CLI is a command-line interface (CLI) tool that facilitates module generation, variable management, validation, and registration in Terraform.

## Key Features

- **Module Generation**: Scaffold Terraform modules with standardized structure
- **Variable Management**: Add and manage input variables with type validation
- **Output Integration**: Wire registered output types as module inputs
- **Validation**: Comprehensive validation for modules and configurations
- **Control Plane Integration**: Seamless authentication and interaction with Facets control plane

## Installation

You can install FTF CLI using pip, pipx, or directly from source.
Expand Down Expand Up @@ -170,11 +178,21 @@ ftf add-input [OPTIONS] /path/to/module
- `-n, --name`: (prompt) Name of the input variable to add in facets.yaml and variables.tf.
- `-dn, --display-name`: (prompt) Human-readable display name for the input variable.
- `-d, --description`: (prompt) Description for the input variable.
- `-o, --output-type`: (prompt) The type of registered output to wire as input.
- `-o, --output-type`: (prompt) The type of registered output to wire as input. Format: @namespace/name (e.g., @outputs/database, @custom/sqs).

**Notes**:
- Updates facets.yaml required inputs and variables.tf accordingly.
- Facilitates parametrization of modules using control plane outputs.
- Supports both default (@outputs) and custom namespaces.

**Example**:
```bash
ftf add-input /path/to/module \
--name queue_connection \
--display-name "SQS Queue Connection" \
--description "Configuration for SQS queue" \
--output-type "@custom/sqs"
```

#### Preview (and Publish) Module

Expand Down Expand Up @@ -279,7 +297,7 @@ ftf delete-module [OPTIONS]

#### Get Output Types

Retrieve the output types registered in the control plane for the authenticated profile.
Retrieve the output types registered in the control plane for the authenticated profile. Shows both namespace and name for each output type.

```bash
ftf get-output-types [OPTIONS]
Expand All @@ -288,18 +306,53 @@ ftf get-output-types [OPTIONS]
**Options**:
- `-p, --profile`: (prompt) Profile to authenticate as (default: "default").

#### Get Output Lookup Tree
**Example Output**:
```
Registered output types:
- @custom/sqs
- @outputs/cache
- @outputs/database
```

Retrieve the detailed lookup tree for a registered output type from the control plane.
#### Get Output Type Details

Retrieve comprehensive details for a specific registered output type from the control plane, including properties and lookup tree.

```bash
ftf get-output-lookup-tree [OPTIONS]
ftf get-output-type-details [OPTIONS]
```
Comment on lines +317 to 323
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify CLI implementation for renamed command

Docs introduce ftf get-output-type-details (formerly get-output-lookup-tree). Ensure the actual CLI has been updated so users don’t hit “command not found”.


🏁 Script executed:

#!/bin/bash
# Confirm only the new command exists and the old one is gone.
rg -n "get-output-lookup-tree" || echo "✅ old command not found"
rg -n "get-output-type-details" | head

Length of output: 178


Implement and Register the New CLI Command

After verifying:

  • get-output-lookup-tree is no longer in the codebase
  • ⚠️ No occurrences of get-output-type-details outside of README.md

The CLI implementation for ftf get-output-type-details is missing. Please add and register this command in your CLI code (e.g., create or update cmd/get-output-type-details.go and wire it into your root command) so that the documentation and executable stay in sync.

🤖 Prompt for AI Agents
In README.md around lines 317 to 323, the documentation describes the CLI
command `ftf get-output-type-details`, but this command is not implemented or
registered in the codebase. To fix this, create a new CLI command file (e.g.,
`cmd/get-output-type-details.go`) that implements the command's functionality to
retrieve output type details, then register this command with the root CLI
command so it is executable and consistent with the documentation.


**Options**:
- `-o, --output`: (prompt) Name of the output type to query.
- `-o, --output-type`: (prompt) The output type to get details for. Format: @namespace/name (e.g., @outputs/vpc, @custom/sqs).
- `-p, --profile`: (prompt) Profile to use for authentication (default: "default").

**Example Output**:
```
=== Output Type Details: @custom/sqs ===

Name: sqs
Namespace: @custom
Source: CUSTOM
Inferred from Module: true

--- Properties ---
{
"attributes": {
"queue_arn": {"type": "string"},
"queue_url": {"type": "string"}
},
"interfaces": {}
}

--- Lookup Tree ---
{
"out": {
"attributes": {"queue_arn": {}, "queue_url": {}},
"interfaces": {}
}
}
```

#### Register Output Type

Register a new output type in the control plane using a YAML definition file.
Expand All @@ -317,10 +370,22 @@ ftf register-output-type YAML_PATH [OPTIONS]

**Notes**:
- The YAML file must include `name` and `properties` fields.
- The name should be in the format `@namespace/name`.
- The name should be in the format `@namespace/name` (e.g., `@outputs/database`, `@custom/sqs`).
- You can include a `providers` section in the YAML to specify provider information.
- Ensures you're logged in before attempting to register the output type.

**Example YAML**:
```yaml
name: "@custom/sqs"
properties:
attributes:
queue_arn:
type: string
queue_url:
type: string
interfaces: {}
```

#### Get Resources

List all Terraform resources in the given module directory.
Expand Down