glab-opentofu — Claude Code skill: state management
glab-opentofu — a Claude Code skill for managing OpenTofu and Terraform state in GitLab. It activates for backend setup and infrastructure-as-code tasks.
MIT 119 installs ★ 51 updated 2026-10-20
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a claude-codeWhat glab-opentofu does
The skill uses glab opentofu to initialize a working directory with GitLab-managed state and to list, lock, unlock, download, or delete states.
Run glab opentofu state list to view states. Add --output json or -F json for structured output that an agent can process; -R --repo selects another repository.
If a confined Snap cannot find tofu, opentofu init suggests passing an executable path with --binary. That path must be accessible inside the Snap. The flag does not remove Snap confinement or authorize writes to state or the backend.
What it helps with
- initialize Terraform or OpenTofu with GitLab-managed state
- list a project's states
- lock or unlock a state
- download or delete a state
- return state lists as JSON for agent automation
Example prompts for the agent
- Initialize this directory with its GitLab OpenTofu state.
- List the repository's states as JSON.
- Unlock the Terraform state in GitLab.
How to install glab-opentofu
1Skills CLI (Vercel)
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a claude-code2Manually: put the files in place
~/.claude/skills/glab-opentofu/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/glab-opentofu/
1Skills CLI (Vercel)
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a codex2Manually: put the files in place
.agents/skills/glab-opentofu/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a cursor2Manually: put the files in place
.cursor/skills/glab-opentofu/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vince-winkintel/gitlab-cli-skills glab-opentofu2Manually: put the files in place
.github/skills/glab-opentofu/SKILL.md1Skills CLI (Vercel)
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a gemini-cli2Platform CLI
gemini skills install https://github.com/vince-winkintel/gitlab-cli-skills --path glab-opentofuManually: put the files in place
.devin/skills/glab-opentofu/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about glab-opentofu
How do I install glab-opentofu in Claude Code?
Run npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a claude-code. The skill file is at ~/.claude/skills/glab-opentofu/SKILL.md.
What does glab-opentofu do?
It manages OpenTofu and Terraform state in GitLab: initialize a working directory, inspect states, lock or unlock them, and download or delete them.
How can I get a JSON list of states?
Run glab opentofu state list --output json or glab opentofu state list -F json. Both options produce structured output.
Source text
SKILL.md · MIT
---
name: glab-opentofu
description: Work with OpenTofu state management in GitLab. Use when managing Terraform/OpenTofu state, configuring state backends, or working with infrastructure as code. Triggers on OpenTofu, Terraform, state management, infrastructure as code, IaC.
---
# glab opentofu
> Capture key `685c1cbd7`: checksum-verified macOS arm64 binary, source commit `685c1cbd74c882e0c93d7011657adde811582ed7`; archive SHA-256 `e77f5756c3c8d9ffeaef0bf234533f395680ab9f128a75cec4c1bd7a1049788c`. Only fences marked `685c1cbd7` use this capture. Normalization removes trailing spaces/tabs only; indentation, blank lines, wrapping, truncation, and product spelling (including `Gitlab`) are preserved. Other fences retain their individual prior provenance.
## Snap binary lookup
If a confined snap cannot find `tofu`, `opentofu init` suggests `--binary <path>` for an executable accessible inside the snap. Verify that path and approve initialization before running it; the option does not bypass snap confinement or authorize state/backend writes.
## Overview
<!-- help-capture: 685c1cbd7:bf2745a27d03 -->
```text
Manage OpenTofu and Terraform state stored in the GitLab-managed
state backend.
Initialize a working directory against a GitLab-managed state, and
list, lock, unlock, download, or delete states.
USAGE
glab opentofu <command> [command] [--flags]
COMMANDS
init <state> [--flags] Initialize OpenTofu or Terraform.
state <command> [command] [--flags] Work with the OpenTofu or Terraform states.
FLAGS
-h --help Show help for this command.
-R --repo Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.
```
## Quick start
```bash
glab opentofu --help
```
## Structured output
`glab opentofu state list` supports `--output json` / `-F json` for structured output, which is useful for agent automation.
```bash
# List OpenTofu state with JSON output
glab opentofu state list --output json
glab opentofu state list -F json
```
## Subcommands
See [references/commands.md](references/commands.md) for full `--help` output.
© vince-winkintel · MIT · vince-winkintel/gitlab-cli-skills