Skip to main content

Neo4j CLI

Project description

Neo4j CLI

Installation

curl -sSfL https://neo4j.sh/install.sh | bash

Verify with neo4j-cli --help.

Alternatives

  • Homebrew: brew install neo4j-labs/tap/neo4j-cli (stable releases only; prereleases ship via npm/PyPI).
  • npm: npm i -g @neo4j-labs/cli (also works with pnpm add -g / yarn global add). Prereleases: @alpha, @beta, @rc, @next. Platform matrix: distribution/npm/cli/README.md.
  • PyPI: pip install neo4j-cli, pipx install neo4j-cli, or uv tool install neo4j-cli. One-shot: uvx -i neo4j-cli <commands>. Pin a prerelease with ==, e.g. pipx install neo4j-cli==0.1.0a6.
  • Prebuilt archive: grab your OS/arch from releases.

Self-update

neo4j-cli update swaps the running binary with the latest GitHub release. By default only stable semver tags are considered.

neo4j-cli update                         # update to latest stable
neo4j-cli update check                   # report availability, exit 1 if newer; never downloads
neo4j-cli update --pre-releases          # opt into alpha/beta/rc tags
neo4j-cli update --version v0.1.0        # pin to a named tag (also the only way to downgrade)

If the binary was installed via Homebrew / npm / pipx / uv, update prints the channel-correct upgrade command instead of overwriting; pass --force to swap in place anyway. See neo4j-cli update --help.

Installed agent skill bundles are refreshed automatically after a successful swap; if none are installed, update suggests running neo4j-cli skill install.

Agent skills

neo4j-cli ships an embedded skill bundle (SKILL.md + per-subcommand references) that teaches AI coding agents how to drive the CLI. skill install drops it into each detected agent's skill directory; pass an agent name to target one.

Supported agents: Claude Code, Cursor, Windsurf, Copilot, Gemini CLI, Cline, Codex, Pi, OpenCode, Junie.

neo4j-cli skill install                  # all detected agents
neo4j-cli skill install claude-code      # one agent
neo4j-cli skill list                     # per-agent install state
neo4j-cli skill check                    # version drift vs running binary
neo4j-cli skill remove [agent]           # idempotent

Credentials

neo4j-cli stores three kinds of credentials in credentials.json under your OS config directory. All three trees share the same add / list / use / remove shape; use sets the default consumed by downstream commands.

credential aura-client — Aura Console API credentials (client ID + secret). Required for any aura ... subcommand that calls the Console API.

neo4j-cli credential aura-client add --name "my-org" --client-id <id> --client-secret <secret>
neo4j-cli credential aura-client list
neo4j-cli credential aura-client use my-org
neo4j-cli credential aura-client remove my-org

credential dbms — Neo4j Bolt connection profiles (URI, username, password, database, optional embed-credential link). When a default profile exists, neo4j-cli query connects without any connection flags or env vars.

neo4j-cli credential dbms add --name prod --uri neo4j+s://example.databases.neo4j.io --username neo4j --password '<pw>'
neo4j-cli credential dbms list
neo4j-cli credential dbms use prod
neo4j-cli credential dbms set-embed prod openai-shared    # link an embed credential
neo4j-cli credential dbms set-embed prod                  # clear the link
neo4j-cli credential dbms remove prod

credential embed — Embedding-provider credentials (provider, model, base URL, dimensions, optional API key). Consumed by query --param NAME:embed=... and query :embed. Supported providers: openai, ollama, huggingface.

neo4j-cli credential embed add --name openai-shared --provider openai --model text-embedding-3-small --api-key '<key>'
neo4j-cli credential embed list                           # api-key is never printed
neo4j-cli credential embed use openai-shared
neo4j-cli credential embed remove openai-shared

Aura

Manage Neo4j Aura instances from the terminal. Requires an aura-client credential — create one in your Aura Account Settings and add it via Credentials above.

List your instances

neo4j-cli aura instance list --format table

Create an instance

# Free-db — no cloud provider, region, or memory required
neo4j-cli aura instance create --name my-free-db --type free-db --tenant-id <tenant-id> --rw

# Professional-db on AWS, awaiting readiness
neo4j-cli aura instance create --name my-pro-db --type professional-db --cloud-provider aws \
  --region us-east-1 --memory 4GB --tenant-id <tenant-id> --await --rw

aura tenant list shows tenant IDs. Initial DB credentials returned by instance create are auto-stored as a dbms credential (named <instance-id>-default), so neo4j-cli query can connect immediately. Use --no-credential-storage to skip that.

Querying Neo4j

neo4j-cli query runs Cypher against any Neo4j database via the Bolt protocol. Cypher comes from the positional argument or piped stdin.

neo4j-cli query 'RETURN 1 AS n'
echo 'MATCH (n) RETURN count(n)' | neo4j-cli query

Preferred: add a dbms credential (see Credentials) and query connects with no further config. aura instance create auto-stores one for new instances.

Flags, env vars, and .env files are optional overrides — useful for one-offs or CI without persisting a credential. When a stored credential exists, an override must supply all four of URI/username/password/database (any partial set is rejected). Without a stored credential, resolution is flag → env var → .env file (auto-discovered walking up from cwd) → built-in default.

.env discovery walks up from cwd and stops at the first .git ancestor or your $HOME boundary (whichever comes first), so a .env outside your repo or above your home directory is never loaded. When the loaded .env lives strictly above cwd, an info: loading .env from <path> line is printed to stderr so the overlay is never silent.

Setting Flag Env var Default
URI --uri NEO4J_URI neo4j://localhost:7687
Username --username NEO4J_USERNAME neo4j
Password --password NEO4J_PASSWORD prompted on TTY
Database --database NEO4J_DATABASE neo4j

http:// and https:// URIs are auto-rewritten to neo4j://<host>:7687 and neo4j+s://<host>:7687 respectively (path/query stripped). For self-signed certs use neo4j+ssc://.

Pass parameters with --param key=value (repeatable). Values that parse as JSON are typed; everything else is a string:

neo4j-cli query 'MATCH (p:Person {name:$name}) RETURN p' --param name=Alice
neo4j-cli query 'RETURN $ids' --param 'ids=[1,2,3]'
echo 'MATCH (p:Person {name:$name}) RETURN p' | neo4j-cli query --param name=Alice

Output is a table by default; pass --format json for a stable envelope (columns, rows, truncated, arrays_truncated). When stdout is not a terminal (piped or redirected), --format defaults to json. Applies to both query and :schema. Large results are capped at 100 rows and arrays inside cells at 100 items — tune with --max-rows / --truncate-arrays-over (0 = unlimited).

Schema introspection:

neo4j-cli query :schema

Embedding parameters

Bind a vector parameter inline by passing --param NAME:embed=<text> — the text is sent to the configured embedding provider and the resulting []float32 is bound to $NAME for both the EXPLAIN preflight and the real run. The sibling query :embed [text] leaf computes a vector standalone without opening a Bolt connection.

neo4j-cli query --param q:embed='sci-fi movies' --param k=5 \
  "CALL db.index.vector.queryNodes('idx', \$k, \$q) YIELD node, score RETURN node, score"

neo4j-cli query :embed "hello world" --format json
echo "hello world" | neo4j-cli query :embed --format toon

Embedding settings resolve with this precedence (highest first): flag → env var → .env file → stored embed credential → provider built-in default.

Setting Flag Env var
Credential --embed-credential
Provider --embed-provider NEO4J_EMBED_PROVIDER
Model --embed-model NEO4J_EMBED_MODEL
Base URL --embed-base-url NEO4J_EMBED_BASE_URL
Dimensions --embed-dimensions NEO4J_EMBED_DIMENSIONS
API key (none — see below) NEO4J_EMBED_API_KEY, OPENAI_API_KEY, HF_TOKEN

API-key precedence (highest first): per-provider OS env (OPENAI_API_KEY / HF_TOKEN) → generic OS env (NEO4J_EMBED_API_KEY) → per-provider .env value → generic .env value → stored credential api-key. Ollama needs no API key.

--embed-credential <name> selects a stored embed credential explicitly; without it the resolver falls back to the embed credential linked from the resolved dbms credential (via credential dbms add --embed-credential or credential dbms set-embed), then to credential embed's default. So one --credential <name> can drive both DB connection and embedding when the dbms credential carries an embed link.

Provider defaults: OpenAI base URL https://api.openai.com/v1, Ollama http://localhost:11434, HuggingFace https://router.huggingface.co/hf-inference/models (serverless mode). Setting --embed-base-url switches HuggingFace to dedicated-endpoint mode.

Write operations

Write commands require --rw. neo4j-cli query runs EXPLAIN first when --rw is absent and blocks mutating Cypher before execution.

neo4j-cli aura instance delete <id> --rw
neo4j-cli config set telemetry false --rw
neo4j-cli query 'CREATE (:Person {name:"Alice"})' --rw

Feedback / Issues

Please use GitHub issues to provide feedback and report any issues that you have encountered.

Building locally

Clone the repository and run:

make build

This produces bin/neo4j-cli. To run without building:

make run-neo4j

Developing and contributing

Read CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

neo4j_cli-0.1.0a13-py3-none-win_arm64.whl (14.0 MB view details)

Uploaded Python 3Windows ARM64

neo4j_cli-0.1.0a13-py3-none-win_amd64.whl (15.2 MB view details)

Uploaded Python 3Windows x86-64

neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_x86_64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_aarch64.whl (13.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

neo4j_cli-0.1.0a13-py3-none-macosx_11_0_arm64.whl (14.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

neo4j_cli-0.1.0a13-py3-none-macosx_10_9_x86_64.whl (15.2 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-win_arm64.whl.

File metadata

  • Download URL: neo4j_cli-0.1.0a13-py3-none-win_arm64.whl
  • Upload date:
  • Size: 14.0 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 a47095968263b15f2a5f256821ab9eef2ab11e8e910c1a52ecbd6eff0330c3c5
MD5 374f65294307e31b96e9477d5d6f9ba2
BLAKE2b-256 1064acb344ddeccd70da5d33dfc4769bbb0537723dac685ffa5cf6e0fb6452a9

See more details on using hashes here.

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-win_amd64.whl.

File metadata

  • Download URL: neo4j_cli-0.1.0a13-py3-none-win_amd64.whl
  • Upload date:
  • Size: 15.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dce5150a0d3221544cf698d0603f21c88da8cf73f0c03a4f50a15f4878044a6e
MD5 190df6171600994b490cdca571161591
BLAKE2b-256 891b8a3196ba6cdb5faa6a0dcae5b3f4c8e118e5187e9cef5e87079d15b6d919

See more details on using hashes here.

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0ae08ecb23f43f0134cf1b0697ca78f3573c4c563ce65981f9171ad1860d7163
MD5 36a9343e3e4b3351f4c42425a0f72f63
BLAKE2b-256 d373cad4535d119c45fad291a7b2862e67ba09144a84651d34354db6c55b4249

See more details on using hashes here.

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 4357faa2b35451180e7acf29a8f97ae288178b09ed142b48d0a770cc6974b40d
MD5 6a4b151b0e197c150f750d315f93337e
BLAKE2b-256 93c5b3bfa6ae178447f02cb954252771412e0f7a42b265cbecc6e530991065f2

See more details on using hashes here.

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ceb6b1056900b15e04df79df1bab2dea8f598bd54c4e0e654ee1963614811c57
MD5 4f4ddc70b8a33e03910b98c793638e33
BLAKE2b-256 930454c47462d5fdf1a04bb8b3847f982606298a8324ff6a720342bdd3f40ea2

See more details on using hashes here.

File details

Details for the file neo4j_cli-0.1.0a13-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo4j_cli-0.1.0a13-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 603227fd799e1a05e5e1f7ae289035a7905cd615500dab9e91eec7275cd3508e
MD5 7a22f97704d97c4a31ffd615b6db86ae
BLAKE2b-256 3bb5015a79fe0758ec4c4a0ffc6113246a83544c3e906f5294afdc32c9302aa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page