glab-api_skill

This skill makes authenticated requests to GitLab's REST or GraphQL API and prints the response for quick integration checks.
  • Python

2.5k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill glab-api

  • SKILL.md11.7 KB

Overview

This skill provides a wrapper for making authenticated HTTP requests to the GitLab API using the glab cli. It handles REST and GraphQL endpoints, automatic repository placeholder substitution, pagination, output formatting, and common request options. Use it to query, create, or modify GitLab resources from scripts, CI, or your terminal.

How this skill works

It invokes glab api with an endpoint and optional flags to perform authenticated requests against a GitLab host discovered from the current repo or overridden with --hostname. Placeholders like :repo, :namespace, and :branch are replaced from the repository context. The skill supports field and raw-field parameters, POST/GET overriding, GraphQL variables, pagination, and json/ndjson output formats.

When to use it

  • Inspect or modify GitLab resources from the command line or scripts.
  • Run GraphQL queries against GitLab with variable support and pagination.
  • Automate release, issue, MR, or project data retrieval in CI pipelines.
  • Fetch large result sets sequentially using --paginate and ndjson for memory efficiency.
  • Inject repository-specific values into API paths using built-in placeholders.

Best practices

  • Prefer --output ndjson for large result sets and downstream jq processing.
  • Use --paginate when you need the complete collection of pages; ensure GraphQL queries expose pageInfo when paginating.
  • Use --field for type-aware JSON conversion and --raw-field for literal strings or binary content.
  • Set --hostname when operating against self-hosted GitLab instances or nonstandard hosts.
  • Avoid printing secrets: use authenticated hosts configured in glab and --silent when scripts should not expose response bodies.

Example use cases

  • List issues for the current repository: glab api issues --paginate --output ndjson | jq ...
  • Run a GraphQL query for the current user: glab api graphql -f query='query { currentUser { username } }'
  • Create a release using repository placeholders: glab api projects/:fullpath/releases -F tag_name=v1.0.0 -F description=@release-notes.md
  • Fetch all projects or groups with pagination: glab api projects --paginate --output ndjson
  • Integrate into CI to post comments or update MR status using POST fields and repository-derived :id placeholder.

FAQ

Add --hostname <your-host> to the command or configure the authenticated host in the repository's git config.

When should I use --raw-field vs --field?

Use --raw-field to pass literal strings exactly as given. Use --field for automatic type conversion (booleans, numbers, null) and placeholder substitution from the repo.

How does pagination work for GraphQL?

Use --paginate and ensure your query accepts an $endCursor variable and returns pageInfo{ hasNextPage, endCursor } so the skill can fetch subsequent pages.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational