The omnigraph CLI can work directly with a graph store, through a running
server, or with a cluster definition. Start with the form that matches the
resource you have:
# One graph, opened directly
omnigraph query sources_for_claim --query queries.gq \
--params '{"claim":"lower-latency"}' --store ./graph.omni
# One graph on a multi-graph server
omnigraph query sources_for_claim --params '{"claim":"lower-latency"}' \
--server prod --graph knowledge
# A reusable scope from ~/.omnigraph/config.yaml
omnigraph query sources_for_claim --params '{"claim":"lower-latency"}' \
--profile prod-knowledgeRun omnigraph <command> --help for the flags supported by your installed
version. The CLI reference summarizes addressing, commands,
configuration, and output formats.
For a managed cluster, first select it with use and cache an identity
credential with cluster token. Run graphs list to discover graph names,
then query or mutate from that folder with an explicit --graph. Applied
Cedar policy determines your permissions. See managed data access
for legacy restricted credentials, expiry, offline operation, and clearing.
omnigraph init --schema schema.pg ./graph.omni
omnigraph load --data evidence.jsonl --mode overwrite ./graph.omni
omnigraph query sources_for_claim \
--query queries.gq \
--params '{"claim":"lower-latency"}' \
--format table \
--store ./graph.omniload always requires a mode:
overwritereplaces each node or edge type represented in the batch. Types absent from the batch are unchanged.appendinserts new entities and rejects duplicate IDs.mergeinserts new IDs and updates existing IDs.
Use mutate for .gq insert, update, and delete queries:
omnigraph mutate add_source \
--query mutations.gq \
--params '{"slug":"incident-review","title":"Incident review"}' \
--store ./graph.omniFor a stored server query, omit --query; the positional name selects the
query from the server's registry:
omnigraph query sources_for_claim --server prod --graph knowledge \
--params '{"claim":"lower-latency"}'omnigraph branch create review/new-data --from main --store ./graph.omni
omnigraph load --data batch.jsonl --mode merge \
--branch review/new-data ./graph.omni
omnigraph query inspect --query review.gq \
--branch review/new-data --store ./graph.omni
omnigraph branch merge review/new-data --into main --store ./graph.omniEach branch operation is also a GQ statement, run through the same verbs that
run any .gq source: the control writes through mutate, the listing through
query. A statement names its branches itself, so it takes no --branch:
omnigraph mutate -e 'branch create "review/new-data" from main' --store ./graph.omni
omnigraph query -e 'branch list' --format table --store ./graph.omni
omnigraph mutate -e 'branch merge "review/new-data" into main' --store ./graph.omni
omnigraph mutate -e 'branch delete "review/new-data"' --store ./graph.omniSee Branches and commits for isolation, history, and merge behavior.
--set NAME=VALUE, repeatable, gives a session
setting a value for one invocation; the
value is spelled as after = in a set line (--set merge_lineage=off). A set
line in the source applies after --set, so the file wins.
query --set: applies to the read,showincluded.mutate --set: applies to the mutation or branch statement.branch merge --set: applies to the merge (--set merge_lineage=verify).commit changes --set: sent asset=NAME=VALUEon the commit's change read. The values are validated and select nothing in this release; a direct run (--store) accepts them with no effect.changes poll --set: sent asset=NAME=VALUEon the change feed read, with the same validation and the same absence of effect.load --setandingest --set: a direct run (--store) applies them to the staged write (--set stage_write_concurrency=16); a served run refuses any--setbefore sending, since the served load and ingest routes carry nosettingsfield.
omnigraph query reports --query queries.gq --set merge_lineage=off --store ./graph.omni
omnigraph branch merge review/new-data --into main --set merge_lineage=verify --store ./graph.omniA direct run (--store) is the process, so it accepts a process setting
from --set, the file and the environment. A served run (--server) sends
--set values in the request's settings field, and a --set or set line
naming a process setting is refused before anything is sent: setting is a process setting; it is read from the server's environment, not from a request.
A stored query takes no --set: omnigraph query <name> without -e or
--query runs under the process defaults.
Read a managed Blob cell to a file or inspect its metadata:
omnigraph blob get node Document doc-42 body \
--store ./graph.omni --out body.bin
omnigraph blob stat node Document doc-42 body \
--store ./graph.omni --jsonblob get writes bytes to stdout when --out is omitted. Add --offset and
--length for a range. The CLI reports external references but does not follow
them. See Blob values for the complete contract.
omnigraph snapshot ./graph.omni --json
omnigraph commit list ./graph.omni --json
omnigraph schema show ./graph.omni
omnigraph optimize ./graph.omni
omnigraph repair ./graph.omni # preview only
omnigraph cleanup --keep 10 --older-than 7d ./graph.omni
omnigraph cleanup --keep 10 --older-than 7d --confirm ./graph.omniMaintenance commands open storage directly; they do not run through
--server. For a cluster-managed graph, address it with
--cluster <root> --graph <id>. Read the
maintenance guide before repair or cleanup.
Declare the server once, store its token, then address graphs by ID:
# ~/.omnigraph/config.yaml
servers:
prod:
url: https://graph.example.comprintf '%s' "$OMNIGRAPH_TOKEN" | omnigraph login prod
omnigraph graphs list --server prod
omnigraph query sources_for_claim --params '{"claim":"lower-latency"}' \
--server prod --graph knowledgeThe token is stored separately from config.yaml. A server resolves the actor
from the token; clients cannot override it with --as.
Without a managed context, cluster commands read a directory containing
cluster.yaml:
omnigraph cluster validate --config ./company-brain
omnigraph cluster plan --config ./company-brain
omnigraph cluster apply --config ./company-brain --as act-aliceThey manage graph definitions, schemas, stored queries, and policies—not graph data. See Operating a cluster.
For a managed cluster, log in to its Intent API and select the cluster for your config directory:
omnigraph login --api https://control.example
omnigraph use CLUSTER_ID --api https://control.example --config ./company-brain
omnigraph cluster plan --config ./company-brain --json > plan.json
omnigraph cluster apply --config ./company-brain --plan "$(jq -r .data.run_id plan.json)" --json
omnigraph cluster status --config ./company-brain --json
omnigraph cluster history --config ./company-brain --json
omnigraph logout --api https://control.exampleCommit and push external configuration before planning. The API plans its
bound head, or the pushed revision selected with --rev. Apply uses the exact
saved plan and your current permissions. To release an unused plan, run
omnigraph cluster cancel PLAN_RUN_ID --config ./company-brain; its result
remains in history and cannot be applied afterward.
The folder's .omnigraph/context selects the managed API. An unavailable API
or malformed context causes an error. To intentionally use the direct
cluster.yaml path, pass --direct. See Managed cluster commands
for credential storage, automation, bounded waits, and exit codes.
omnigraph lint --schema schema.pg --query queries.gq
omnigraph queries validate --cluster ./company-brain --graph knowledgelint checks one .gq source. queries validate checks the applied stored
query registry for a cluster graph.
read, change, check, and ingest remain compatibility shims. New scripts
should use query, mutate, lint, and load.