Skip to main content

The kglite interactive Cypher shell — a sqlite3-style REPL for .kgl knowledge graphs (provides the `kglite` command).

Project description

kglite-cli

The interactive Cypher shell for kglite knowledge graphs — the sqlite3-style REPL for .kgl files.

Install

$ pip install kglite-cli      # ships the `kglite` binary on PATH
# or
$ cargo install kglite-cli    # build from source (needs a Rust toolchain)

kglite-cli is a standalone binary distribution — installing it gives you the kglite command. It's independent of the kglite Python library; install either or both.

Use

Run one query and exit:

$ kglite query app.kgl "MATCH (n:Person) RETURN n.name AS name" --format json
[
  {
    "name": "Alice"
  }
]

Run a scoped write and persist it:

$ kglite write app.kgl "CREATE (:Task {id:'t1', status:'todo'})" \
    --save --write-scope Task --git-sha abc123 --modified-by agent

Inspect a dependency frontier:

$ kglite ready-set app.kgl --done 'n.status = "done"' --node-type Task --format csv

Ask for the agent-oriented graph description:

$ kglite describe app.kgl
$ kglite describe app.kgl --types Task
$ kglite describe app.kgl --cypher

Keep one graph loaded for an agent loop:

$ kglite session app.kgl --format json
{"op":"describe","types":["Task"]}
{"id":"w1","op":"write","query":"CREATE (:Task {id:'t1', status:'todo'})"}
{"id":"q1","op":"query","query":"MATCH (t:Task) RETURN count(t) AS n","format":"json"}
{"op":"save"}
{"op":"exit"}

Session JSON responses echo id when provided. JSON-mode query/write responses return typed rows; table/csv modes return rendered output. For describe, the compact forms still work ("connections":true, "connections":["KNOWS"]), and agents can use explicit object forms: "connections":{"detail":"overview"} or "connections":{"types":["KNOWS"]}.

Or open the interactive shell:

$ kglite app.kgl
kglite shell — app.kgl
Type .help for commands, .quit to exit.
kglite> MATCH (n:Person) RETURN n.name AS name LIMIT 3;
name
----
Alice
Bob
Carol
(3 rows)
kglite> .quit

Run with no path for a scratch in-memory graph ($ kglite). Pure-Rust single binary over kglite::api::* — no Python, no server.

A Cypher statement runs when terminated by ;, so it can span multiple lines; dot-commands run on Enter. Tab completes dot-commands and the graph's labels.

Commands

Non-interactive commands:

  • query <graph.kgl> <cypher> [--format table|csv|json] — run a read-only Cypher query
  • write <graph.kgl> <cypher> [--format table|csv|json] [--save] — run a write-capable Cypher statement
  • write --write-scope A,B --git-sha <sha> --modified-by <actor> — restrict writes and stamp provenance on auto_timestamp types
  • ready-set <graph.kgl> --done <predicate> [--relationship DEPENDS_ON] [--node-type T] — print CALL ready_set(...)
  • describe <graph.kgl> [--types T] [--cypher] [--connections] — print the XML describe() document for agents
  • session <graph.kgl> — process JSONL requests against one in-memory graph (query, write, describe, save, exit)
  • export-text <graph.kgl> — print the deterministic text projection used by git textconv
  • diff <a.kgl> <b.kgl> — compare two graph text projections

Interactive dot-commands:

  • .help — list commands
  • .quit / .exit — leave the shell
  • .labels / .rels / .schema / .indexes — schema introspection
  • .mode table|csv|json — set the output format
  • .import <file.csv> <NodeType> [--id <col>] [--title <col>] — load a CSV as nodes
  • .dump <dir> — export a portable CSV + blueprint.json copy (reload with kglite.from_blueprint(...))
  • .read <file> — run the Cypher statements in a file
  • .save [path] — write the graph to a .kgl file
  • .timing on|off — show query wall-time after each statement

Anything else is executed as Cypher. Ctrl-C cancels a running query; Ctrl-D exits.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kglite_cli-0.12.10-py3-none-win_amd64.whl (4.1 MB view details)

Uploaded Python 3Windows x86-64

kglite_cli-0.12.10-py3-none-musllinux_1_2_x86_64.whl (4.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

kglite_cli-0.12.10-py3-none-musllinux_1_2_aarch64.whl (3.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

kglite_cli-0.12.10-py3-none-manylinux_2_28_aarch64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

kglite_cli-0.12.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

kglite_cli-0.12.10-py3-none-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

kglite_cli-0.12.10-py3-none-macosx_10_12_x86_64.whl (4.2 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file kglite_cli-0.12.10-py3-none-win_amd64.whl.

File metadata

  • Download URL: kglite_cli-0.12.10-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kglite_cli-0.12.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 277336dc94fdb092f48d7e43f4461fd10ade54c362102dad7f10c06a9e2e56af
MD5 e59c44dfff7417a7a60cc447eaf01a0f
BLAKE2b-256 53c45675f0df851ac43e8f643493acc54c9cabd98d5eac6868a13bd0421eac7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-win_amd64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26079cca4e1d4c4715b1ea1cc962e5bd95ab8dff7d07715cfa54ae313ef953d9
MD5 ac04dbe79f18f71a4b7518714179d4a3
BLAKE2b-256 98896e688e0563c7a103a74544055b3bce8fc23cc75e5c05155e47ae0f042855

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-musllinux_1_2_x86_64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a5af92c456bf2dc054f103ce5e60f6972ad731b4a1e35e28b5c6c841705eb90b
MD5 95695796ada375afff08c07739453f16
BLAKE2b-256 bddc2e45c9e6dd7232dc4858f09151491c8b0d8c0b60533c4b0c0a0014541341

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-musllinux_1_2_aarch64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cf633d01d2f6fc0ac6cfc17d76297a7dbb8cbb3fde6111d77296372077a8d0c8
MD5 7fda8595c98a324bee3891a26e9e2172
BLAKE2b-256 ac69602fae1f7ffbb77be6b871f46847e722fd744a2aabb34b11c373d8bc56c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-manylinux_2_28_aarch64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57e9dd5ef96f2974c85c1e52ead1764977b6fcada03e9dbe8488aa767ac4b6a3
MD5 452b4647c872e62f7baef4c2eec49417
BLAKE2b-256 2362c8830df0d502c2eab5dfb9d332fba446ec040279f3738ddee2e1f17c484b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40389bdbcc3d099b30ffa7005c1659662cc8b724bde45e8f885ae92bcfaa2a54
MD5 063df892594cc9aed88a258d51e6c062
BLAKE2b-256 ed7745ef0663abdc142fc5fbdbb4002df4d0521d92e38cea923606bdfeb28e61

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-macosx_11_0_arm64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kglite_cli-0.12.10-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kglite_cli-0.12.10-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 12e8c697d643b150a6989d02956639fbe160e4e2d7f614582bbd6111a1abe0a2
MD5 f6ddf8c743a405bf5c85c927d8ade4c9
BLAKE2b-256 43166347033e9735f763714755510cb687c5f41adcdeb2ad63a1875a8d6bcbf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for kglite_cli-0.12.10-py3-none-macosx_10_12_x86_64.whl:

Publisher: build_cli_wheels.yml on kkollsga/kglite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page