Skip to content

Add glab (GitLab CLI) coverage#1

Open
gl-njanz wants to merge 1 commit into
hex:mainfrom
gl-njanz:add-glab-cli-coverage
Open

Add glab (GitLab CLI) coverage#1
gl-njanz wants to merge 1 commit into
hex:mainfrom
gl-njanz:add-glab-cli-coverage

Conversation

@gl-njanz

Copy link
Copy Markdown

What & why

claude-guard guards gh (GitHub CLI) destructive commands but had no coverage for glab (GitLab CLI). This adds the glab equivalents of the existing gh rules, plus glab-native destructive operations that gh has no analog for.

Mapping is intentionally not 1:1 — glab has no extension system, and stores CI/CD secrets as variables (so gh secret delete maps to glab variable delete). All command names were verified against docs.gitlab.com/cli.

Rules added (in packs/cicd.py)

Tier 1 (hard deny):

  • glab repo delete

Tier 2 (deny + redirect):

Command Alternative
glab release delete glab release list first
glab variable delete glab variable list first
glab repo archive confirm; reversible via glab repo unarchive
glab token revoke glab token list first
glab ci delete glab ci list first
glab ssh-key / gpg-key / deploy-key delete list first
glab mr delete close instead: glab mr close
glab issue delete close instead: glab issue close
glab work-items delete confirm intent (no close subcommand)

The glpat- GitLab token pattern already exists in credentials.py, so Tier 3 needs no changes.

Docs & version

  • README protection table, guard-rules SKILL.md tables, and status command updated.
  • Bumped 2026.6.02026.6.1.

Testing

  • 20 new tests in TestCICD; full suite (298 tests) passes.
  • End-to-end spot-checks through command-guard.py confirm deny/ask/allow behave correctly.

🤖 Generated with Claude Code

claude-guard guarded gh (GitHub CLI) destructive commands but had no
coverage for glab (GitLab CLI). This adds the glab equivalents plus
glab-native destructive operations gh has no analog for.

Mapping is not 1:1: glab has no extension system, and stores CI/CD
secrets as variables (so gh secret delete maps to glab variable delete).
Command names verified against docs.gitlab.com/cli.

Tier 1 (hard deny):
- glab repo delete

Tier 2 (deny + redirect):
- glab release delete, glab variable delete, glab repo archive,
  glab token revoke, glab ci delete,
  glab ssh-key/gpg-key/deploy-key delete
- glab mr delete / glab issue delete -> close instead
- glab work-items delete -> confirm intent (no close subcommand)

The glpat- token pattern already exists in credentials.py, so Tier 3
needs no changes. Adds 20 tests; full suite (298) passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant