glab(1)

πŸ“¦
version 1.114.0 Β· 3 versions
, in epel 10, epel 9, fedora 44, opensuse-leap 16.0

πŸ’« glab-orbit-remote-query β€” aka the glab orbit remote query page from your glab(1) manual πŸ’«

okay bestie, sit down, hydrate, because this one is experimental and we're gonna talk about it 🫢

✨ NAME ✨

glab-orbit-remote-query β€” Execute a GitLab Knowledge Graph query. (EXPERIMENTAL)

Not me putting the all-caps EXPERIMENTAL in bold, but like, it's giving important, so. πŸ™ˆ

🌸 SYNOPSIS 🌸

glab orbit remote query [file|-] [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this does is call POST /api/v4/orbit/query with a JSON request body, and then it prints the server response verbatim. That's it. That's the whole vibe. No remixing, no glow-up, the bytes come out exactly how they went in. ✨

The body gets read from a file path, or from standard input when the argument is - or just... omitted entirely. Queen of flexibility.

The request body has to be a full Orbit query envelope, like:

{
  "query": { "query_type": "...", ... },
  "response_format": "llm" | "raw"
}

--response-format overrides the body's response_format value, or sets it if it's absent. And if neither the body nor --response-format specifies a format? Then llm is used by default, periodt. Here's the tea on the two formats:

  • llm is compact GOON/TOON text β€” it's literally intended for agents πŸ€–
  • raw returns structured JSON, which is the one you want if you're piping into jq

The server's response body gets written to stdout verbatim regardless of format β€” no client-side decoding or re-encoding is performed. Like, zero. None. The client is not touching it. πŸ’…

Compatibility note, bestie, listen up: prior to this change, --format raw output was re-marshalled through the SDK's typed OrbitQueryResult struct (producing indented JSON). It is now the server's bytes verbatim (compact JSON). So if you're out here needing indented output, pipe into jq . β€” that's the move. 😭

The graph DSL JSON Schema is served by glab orbit remote tools and it is the source of truth for the body shape. πŸ‘‘ And see also glab orbit remote schema for the graph ontology.

For the full query language reference with examples, go fetch the docs from the Knowledge Graph repository:

glab api "projects/gitlab-org%2Forbit%2Fknowledge-graph/repository/files/docs%2Fsource%2Fqueries%2Fquery_language.md?ref=main" | jq -r .content | base64 -d
⚠️ This feature is an experiment and is not ready for production use. It might be unstable or removed at any time. For more information, see https://docs.gitlab.com/policy/development_stages_support/. πŸ’€

πŸŽ€ OPTIONS πŸŽ€

  • --hostname="" β€” GitLab hostname to query. Defaults to the current repository's host or gitlab.com.
  • --response-format="llm" β€” Server response format: llm (compact GOON/TOON for agents) or raw (structured JSON).

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

  • -h, --help[=false] β€” Show help for this command.

πŸ’– EXAMPLE πŸ’–

# Run a query from a file
$ glab orbit remote query ./query.json

# Run a query from stdin
$ cat ./query.json | glab orbit remote query -

# Force raw output (pipeable into jq)
$ glab orbit remote query --response-format raw ./query.json

⭐ SEE ALSO ⭐


Auto generated by spf13/cobra, dated Aug 2026, and living in the glab(1) manual β€” okay that's the whole page bestie, you ate that read, now go query something πŸ”₯πŸ’œ

πŸ“¦ where this page comes from