---
name: "glab-snippet"
section: "1"
platform: "linux"
package: "glab"
version: "1.126.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/glab-snippet"
---

# glab-snippet(1)

Create snippets.

## NAME

glab-snippet - Create snippets.

## SYNOPSIS

**glab snippet  \[flags\]**

## DESCRIPTION

Snippets store and share small pieces of code or text. A snippet can belong to a project, or to your personal account when you pass **--personal**.

To view and edit existing snippets, use the GitLab UI or **glab api** with the Project snippets API ⟨https://docs.gitlab.com/api/project\_snippets/⟩ or personal Snippets API ⟨https://docs.gitlab.com/api/snippets/⟩.

## OPTIONS

**-R**, **--repo**=""\
 	Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.

## OPTIONS INHERITED FROM PARENT COMMANDS

**-h**, **--help**\[=false\]\
 	Show help for this command.

## EXAMPLE

```
glab snippet create --title "Title of the snippet" --filename "main.go"
```

## SEE ALSO

**[glab(1)](/glab/1.md)**, **[glab-snippet-create(1)](/glab-snippet-create/1.md)**
