gqldb-cli is the official command-line client for connecting to a GQLDB server. It runs on Linux, macOS, and Windows. It supports three execution modes:
-e and exits..gql file with -f and exits.Download Ultipa CLI from here. No installation is required.
Start a session against a local database server:
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName>
The command launches an interactive shell where you can type GQL statements one at a time and see results immediately. Exit with \q, exit, or Ctrl+D.
To change the result format in the interactive shell, pass --format at launch — it applies to every statement run during the session. There is no in-shell command to switch formats mid-session; exit and relaunch to use a different format.
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName> --format json
You can pass -o to write all result outputs to a file, so you won't see results in the terminal as you type:
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName> -o session.log
--format and -o can be combined, so every statement's result is written to the file in the chosen format:
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName> --format json -o session.json
With -e, the CLI does not enter the interactive shell — it connects, runs the single statement, prints the result, and exits:
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName> --format json \ -e "MATCH (n) RETURN n LIMIT 5"
With -f, the CLI does not enter the interactive shell either — it connects, runs every statement in a file in order, prints the results, and exits:
Bashgqldb-cli -h localhost:60061 -u <username> -p <password> -g <graphName> --format json \ --format csv -o results.csv \ -f inspect_users.gql
Example inspect_users.gql file:
inspect_users.gqlMATCH (u:User) RETURN count(u) AS totalUsers; MATCH (u:User) RETURN u.id, u.name, u.email ORDER BY u.name LIMIT 20; MATCH (u:User) WHERE u.email IS NULL RETURN u.id, u.name;
Statements are separated by ;. Results from all three queries are appended to results.csv in order.
Connect to a multi-node cluster over TLS:
Bashgqldb-cli --ssl --ca ca.pem --cert client.pem --key client.key \ -h node1:60061,node2:60061,node3:60061 \ -u root -p
| Flag | Description |
|---|---|
-h, --host | Server host:port, comma-separated for multiple endpoints. Default: localhost:60061. |
-u, --username | Username for authentication. |
-p, --password | Password for authentication. |
-g, --graph | Default graph name. Default: default. |
--timeout | Query timeout in seconds. Default: 30. |
| Flag | Description |
|---|---|
--ssl | Enable TLS connection. |
--cert | Path of client certificate file (PEM). |
--key | Path of client private key file (PEM). |
--ca | Path of CA certificate file (PEM). |
| Flag | Description |
|---|---|
-e, --execute STRING | Execute a single statement and exit. |
-f, --file FILE | Execute statements from a file and exit. |
| Flag | Description |
|---|---|
--format | Output format: table (default), json, csv, or tsv. |
-o, --output | Write output to a file instead of stdout. |
| Flag | Description |
|---|---|
-V, --version | Show version and exit. |
--verbose | Print connection diagnostics (target host, graph, TLS state, authenticated user) before the result. |