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

Install

Build from source:

git clone https://gitlab.com/gitlab-org/orbit/knowledge-graph.git
cd knowledge-graph
mise install
mise run build:cli

The compiled binary is at target/release/orbit. Add it to your PATH or invoke it directly.

Index a repository

orbit index /path/to/your/repo

Orbit 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.

FlagPurpose
--threadsWorker thread count. 0 (default) auto-detects from CPU cores.
--statsInclude detailed statistics in the JSON output.
--verboseVerbose 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.

FlagPurpose
--rawEmit raw JSON instead of LLM-friendly text.
--ontologyOverride 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
FlagPurpose
-F, --formattable (default), json, ndjson, or csv.
-f, --fileRead the SQL from a file.
--dbOverride 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