Integrate Orbit into glab CLI
Integrate the Knowledge Graph (GKG) service into `glab` as a native subcommand (`glab gkg or glab orbit`), enabling users and AI agents to query the graph, retrieve entities, and interact with GKG directly from the CLI. This offloads auth, distribution, config management, and binary install to `glab` rather than building a standalone GKG CLI.
## Proposed Command Structure
```
glab orbit status # Check GKG service availability
glab orbit query # Run queries against the Knowledge Graph
glab orbit [entity] # Get graph entities
glab orbit setup # Install Orbit MCP config + skill for your AI coding agent
```
> Command structure to be finalized during implementation. Commands should be tagged as **experimental** until stable.
### `glab orbit setup`
One command that gives any AI coding agent full Orbit capability. Proposed in [gitlab-org/cli#8286](https://gitlab.com/gitlab-org/cli/-/work_items/8286).
- Detects your agent (Claude Code, Cursor, OpenCode, Codex, Gemini CLI, Duo CLI)
- Writes the Orbit MCP config to the agent's config file
- Installs the Orbit skill ([knowledge-graph!1021](https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/merge_requests/1021)) to the agent's skills directory
- Verifies the connection with `orbit/status`
A working shell-script POC was tested on macOS with Claude Code on 2026-04-27. Full details in [gitlab-org/cli#8286](https://gitlab.com/gitlab-org/cli/-/work_items/8286#note_2422783654).
## Implementation Plan
### Phase 1 — client go (Prerequisite)
* Implement GKG API endpoints via [client go](https://www.google.com/url?q=https://gitlab.com/gitlab-org/api/client-go&sa=D&source=docs&ust=1771639219965523&usg=AOvVaw3Nr9lvEZBYIStbgRDx4Nqz)
### Phase 2 — `glab` Version Bump (`glab` CLI Team)
Once the client go changes are merged, bump the `glab` dependency to make the new endpoints available.
* Version bump `client go`in `glab`
* Confirm new GKG endpoints are accessible
### Phase 3 — Implement `glab orbit` Subcommands
Implement the `glab orbit` subcommand suite.
* Define final command structure
* Implement commands (status, query, entity retrieval, etc.)
* Tag commands as experimental to allow iteration without breaking change constraints
* Skills may be downloadable via subcommand; explore server-side hosting and configuration with GKG service
## Error Handling Requirements
GKG will be behind a GitLab feature flag. The REST API will not be available until the flag is enabled. If a user runs a `tglab orbit` command on an instance where the flag is off:
* Must return **exit code 1**
* Must **not** surface a raw 404 error
* Error message should clearly indicate GKG is unavailable on this instance
> Note: REST API endpoints should be marked **experimental** to allow flexibility during iteration. Per GitLab convention, v4 REST APIs cannot be broken once published — marking as experimental provides an exception path.
## Open Questions
* [ ] Final `glab orbit` command structure
* [ ] Scope of initial commands for first release
* [ ] Server-side skill hosting and configuration approach
* [ ] Timeline dependency on GKG feature flag rollout
## References
* [GKG x glab sync not](https://docs.google.com/document/d/1DbI7TmsO7X6ULD33KaggVWiywLcAHyK5UBGeWfxp81Y/edit?tab=t.0)es — Feb 20, 2026
* [client go library](https://gitlab.com/gitlab-org/api/client-go)
issue