gitlab
Use the glab CLI for everything. The user's OAuth access token is
exported as $GITLAB_TOKEN; glab reads it automatically (the token
is also accepted via GITLAB_ACCESS_TOKEN and OAUTH_TOKEN for tooling
compatibility). Default host is gitlab.com — for self-hosted set
GITLAB_HOST or pass --hostname <host> per command.
glab --help and glab <subcommand> --help are always current.
Two ways to call glab — prefer subcommands
Style A: First-class subcommands — START HERE
glab issue, glab mr, glab repo, glab ci, glab job, glab pipeline,
glab release, glab snippet, glab variable, glab label,
glab milestone, glab schedule. These print formatted text by default
and JSON via --output json.
Style B: Raw REST / GraphQL via glab api
glab api <path> for REST, glab api graphql -f query='…' for GraphQL.
Notable flags:
-X POST|PATCH|PUT|DELETE— override method (defaultGET, becomesPOSTwhen--field/--raw-fieldis set).-f key=value— magic-typed (literalstrue/false/null/ integers become JSON types, leading@filenamereads from a file).-F key=value— same as-fbut always treats the value as a string.--paginate— auto-walkLink: rel="next".--hostname <host>— target a different GitLab host than default.- Path placeholders: when run inside a git checkout,
:fullpath/:branch/:userare auto-populated from the repo. From a generic shell, encode the path manually (see recipes).
Recipes
List open issues on a project
glab issue list --repo OWNER/PROJECT --opened --output json
glab issue list --repo OWNER/PROJECT --assignee=@me --output json
View an issue with comments
glab issue view 42 --repo OWNER/PROJECT --comments
glab issue view 42 --repo OWNER/PROJECT --output json
Create / comment / close an issue
glab issue create --repo OWNER/PROJECT --title "Bug: foo" --description "Repro steps…" --label bug
glab issue note 42 --repo OWNER/PROJECT --message "Acknowledged."
glab issue close 42 --repo OWNER/PROJECT
List MRs assigned to / authored by me
glab mr list --repo OWNER/PROJECT --assignee=@me --opened --output json
glab mr list --repo OWNER/PROJECT --author=@me --opened
View an MR with diff and CI pipeline
glab mr view 99 --repo OWNER/PROJECT
glab mr diff 99 --repo OWNER/PROJECT
glab ci view --repo OWNER/PROJECT --branch <BRANCH>
Approve / merge / leave a note on an MR
glab mr approve 99 --repo OWNER/PROJECT
glab mr note 99 --repo OWNER/PROJECT --message "Looks good — ready when CI is green."
glab mr merge 99 --repo OWNER/PROJECT --squash --remove-source-branch
Read a file from the default branch (raw bytes)
# URL-encode the project path AND the file path because both contain '/'.
PROJECT=$(printf '%s' 'OWNER/PROJECT' | jq -sRr @uri)
FILE=$(printf '%s' 'src/main.go' | jq -sRr @uri)
glab api "projects/${PROJECT}/repository/files/${FILE}/raw?ref=main"
List the latest pipelines on a branch
glab ci list --repo OWNER/PROJECT --status running,success,failed
glab ci view --repo OWNER/PROJECT --branch main
glab ci trace --repo OWNER/PROJECT <JOB_ID> # stream a job log
Search across a group's issues
glab api "groups/GROUP_PATH_OR_ID/issues?state=opened&search=keyword" \
--paginate \
| jq '.[] | {iid, title, project: .references.full, web_url}'
GraphQL example: project metadata + open MR count
glab api graphql -f query='
query($path: ID!) {
project(fullPath: $path) {
name webUrl
mergeRequests(state: opened) { count }
}
}' -f path=OWNER/PROJECT
Notes
--repo OWNER/PROJECTacceptsOWNER/PROJECT,GROUP/SUBGROUP/PROJECT, full HTTPS URL, or git URL. The project path goes verbatim (no URL encoding) for--repo, but does needjq @uriencoding when used inside aglab apipath.- For self-hosted GitLab the user must have authorized the connection
with the right
host. A 404 on a project you know exists usually means the connection is pointing at gitlab.com when the project lives elsewhere — surface that hint to the user. - Many
glabcommands have an--outputflag that takestext(default) orjson.glab issue listandglab mr listadditionally have--output-format(details/ids/urls) which is a separate, list-only formatter. Pass the long flag--output jsonto avoid the short-flag confusion (-Ovs-F).
More from acedatacloud/skills
luma-video
Generate AI videos with Luma Dream Machine via AceDataCloud API. Use when creating videos from text prompts, generating videos from reference images, extending existing videos, or any video generation task with Luma. Supports text-to-video, image-to-video, and video extension.
10short-url
Create short URLs via AceDataCloud API. Use when generating shortened links for sharing, or batch-creating multiple short URLs at once. Supports custom slugs and expiration.
9seedream-image
Generate and edit AI images with Seedream (ByteDance) via AceDataCloud API. Use when creating images from text prompts, editing existing images, or working with high-resolution outputs. Supports Seedream 3.0 T2I, 4.0, 4.5, 5.0, and SeedEdit 3.0 models.
9flux-image
Generate and edit images with Flux (Black Forest Labs) via AceDataCloud API. Use when creating images from text prompts, editing existing images with text instructions, or when high-quality image generation is needed. Supports multiple Flux models including dev, pro, ultra, and kontext for editing.
9veo-video
Generate AI videos with Google Veo via AceDataCloud API. Use when creating videos from text descriptions, animating still images into video, upscaling/extending videos, re-shooting with new camera motion, or inserting/removing objects. Supports Veo 2, Veo 3, and Veo 3.1 models including fast variants.
9sora-video
Generate AI videos with OpenAI Sora via AceDataCloud API. Use when creating videos from text prompts, generating videos from reference images, or using character references from existing videos. Supports text-to-video, image-to-video, and character-driven generation with multiple models and resolutions.
8