glab orbit setup - one command to install Orbit MCP config + skill for any AI coding agent
## Problem
There is no single command to connect an AI coding agent to Orbit. Today a user needs to:
1. Find and read the MCP setup docs
2. Manually write the MCP config for their specific agent
3. Separately find, clone, and symlink the orbit skill into their agent's skills directory
This is three steps across two different concepts (MCP + skills) with agent-specific instructions for each. It breaks down entirely for agents without documented skill conventions.
## Proposal
`glab orbit setup` - one command that gives any AI coding agent full Orbit capability.
```
$ glab orbit setup
✓ Detected Claude Code (~/.claude/)
✓ MCP server registered: gitlab-orbit → https://gitlab.com/api/v4/orbit/mcp
✓ Skill installed: ~/.claude/skills/orbit/
Orbit is ready. Ask your agent: "Check the Orbit API status"
```
## What it does
**1. Writes the MCP config** for the detected agent
Registers the Orbit MCP endpoint (`https://gitlab.com/api/v4/orbit/mcp`) in the agent's MCP config. Format varies by agent:
| Agent | Config target |
|---|---|
| Claude Code | `~/.claude/settings.json` (mcpServers) |
| Cursor | `~/.cursor/mcp.json` |
| OpenCode | `~/.config/opencode/opencode.json` |
| Codex | `~/.codex/config.json` (mcpServers) |
| Gemini CLI | `~/.gemini/settings.json` (mcpServers) |
| Unknown | Prints the JSON snippet to stdout for manual paste |
**2. Installs the orbit skill** for agents that support skills
Downloads the orbit skill from `gitlab-org/orbit/knowledge-graph` (or reads from the embedded binary once bundled via `glab skills`) and writes it to the agent's skills directory.
| Agent | Skill target |
|---|---|
| Claude Code | `~/.claude/skills/orbit/` |
| OpenCode | `~/.config/opencode/skills/orbit/` |
| Cursor, Codex, Gemini CLI | No skill convention yet - MCP only |
**3. Verifies the connection**
Calls `glab api orbit/status` and reports whether the service is reachable. If the `knowledge_graph` feature flag is off, surfaces a clear error with the chatops command to enable it.
## Flags
```
--agent <name> Override auto-detection (claude-code, cursor, opencode)
--mcp-only Skip skill installation
--skill-only Skip MCP config
--dry-run Print what would be done without writing anything
```
## Agent detection
Auto-detect by checking for known config directories in order:
- Claude Code: `~/.claude/` exists
- Cursor: `~/.cursor/` exists
- OpenCode: `~/.config/opencode/` exists
- Fallback: print universal MCP JSON to stdout
## Why glab owns this
- glab already holds the user's GitLab auth (no extra token setup)
- glab knows the instance URL (no hardcoded gitlab.com)
- works for both .com and self-managed once Orbit ships there
## Related
- https://gitlab.com/gitlab-org/gitlab/-/work_items/591015 - Integrate Orbit into glab CLI
- https://gitlab.com/gitlab-org/cli/-/issues/8252 - `glab skills` command
- https://gitlab.com/gitlab-org/cli/-/issues/8240 - `glab orbit` POC
- https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/work_items/387 - MCP setup docs
- https://gitlab.com/groups/gitlab-org/-/work_items/20357 - GKG Core Development Workstream
issue