Skip to main content

Neug CLI Tool

The Neug CLI tool provides an interactive shell for querying and managing NeuG database. It supports both local and remote database connections, Cypher query execution, and result formatting.

Installation

You can install neug-cli using pip:

pip install neug-cli

Alternatively, to install from source:

git clone https://github.com/GraphScope/neug.git
cd neug/tools/shell
pip install .

After installation, you can verify that neug-cli is installed correctly by running:

neug-cli --version

This should display:

neug-cli, version 0.1.0

Usage

Overview

The neug-cli tool allows you to interact with the Neug database in both local and remote modes. To view the basic usage, run:

neug-cli --help

This displays:

Usage: neug-cli [OPTIONS] COMMAND [ARGS]...

    Neug CLI Tool.

Options:
    --version  Show the version and exit.
    --help     Show this message and exit.

Commands:
    connect  Connect to a remote database.
    open     Open a local database.

Start the Shell by Opening a Local Database

To open a local Neug database, specify the database path when starting the CLI. By default, the database is opened in read-write mode, and changes are persisted to disk when the shell exits. If the specified directory does not exist, it will be created automatically.

To open the database in read-only mode, use the --readonly or -r option.

neug-cli open <path-to-db> [--readonly | -r]
  • --readonly, -r: Open the database in read-only mode.

Start the Shell by Connecting to a Remote Database

To connect to a remote Neug server, specify the server URI when starting the CLI. You can optionally provide a username, password, and query timeout. Note that remote connection support is under development.

neug-cli connect <host:port> [--user <username> | -u <username>] [--password <password> | -p <password>] [--timeout <seconds>]
  • --user, -u: Username for authentication.
  • --password, -p: Password for authentication.
  • --timeout: Connection timeout in seconds (default: 300).

Interactive Shell Commands

Once you start the shell, you can execute Cypher queries and use various interactive commands:

  • Enter Cypher queries directly to execute them.
  • Use :help to display this help message.
  • Use :quit or press Ctrl+C to leave the shell.
  • Use :max_rows <number> to set the maximum number of rows to display for query results.
  • Multi-line commands are supported. Use ';' at the end to execute.
  • Command history is supported; use the up/down arrow keys to navigate previous commands.

Example

neug-cli open /tmp/modern_graph

This will open embedded Neug database at /tmp/modern_graph in rw mode by default, and start the shell. Then you can execute Cypher queries directly:

Welcome to the Neug shell. Type :help for usage hints.

neug > MATCH (n:person) RETURN n;
+-------------------------------------------------------+
| n                                                     |
+=======================================================+
| {_ID: 0, _LABEL: person, id: 1, name: marko, age: 29} |
+-------------------------------------------------------+
| {_ID: 1, _LABEL: person, id: 2, name: vadas, age: 27} |
+-------------------------------------------------------+
| {_ID: 2, _LABEL: person, id: 4, name: josh, age: 32}  |
+-------------------------------------------------------+
| {_ID: 3, _LABEL: person, id: 6, name: peter, age: 35} |
+-------------------------------------------------------+

Metadata

Release files for neug-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neug-cli 0.1.1
File Size Uploaded Provenance
neug_cli-0.1.1.tar.gz 7.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for neug-cli 0.1.1
File Interpreter ABI Platform
neug_cli-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.7 kB

Release files / neug_cli-0.1.1.tar.gz

Download URL neug_cli-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0c432a9e0237dabba648a23dc18dc52077b664b320b6456e9e3777ce703dc5b1
BLAKE2b-256 checksum
How to use checksums
42ba261d859c621ba9d817dac90fe66ce36e6b2f71262884e491acb76bf17ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / neug_cli-0.1.1-py2.py3-none-any.whl

Download URL neug_cli-0.1.1-py2.py3-none-any.whl
Size 6.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
eb3ea07a465c4f5d264df1ad6ebb7e102e15aa474589b285ace031f3dd469e5d
BLAKE2b-256 checksum
How to use checksums
91f95e7417d9d635871ab6d431fa9a4e24029be81963888be7c83eccbfc4eded
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Security for neug-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page