CLI

The Traverse CLI (traverse-cli) is an interactive REPL for querying and managing Traverse databases.

Modes of Operation

ModeUsage
Interactive REPLtraverse-cli
Single querytraverse-cli "MATCH (n) RETURN n LIMIT 5"
Script executiontraverse-cli -s queries.cypher
Piped stdinecho "MATCH (n) RETURN count(n)" | traverse-cli
Embedded (direct file)traverse-cli -f database.tvdb

CLI Options

FlagShortDescriptionDefault
--bolt <URI>-bBolt connection URIbolt://localhost:7690
--file <PATH>-fOpen a .tvdb file directly (embedded mode, no server needed)
--script <FILE>-sRun a .cypher script file
--user <NAME>-uUsername for authentication
--password <PASS>-pPassword for authentication
--format <FMT>Output format: table, json, csvtable
--database <NAME>-dSelect database (Bolt mode)
--no-highlightDisable syntax highlighting
--tls-insecureSkip TLS certificate verification

Connection URI Formats

  • bolt://localhost:7690 — unencrypted
  • bolt+s://localhost:7690 — TLS encrypted
  • localhost:7690 — shorthand (defaults to unencrypted)

Meta-Commands

Meta-commands start with : and are processed locally (not sent to the server):

CommandDescription
:help, :hShow help
:quit, :exit, :qExit the REPL
:format <table|json|csv>Set output format (shows current if no argument)
:param key => valueSet a query parameter
:paramsList all parameters
:params clearClear all parameters
:source <file>Execute a .cypher script
:use <database>Switch database (validates existence first)
:clearClear the screen
:updateCheck for updates
:update downloadDownload 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