Neo4j CLI tool

The Neo4j CLI tool is a tool for managing a Neo4j database server. It is a command-line tool that is installed as part of the product and can be executed with a number of commands. Neo4j CLI tool is located in the bin directory.

Syntax and commands

General synopsis

The neo4j tool has the following general synopsis:

neo4j <command>

Available commands

Command Description

console

Start server in console.

start

Start server as a daemon.

stop

Stop the server daemon.

restart

Restart the server daemon.

status

Get the status of the server.

version, --version

Print version information and exit.

help, --help

Display help information about the specified command.

For example, running ./bin/neo4j --help start outputs the usage, description, and all available options of the start command:

Usage: Neo4j start [--expand-commands] [--verbose]
Start server as a daemon.
      --expand-commands   Allow command expansion in config value evaluation.
      --verbose           Prints additional information.

Command expansion can be enabled by adding a customised script to the neo4j.conf file, and then including the --expand-commands argument to the Neo4j startup script.

For more information, see Command expansion.

Environment variables

Neo4j CLI tool can also use the following environment variables:

Environment variable Description

NEO4J_DEBUG

Set to anything to enable debug output.

NEO4J_HOME

Neo4j home directory.

NEO4J_CONF

Path to the directory that contains neo4j.conf.

HEAP_SIZE

Set JVM maximum heap size during command execution. Takes a number and a unit, for example, 512m.

JAVA_OPTS

Additional JVM arguments. Refer to JVM documentation about the exact format. This variable is incompatible with HEAP_SIZE and takes precedence over HEAP_SIZE.

By default, dbms.jvm.additional settings specified in the configuration file are used when invoking neo4j CLI commands. If set, JAVA_OPTS overrides all relevant settings specified in the configuration file.