CLI
The Traverse CLI (traverse-cli) is an interactive REPL for querying and managing Traverse databases.
Modes of Operation
| Mode | Usage |
|---|---|
| Interactive REPL | traverse-cli |
| Single query | traverse-cli "MATCH (n) RETURN n LIMIT 5" |
| Script execution | traverse-cli -s queries.cypher |
| Piped stdin | echo "MATCH (n) RETURN count(n)" | traverse-cli |
| Embedded (direct file) | traverse-cli -f database.tvdb |
CLI Options
| Flag | Short | Description | Default |
|---|---|---|---|
--bolt <URI> | -b | Bolt connection URI | bolt://localhost:7690 |
--file <PATH> | -f | Open a .tvdb file directly (embedded mode, no server needed) | — |
--script <FILE> | -s | Run a .cypher script file | — |
--user <NAME> | -u | Username for authentication | — |
--password <PASS> | -p | Password for authentication | — |
--format <FMT> | — | Output format: table, json, csv | table |
--database <NAME> | -d | Select database (Bolt mode) | — |
--no-highlight | — | Disable syntax highlighting | — |
--tls-insecure | — | Skip TLS certificate verification | — |
Connection URI Formats
bolt://localhost:7690— unencryptedbolt+s://localhost:7690— TLS encryptedlocalhost:7690— shorthand (defaults to unencrypted)
Meta-Commands
Meta-commands start with : and are processed locally (not sent to the server):
| Command | Description |
|---|---|
:help, :h | Show help |
:quit, :exit, :q | Exit the REPL |
:format <table|json|csv> | Set output format (shows current if no argument) |
:param key => value | Set a query parameter |
:params | List all parameters |
:params clear | Clear all parameters |
:source <file> | Execute a .cypher script |
:use <database> | Switch database (validates existence first) |
:clear | Clear the screen |
:update | Check for updates |
:update download | Download latest version |
Output Formats
Table (default)
traverse> MATCH (n:Person) RETURN n.name, n.age LIMIT 3;
+-------+-----+
| n.name| n.age|
+-------+-----+
| Alice | 30 |
| Bob | 25 |
| Carol | 28 |
+-------+-----+
3 rows, 0.4 ms
JSON
One JSON object per line (JSONL format):
traverse> :format json
traverse> MATCH (n:Person) RETURN n.name LIMIT 2;
{"n.name": "Alice"}
{"n.name": "Bob"}
CSV
traverse> :format csv
traverse> MATCH (n:Person) RETURN n.name, n.age LIMIT 2;
n.name,n.age
Alice,30
Bob,25
Query Parameters
Set parameters with :param using supported value types:
traverse> :param name => 'Alice'
traverse> :param age => 30
traverse> :param active => true
traverse> :param score => 3.14
traverse> MATCH (n:Person {name: $name}) RETURN n;
Value types: integers (42), floats (3.14), strings ('text' or "text"), booleans (true/false), null.
Transactions
In Bolt mode, use explicit transactions:
traverse> BEGIN;
traverse> CREATE (n:Person {name: "Dave"});
traverse> MATCH (n:Person) RETURN count(n);
traverse> COMMIT;
Use ROLLBACK; to discard changes.
Note: Embedded mode (--file) does not support explicit transactions. Each statement auto-commits.
Database Management
traverse> SHOW DATABASES;
traverse> CREATE DATABASE analytics;
traverse> :use analytics
traverse> DROP DATABASE analytics;
User Management
traverse> CREATE USER alice SET PASSWORD 'hunter2' SET ROLE EDITOR;
traverse> SHOW USERS;
traverse> ALTER USER alice SET ROLE ADMIN;
traverse> DROP USER alice;
LOAD CSV
traverse> LOAD CSV WITH HEADERS FROM 'file:///path/to/data.csv' AS row
CREATE (n:Person {name: row.name, age: toInteger(row.age)});
Embedded Mode
Open a .tvdb file directly without running the server:
traverse-cli --file ./data/mydb.tvdb
This loads the database in-process. A valid license key is required for embedded mode. The CLI will prompt for interactive activation if the trial has expired.
Features
- Syntax highlighting — keywords, strings, and numbers are color-coded (disable with
--no-highlight) - Tab completion — Cypher keywords, labels, relationship types, and property keys
- History — persisted across sessions in
~/.traverse_history - Execution timing — microsecond or millisecond precision after each query
- Query stats — nodes/edges created/deleted, properties set, labels added/removed, indexes added/removed
- Connection banner — displays server version, database name, node/edge counts on connect
- Syntax errors — displayed with a caret pointer showing the error position