Skip to main content
skill CX Codex

glab-snippet — Claude Code skill for creating snippets

The glab-snippet Claude Code skill creates GitLab snippets from files or stdin text. It activates when a request is to share code or text as a new snippet.

MIT 115 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-snippet -a claude-code
Open on GitHub

What glab-snippet does

The skill creates project or personal snippets with glab snippet create. It accepts one file, multiple files, or text piped through stdin; stdin content needs a filename supplied with --filename. Set visibility to public, internal, or private; snippets are private by default.

For a project snippet, the command uses the repository selected by the current checkout, so verify that repository or pass --repo. Files are uploaded with their contents, so review them for secrets first. Existing snippets are viewed, changed, or deleted through the GitLab UI or glab api; glab snippet has no native commands for those actions.

What it helps with

  • create a project snippet from a file
  • publish a personal snippet containing several files
  • send stdin text into a new snippet
  • choose snippet visibility during creation

Example prompts for the agent

  • Create a project snippet from script.py titled “Example”.
  • Make a personal snippet from app.py and requirements.txt titled “Example”.
  • Create a snippet from stdin text and name its file main.go.

How to install glab-snippet

1Skills CLI (Vercel)

npx skills add vince-winkintel/gitlab-cli-skills --skill glab-snippet -a claude-code

2Manually: put the files in place

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

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about glab-snippet

How do I install glab-snippet in Claude Code?

Run npx skills add vince-winkintel/gitlab-cli-skills --skill glab-snippet -a claude-code. The skill file is at ~/.claude/skills/glab-snippet/SKILL.md.

What does glab-snippet do?

It creates GitLab project and personal snippets from files or stdin text. Use the GitLab UI or glab api to view, edit, or delete existing snippets.

What does glab-snippet need to run?

It needs glab. For a project snippet, verify the current repository or pass --repo; uploaded files should be checked for secrets.

Source text

SKILL.md · MIT
---
name: glab-snippet
description: Create GitLab project or personal code snippets with glab. Use when sharing code or text as a new snippet from files or stdin. For viewing, editing, or deleting existing snippets, use the GitLab UI or the snippets API through glab api. Triggers on snippet, gist, code snippet, share code, create snippet.
---

# glab snippet

`glab snippet` creates snippets. It does not provide native view, update, list, or delete subcommands; use the GitLab UI or `glab api` with the project or personal snippets API for those operations.

## Create from files

```bash
# Project snippet in the repository selected by the current checkout
glab snippet create --title "Example" script.py

# Multiple files
glab snippet create --title "Example" app.py requirements.txt

# Personal snippet
glab snippet create --personal --title "Example" script.py
```

Verify the current repository or pass `--repo` before creating a project snippet. Review every input file for secrets because the command uploads its contents.

## Create from stdin

```bash
printf '%s\n' 'package main' | \
  glab snippet create --title "Go example" --filename main.go
```

Use `--filename` when stdin supplies the content. Choose `--visibility public`, `internal`, or `private` deliberately; the default is private.

## Existing snippets

For project snippets, use the [Project snippets API](https://docs.gitlab.com/api/project_snippets/) through `glab api`. For personal snippets, use the [Snippets API](https://docs.gitlab.com/api/snippets/). Read the target first and verify the host, project, snippet ID, and actor before any update or delete request.

## Command reference

See [references/commands.md](references/commands.md) for checksum-verified `glab snippet` and `glab snippet create` help.

© vince-winkintel · MIT · vince-winkintel/gitlab-cli-skills

Similar skills

SKILL.md skills catalog →

From the same set45

The whole set →
glab-orbit The glab-orbit Claude Code skill runs Orbit CLI through glab. It activates for remote GitLab graph queries and searches across a local code graph. CX Codex +1 117installs glab-duo The glab-duo Claude Code skill installs and runs GitLab Duo CLI through glab. It activates for terminal access to GitLab Duo Agent Platform, interactive sessions, or a bounded headless task. CX Codex +1 116installs glab-deploy-key The glab-deploy-key Claude Code skill manages SSH deploy keys for GitLab projects. It activates for CI/CD access setup and project key operations. CX Codex +1 116installs glab-ssh-key The glab-ssh-key Claude Code skill manages SSH keys on a GitLab account. It runs for SSH setup and requests to add, inspect, or remove keys. CX Codex +1 115installs glab-todo The glab-todo Claude Code skill manages GitLab to-dos through the CLI. It lists assigned or mentioned work and marks selected items as done. CX Codex +1 115installs glab-milestone The glab-milestone Claude Code skill manages GitLab milestones, from creating and editing them to listing, viewing, and deleting them. It activates for release planning and milestone progress tasks. CX Codex +1 114installs glab-iteration glab-iteration — a skill for Claude Code and Codex that manages GitLab iterations. It activates for sprint planning, issue assignment, and progress checks. CX Codex +1 114installs glab-cluster The glab-cluster Claude Code skill manages GitLab Kubernetes clusters and their agents. It activates for cluster connections and Kubernetes integration tasks. CX Codex +1 113installs

Project sponsors

Companies that keep this analytics open