mcpField
G
glab-snippet

glab-snippet

github.com/vince-winkintelDevelopment4997 installsUpdated 1d ago
Repository

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

  1. 01Create project and personal snippets
  2. 02Upload one or multiple files
  3. 03Create snippets from stdin
  4. 04Set snippet visibility
  5. 05Use glab api for existing snippets

Use cases

  1. 01Publish a code example from local files
  2. 02Create a snippet from piped command output
  3. 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-snippet

After installing, type/glab-snippetin Claude Code to confirm it loaded.

Bundled filesreferences/commands.md

Details

From the project README

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.

Comments

Markdown supported