Use Orbit Local with the Orbit CLI (orbit)
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Experiment
The Orbit CLI (orbit) builds a code graph for any local repository and queries it
against a local DuckDB file. No GitLab connection required.
Orbit Local is experimental. Until packaged binaries ship,
you must build from source. The packaged install path will be glab orbit local.
Prerequisites
- Rust toolchain (stable)
misefor tool management- A local Git repository to index
Install
Build from source:
git clone https://gitlab.com/gitlab-org/orbit/knowledge-graph.git
cd knowledge-graph
mise install
mise run build:cliThe compiled binary is at target/release/orbit. Add it to your PATH or
invoke it directly.
Index a repository
orbit index /path/to/your/repoOrbit parses the repository and writes a DuckDB graph to ~/.orbit/graph.duckdb.
You can index multiple repositories. Each is scoped by project ID and branch
in the manifest table.
| Flag | Purpose |
|---|---|
--threads | Worker thread count. 0 (default) auto-detects from CPU cores. |
--stats | Include detailed statistics in the JSON output. |
--verbose | Verbose logging to stderr. |
Query the graph
orbit query '{
"query_type": "traversal",
"node": {
"id": "d",
"entity": "Definition",
"columns": ["name", "definition_type", "file_path"],
"filters": { "definition_type": "Method" }
},
"limit": 20
}'The query language is identical to Orbit Remote. See the query language reference for full syntax.
| Flag | Purpose |
|---|---|
--raw | Emit raw JSON instead of LLM-friendly text. |
--ontology | Override the ontology directory. Defaults to embedded. |
Inspect the schema
orbit schema --ontology
orbit schema --ontology --expand Definition File
orbit schema --query--ontology describes the graph (entities, edges, properties).
--query describes the query DSL (how to write queries).
Compile a query without running it
orbit compile --local '{
"query_type": "traversal",
"node": {
"id": "f",
"entity": "File",
"columns": ["path"],
"filters": {"language": "ruby"}
},
"limit": 5
}'Useful for debugging query DSL or seeing the generated DuckDB SQL.
Run raw SQL against the local graph
orbit sql 'SELECT count(*) FROM gl_definition'
orbit sql -F json 'SELECT name FROM gl_definition LIMIT 3'
echo 'SELECT 1+1' | orbit sql -
orbit sql --file query.sql| Flag | Purpose |
|---|---|
-F, --format | table (default), json, ndjson, or csv. |
-f, --file | Read the SQL from a file. |
--db | Override the DuckDB path. Defaults to ~/.orbit/graph.duckdb. |
Storage
The graph is stored at ~/.orbit/graph.duckdb. Multiple repositories share
the same database. Delete the file to start over.
Billing
Orbit Local does not consume GitLab Credits. All processing is local.
What to try next
- Connect via MCP - expose the local graph to Claude Code or Codex.
- Use Orbit Local with glab - call the CLI through
glab orbit local. - Schema reference - available node types and properties.
- Cookbook - copy-paste queries for common use cases.