About glab-snippet
glab-snippet is a skill for creating GitLab project and personal snippets with the glab CLI. It covers file and stdin input, visibility choices, and safe handling of existing snippets through the API.
Key features
- 01Create project and personal snippets
- 02Upload one or multiple files
- 03Create snippets from stdin
- 04Set snippet visibility
- 05Use glab api for existing snippets
Use cases
- 01Publish a code example from local files
- 02Create a snippet from piped command output
- 03Choose visibility when publishing content
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ vince-winkintel/ gitlab-cli-skills --skill glab-snippetAfter installing, type/glab-snippetin Claude Code to confirm it loaded.
Bundled filesreferences/commands.md
Details
From the project READMEglab 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.