Skip to content

CLI Reference

The purple8-graph CLI lets you manage databases, run the REST server, and diagnose your environment without writing code.

Installation

bash
pip install purple8-graph

After installation the purple8-graph binary is on your PATH.

Global flags

FlagDescription
--db PATHPath to the graph database directory (default: ./graph_data)
--verbose / -vShow full tracebacks on error
--versionPrint the package version and exit
--help / -hShow help text

init

Initialize a new graph database at the given path.

bash
purple8-graph init ./my_graph
purple8-graph init ./my_graph --embedding-dim 768
ArgumentDescription
pathDirectory to create the database in (falls back to --db)
--embedding-dim INTEmbedding vector dimension (default: 1536)

serve

Start the REST API server.

bash
purple8-graph serve
purple8-graph serve --host 0.0.0.0 --port 8010 --reload
FlagDefaultDescription
--host TEXT0.0.0.0Interface to bind to
--port INT8100TCP port
--reloadoffEnable auto-reload (development only)

doctor

Check that all required and optional dependencies are installed and healthy.

bash
purple8-graph doctor
purple8-graph doctor --url http://localhost:8010
purple8-graph doctor --json
FlagDescription
--url URLProbe an API server's /health/live endpoint
--jsonEmit results as JSON (useful in CI)

Exit codes: 0 = all checks pass, 1 = one or more failures.

Example output:

  ✓  Python version            3.11.9
  ✓  rocksdict                 0.3.24
  ✓  hnswlib                   0.8.0
  ✓  numpy                     1.26.4
  ✓  pydantic                  2.12.5
  ✓  fastapi                   0.135.1
  ✓  uvicorn                   0.30.6
  ✓  pyjwt                     2.9.0
  ✓  cryptography              43.0.1
  ✓  [optional] openai         1.35.0
  ⚠  [optional] anthropic      not installed (optional)
  ✓  Server http://localhost:8010  HTTP 200

All checks passed (12 checks, 1 warning)

stats

Show statistics for the current graph database.

bash
purple8-graph --db ./my_graph stats

node

node add

bash
purple8-graph node add person_001 \
  --label Person \
  --property name=Alice \
  --property age=30
ArgumentDescription
node_idUnique node identifier
--label / -lLabel to apply (repeatable)
--property / -pProperty as key=value (repeatable)

node get

bash
purple8-graph node get person_001

node update

bash
purple8-graph node update person_001 --property age=31

node delete

bash
purple8-graph node delete person_001

node list

bash
purple8-graph node list --label Person --limit 25
FlagDescription
--label / -lFilter by label
--limit INTMaximum results (default: 50)

edge

edge add

bash
purple8-graph edge add knows_001 KNOWS person_001 person_002 --property since=2024

edge get

bash
purple8-graph edge get knows_001

edge delete

bash
purple8-graph edge delete knows_001

edge list

bash
purple8-graph edge list --type KNOWS --from person_001 --limit 20

traverse

Traverse the graph from a starting node.

bash
purple8-graph traverse person_001 --depth 3 --type KNOWS --direction outgoing
FlagDefaultDescription
--depth / -d2Maximum traversal depth
--type / -tallFilter by edge type
--directionoutgoingoutgoing / incoming / both
--limit50Maximum results

export

Export graph data to a file.

bash
purple8-graph export ./backup.json --format json
purple8-graph export ./backup.csv  --format csv
purple8-graph export ./graph.graphml --format graphml

import

Import graph data from a file.

bash
purple8-graph import ./backup.json --format json
purple8-graph import ./backup.json --format json --clear
FlagDescription
--format / -fjson (default), csv, graphml
--clearWipe existing data before import

clear

Delete all nodes and edges from the database.

bash
purple8-graph --db ./my_graph clear
purple8-graph --db ./my_graph clear --yes   # skip confirmation prompt

kms

kms status

bash
purple8-graph kms status
purple8-graph kms status --db ./data

Reports the active KMS provider, key ID, and how many values have been encrypted or are pending re-wrap after a rotation.

kms rotate

bash
purple8-graph kms rotate --new-key-id "arn:aws:kms:us-east-1:...:key/mrk-NEW"

Initiates zero-downtime key rotation. Both old and new KEK versions must be active in your KMS until re-wrapping completes.

Purple8 Graph is proprietary software. All rights reserved.