glab(1)

πŸ’… glab-snippet-create β€” bestie, let's make a snippet πŸ’…

Okay so this is the glab(1) manual page for glab snippet create, and it's literally the group-chat explainer for creating a new snippet. The vibe: provide one or more file paths to upload, or pass --filename and pipe content from standard input. No cap, that's the core move. 🫢


πŸŽ€ NAME πŸŽ€

glab-snippet-create β€” create a new snippet. Short, sweet, iconic. πŸ’–

✨ SYNOPSIS ✨

glab snippet create -t   [...] [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: provide one or more file paths to upload, or pass --filename and pipe content from standard input. That's the assignment. ✨

Snippets are created in the current project by default. Want it personal? Use --personal to create the snippet in your personal account instead. And use --visibility to control who can see it. Flexible, but make it intentional. πŸ’…

πŸ‘‘ OPTIONS πŸ‘‘

  • -d, --description="" β€” Description of the snippet. Set to "-" to open an editor. Editor jumpscare, but make it on purpose. 😭
  • -f, --filename="" β€” Filename of the snippet in GitLab. So GitLab knows what to call it, bestie.
  • -p, --personal[=false] β€” Create a personal snippet. The [=false] is right there; it does not start enabled by default. 🫢
  • -t, --title="" β€” (required) Title of the snippet. It's required, so don't skip it. Periodt. πŸ‘‘
  • -v, --visibility="private" β€” Limit by visibility: 'public', 'internal', or 'private'. Default is "private"; choose your visibility era wisely. 🌈

🌸 OPTIONS INHERITED FROM PARENT COMMANDS 🌸

  • -h, --help[=false] β€” Show help for this command. The classic icon. πŸ‘‘
  • -R, --repo="" β€” Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted. Repo-targeting slay. πŸ¦‹

πŸ“ EXAMPLE πŸ“

glab snippet create script.py --title "Title of the snippet"
echo "package main" | glab snippet new --title "Title of the snippet" --filename "main.go"
glab snippet create -t Title -f "different.go" -d Description main.go
glab snippet create -t Title -f "different.go" -d Description --filename different.go main.go
glab snippet create --personal --title "Personal snippet" script.py

πŸ’œ SEE ALSO πŸ’œ


Auto generated by spf13/cobra Β· Nov 2026 Β· glab(1) β€” okay bye bestie, go make that snippet, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from