Glab snippet

From vince-winkintel/gitlab-cli-skills · View interactive version

Glab snippet is an AI agent skill from the GitHub repository vince-winkintel/gitlab-cli-skills. 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 snip

How to use this skill

Skill file

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

# 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

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 through glab api. For personal snippets, use the Snippets API. 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 for checksum-verified glab snippet and glab snippet create help.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.