CLI
init
Create a new Omnigraph repository from a schema file.
The init command creates a new Omnigraph repository. It compiles the schema, creates storage tables for each declared node and edge type, and sets up the main branch.
Usage
omnigraph init --schema <file> <path>Arguments
| Argument | Required | Description |
|---|---|---|
path | yes | Filesystem path for the new repository (.omni) |
Options
| Option | Required | Description |
|---|---|---|
--schema | yes | Path to a .pg schema file |
Example
Given a schema file schema.pg:
node Person {
name: String @key
age: I32?
embedding: Vector(1536) @embed
}
node Company {
name: String @key
}
edge WorksAt: Person -> Company
edge Knows: Person -> Person {
since: Date?
}Initialize a repository:
omnigraph init --schema schema.pg ./my-graph.omniWhat gets created
The init command produces the following directory structure:
| Path | Purpose |
|---|---|
_schema.pg | A copy of the compiled schema |
_manifest.lance/ | Lance dataset tracking branch pointers and snapshot versions |
nodes/Person/ | Lance dataset for the Person node table |
nodes/Company/ | Lance dataset for the Company node table |
edges/WorksAt/ | Lance dataset for the WorksAt edge table |
edges/Knows/ | Lance dataset for the Knows edge table |
Each node and edge type declared in the schema gets its own Lance dataset directory. The _manifest.lance/ directory tracks which snapshot version each branch points to.
The repository starts with a single branch (main) at snapshot version 1, with all tables empty.