Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add vince-winkintel/gitlab-cli-skills --skill glab-opentofu -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/glab-opentofu/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/glab-opentofu/

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

Similar skills

All skills for DevOps and infrastructure →

From the same set45

The whole set →
glab-container-registry glab-container-registry operates GitLab container registry repositories and tags via glab CLI. Useful for tag metadata inspection and scheduled image cleanup. CX Codex +1 121installs glab-workitems The glab-workitems Claude Code skill creates, lists, updates, and deletes GitLab work items. It activates for requests about tasks, OKRs, epics, and other work item types. CX Codex +1 120installs glab-token The glab-token Claude Code skill manages GitLab access tokens, including creating, revoking, and rotating them. The agent activates it for requests about PATs or API tokens. CX Codex +1 120installs glab-version glab-version — a small skill that reports which glab CLI build is installed. Useful when a command misbehaves and the version is the first thing to rule out. CX Codex +1 120installs glab-label The glab-label Claude Code skill manages GitLab labels at project and group level. It responds to requests to create, inspect, edit, or remove labels for issues and merge requests. CX Codex +1 118installs glab-gpg-key glab-gpg-key — a skill for Claude Code that manages GPG keys on GitLab. Automates adding, listing, and deleting keys when setting up commit signing or verifying commit signatures. CX Codex +1 118installs glab-alias The glab-alias Claude Code skill manages aliases for the GitLab CLI, glab. Ask it to create, show, or remove a shortcut command. CX Codex +1 118installs glab-quick-actions The glab-quick-actions Claude Code skill sends GitLab quick actions through glab. It groups changes to an issue or merge request into a single comment. CX Codex +1 118installs

Project sponsors

Companies that keep this analytics open