SuperAPI AI 工具集

glab-opentofu

通用与其它

查看项目

更新于 10-16 01:11

技能介绍

用途:glab opentofu 是 glab(GitLab CLI)中用于对接 OpenTofu 或 Terraform 集成的命令,适合在 GitLab 环境下管理基础设施即代码(IaC)的状态。

主要能力:提供 init 子命令用于初始化 OpenTofu 或 Terraform;提供 state 子命令用于操作 OpenTofu 或 Terraform 状态。state list 支持 --output json 或 -F json,输出结构化结果,便于智能体或脚本自动化处理。

使用方式:基本调用为 glab opentofu <command> [command] [--flags]。常用子命令包括 glab opentofu init <state> [--flags] 和 glab opentofu state <command> [command] [--flags]。通用标志有 -h/--help 查看帮助,-R/--repo 选择其他仓库,支持 OWNER/REPO、GROUP/NAMESPACE/REPO 格式,也接受完整 URL 或 Git URL。快速开始可运行 glab opentofu --help。结构化输出示例:glab opentofu state list --output json 或 glab opentofu state list -F json。

适用场景:管理 Terraform/OpenTofu 状态、配置状态后端、在 GitLab 中开展基础设施即代码相关工作,以及需要 JSON 输出的自动化流程。

限制:资料未提供具体状态后端配置细节、各子命令的完整参数、权限要求或版本兼容性信息,需参考 references/commands.md 中的完整 --help 输出。