Use the `glab orbit` CLI for questions about code structure, blast radius, cross-project links, and relationships across GitLab entities, and to build a repo map. It works on hosted or local data. Skip it for single-entity lookups or writes that `glab` already handles.
67
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Query GitLab Orbit (previously GitLab Knowledge Graph) through the flat glab orbit command tree. It needs glab v1.117.0 or later. Hosted commands handle authentication, response framing, and exit codes. Local commands use the managed binary and the local DuckDB graph.
If a glab orbit command fails with "command not found", an auth error, or a feature-flag exit code, work through the first-run setup.
glab orbit help and glab orbit <command> --help are the authoritative usage references. Run glab orbit skills to read the bundled local skill and list any additional runtime skills, or glab orbit skills get orbit references/local/sql.md to read one of its files. For entity properties, prefer the recipes in references/recipes.md over schema introspection. They already encode the columns and filters known to work.
If you must introspect, call glab orbit ontology <Entity...> with explicit entity names. The unscoped form returns about 17 KB of output. Call it at most once per session, because the ontology does not change mid-session. glab orbit dsl prints the full DSL JSON Schema. The ontology command returns an object with a nodes array and does not accept --jq, so pipe into jq. Per-node outgoing_edges and incoming_edges are arrays of edge type names, not objects:
glab orbit ontology Project |
jq '.nodes[] | select(.name == "Project") | .properties'Each glab orbit query has fixed per-call overhead. Prefer one aggregation query over N traversal queries for "how many X grouped by Y", and batch related lookups.
When editing Orbit docs or skills, fence executable query JSON as json orbit-query so docs smoke tests run it.
Write the request body to a file and pass it to glab orbit query. Default output is llm (compact, agent-friendly). Pass --response-format raw to pipe into jq. Endpoints are user-scoped, so do not pass -R owner/repo.
Many filters need a numeric project ID. For the repository you are in, let glab resolve it from the Git remote.
PROJECT_ID=$(glab api projects/:fullpath | jq -r '.id')Put the request body in /tmp/q.json.
{
"query": {
"query_type": "traversal",
"nodes": [
{"id": "p", "entity": "Project",
"filters": {"id": {"eq": 278964}}},
{"id": "mr", "entity": "MergeRequest",
"columns": ["iid", "title", "state"]}
],
"relationships": [
{"type": "IN_PROJECT", "from": "mr", "to": "p"}
],
"order_by": "-mr.created_at",
"limit": 5
}
}glab orbit query /tmp/q.jsonfilters is an object keyed by property name, not an array. Every query declares its node selectors in the nodes array. Filter operators, multi-hop hops, and path_finding limits are in references/query_language.md. Paste-ready shapes for each query_type are in references/recipes.md.
Read the recipes before you construct a query. The same question often has one canonical shape and several wrong shapes that look correct. Four traps recur:
source = "merge_request_event" filter. See the recipe.aggregation counts.HAS_DIFF, not HAS_LATEST_DIFF. See the recipe.WorkItem entity. There is no Issue node. See the recipe.Resolve a user question in at most 5 query attempts, validation errors included. Changing only limit or columns is not progress. Full rules: references/troubleshooting.md.
Orbit answers come from graph queries, not an authoritative source. Show the query body and its coverage gaps with every result. Full guidance: references/reporting.md.
For code-structure orientation before you plan a change, use glab orbit repo-map on a local checkout. For a project already indexed in Orbit Remote, use the bundled remote helper script. The script path is relative to this skill root, not the user's repository. See the repository-map rows in References.
glab orbit downloads, verifies, and runs the Orbit binary from the orbit-local package (macOS, Linux, and Windows). The command selects the backend. index, grep, context, sql, schema, list, mcp, and repo-map use the local graph. query, status, ontology, dsl, tools, and graph-status use Orbit Remote.
glab handles --install, --update, and --yes itself and forwards everything else to the binary. --install and --update are mutually exclusive. --yes skips the confirmation prompts, so pass it in scripts and agent runs. glab orbit --help shows the wrapper help. glab orbit help and glab orbit <command> --help show the binary's.
glab orbit --install --yes # install without running
glab orbit --update # install the latest compatible versionSkip the confirmation prompts for good with glab config set orbit_local_auto_run true and glab config set orbit_local_auto_download true. Point glab at your own build with glab config set orbit_local_binary_path /path/to/orbit or the GLAB_ORBIT_LOCAL_BINARY_PATH env var. That skips download, version checks, and updates. glab records orbit_local_binary_version, orbit_local_binary_checksum, and orbit_local_last_update_check itself. Do not set them by hand.
| Topic | Location |
|---|---|
| First-run setup, exit codes, errors, iteration budget | references/troubleshooting.md |
| Full DSL reference | references/query_language.md |
Paste-ready bodies per query_type | references/recipes.md |
| Reporting results and coverage caveats | references/reporting.md |
Local repository map command (glab orbit repo-map) | references/local_repo_map.md |
| Remote repository map helper | references/remote_repo_map.md |
| Maintaining this skill (contributing, doc sync) | references/maintaining.md |
1f9ea75
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.