The graph database,
in your terminal.
A super CLI for Neo4j. Manage Aura instances, run Cypher against any database, and teach your AI agents to drive it all — without ever leaving the prompt.
From zero to graph in 60 seconds.
New to Neo4j? AuraDB has a free tier — no credit card.
Install the CLI
Pick your platform from the install tabs above, or use the one-liner for your OS.
Install skills
Teach your agents the CLI API — or install the full agent-skills catalog covering Cypher, GDS, GraphRAG and more. ↓
Get a database
Grab a client ID + secret from your Aura account and register them. Free tier, no credit card. ↓
Provision a new Aura instance.
Spin up a managed local Neo4j container. Docker must be installed. ↓
Create a DBMS inside a running Neo4j Desktop 2 install. ↓
Insert data
Pass typed params inline with --param, or pipe a Cypher file. ↓
Query your database
Run Cypher against any Neo4j. Pretty table by default; JSON when piped. ↓
Built for the prompt.
Manage Aura, query any Neo4j over the Bolt protocol, introspect the schema, pipe Cypher in, JSON out — and let your agents play too.
> Set up my Aura environment — add credentials, create a free movies instance, then list all→ loading skill neo4j-cli # add your Aura API credentials (one-time) $ neo4j-cli credential aura-client add --name "prod" --rw \ --client-id <client-id> --client-secret <secret> ✓ credential "prod" saved · set as default # set the active workspace (org + project) once $ neo4j-cli aura workspace use <org-id>/<project-id> --rw ✓ workspace set · all aura commands now scope to this project # create a free instance (scoped by the workspace default) $ neo4j-cli aura instance create --name "movies-dev" --rw \ --type free ▸ instance creating… (may take ~60s) ✓ movies-dev (f1ab2c34) · free · us-east-1 · running # list instances $ neo4j-cli aura instance list --format table ┌──────────┬───────────────┬────────┬───────────┬─────────┐ │ id │ name │ tier │ region │ status │ ├──────────┼───────────────┼────────┼───────────┼─────────┤ │ f1ab2c34 │ movies-dev │ free │ us-east-1 │ running │ │ 9d8e7f6a │ staging │ pro │ eu-west-1 │ running │ └──────────┴───────────────┴────────┴───────────┴─────────┘
> Spin up a local Neo4j container named "dev", run a query against it, then list all managed containers→ loading skill neo4j-cli # create a container — stores a dbms credential automatically $ neo4j-cli docker create --name dev --wait --rw ✓ dev · enterprise · eval license · localhost:7687 · running credential "dev" saved # query via the stored credential — no connection flags needed $ neo4j-cli query --credential dev 'MATCH (n) RETURN count(n) AS n' ┌───┐ │ n │ ├───┤ │ 0 │ └───┘ # list / inspect managed containers $ neo4j-cli docker list --format table ┌───────┬─────────┬──────────┬────────────────────────┐ │ name │ status │ version │ bolt │ ├───────┼─────────┼──────────┼────────────────────────┤ │ dev │ running │ 5.28.0 │ neo4j://localhost:7687 │ └───────┴─────────┴──────────┴────────────────────────┘ # stop / start / delete $ neo4j-cli docker stop dev --rw $ neo4j-cli docker start dev --wait --rw $ neo4j-cli docker delete dev --yes --force --rw # removes container + stored credential # ephemeral: throwaway container, no credential stored $ neo4j-cli docker create --name tmp --ephemeral --env-out-file /tmp/n.env --wait --rw $ neo4j-cli query --env /tmp/n.env 'RETURN 1 AS ok' $ neo4j-cli docker stop tmp --rw # container auto-removed by Docker Container "dev" is running at localhost:7687, dbms credential stored. Listed 1 managed container.
> Set up Neo4j Desktop 2, spin up a local DBMS called dev, run a query against it, then list everything Desktop manages→ loading skill neo4j-cli # install the Desktop 2 app (no-op if already present) $ neo4j-cli desktop install --rw ✓ Neo4j Desktop 2 installed · /Applications/Neo4j Desktop.app # create + start a DBMS (Desktop must be running). --wait blocks until status=started $ neo4j-cli desktop dbms create --name dev --wait --rw ▸ picked version 2026.04.0 (latest stable enterprise) ✓ dev (a1b2c3d4) · enterprise · neo4j://localhost:7687 · started # query the running DBMS — Desktop owns the credential, no flags needed $ neo4j-cli query --credential desktop 'MATCH (n) RETURN count(n) AS n' ┌───┐ │ n │ ├───┤ │ 0 │ └───┘ # composed view: local DBMSes + saved remote connections $ neo4j-cli desktop list --format table ▸ Local DBMSes ┌──────────┬──────┬────────────┬─────────┬────────────────────────┐ │ id │ name │ version │ status │ connection_uri │ ├──────────┼──────┼────────────┼─────────┼────────────────────────┤ │ a1b2c3d4 │ dev │ 2026.04.0 │ started │ neo4j://localhost:7687 │ └──────────┴──────┴────────────┴─────────┴────────────────────────┘ ▸ Remote connections ┌──────────┬───────────┬──────────────────────────────────────────┐ │ id │ name │ connection_uri │ ├──────────┼───────────┼──────────────────────────────────────────┤ │ 9f8e7d6c │ aura-prod │ neo4j+s://abc123.databases.neo4j.io │ └──────────┴───────────┴──────────────────────────────────────────┘ # stop / start / delete $ neo4j-cli desktop dbms stop dev --rw $ neo4j-cli desktop dbms start dev --wait --rw $ neo4j-cli desktop dbms delete dev --rw Desktop 2 installed, DBMS "dev" running at localhost:7687, listed 1 local DBMS and 1 saved remote connection.
> Top 3 directors by movie count — show how many films they directed and the year of their most recent one.→ loading skill neo4j-cli # check structure first $ neo4j-cli query :schema # find top directors $ neo4j-cli query \ 'MATCH (d:Person)-[:DIRECTED]->(m:Movie) RETURN d.name AS director, count(m) AS movies, max(m.released) AS year ORDER BY movies DESC LIMIT 3' ┌───────────────────┬────────┬──────┐ │ director │ movies │ year │ ├───────────────────┼────────┼──────┤ │ "Lilly Wachowski" │ 5 │ 2012 │ │ "Lana Wachowski" │ 5 │ 2012 │ │ "Rob Reiner" │ 3 │ 1998 │ └───────────────────┴────────┴──────┘ # typed params, writes (--rw), and env-based connection all supported $ neo4j-cli query 'RETURN $ids' --param 'ids=[1,2,3]' $ neo4j-cli query 'CREATE (:Person {name:$n})' --rw --param n=Alice
> What's in my database? Show all labels, relationships, and indexes.→ loading skill neo4j-cli $ neo4j-cli query :schema ▸ node labels :Movie :Person :Genre ▸ relationship types ACTED_IN DIRECTED IN_GENRE ▸ indexes ● Movie(title) RANGE ONLINE ● Person(name) RANGE ONLINE ● Movie(plot) FULLTEXT ONLINE
> Seed the database from seeds/people.cypher, then show me the 3 youngest people as JSON→ loading skill neo4j-cli # pipe a cypher file (--rw for writes) $ neo4j-cli query --rw < seeds/people.cypher ✓ 247 rows affected · 84ms # pipe result to jq to filter and reshape $ neo4j-cli query \ 'MATCH (p:Person) RETURN p.name AS name, p.born AS born ORDER BY p.born DESC LIMIT 3' \ --format json | jq '.rows[] | {name, born}' {"name": "Carol", "born": 1992} {"name": "Alice", "born": 1990} {"name": "Bob", "born": 1985} # inline params instead of a file $ neo4j-cli query --rw \ 'UNWIND $p AS r CREATE (:Person {name:r.name,born:r.born})' \ --param 'p=[{"name":"Alice","born":1990},{"name":"Bob","born":1985}]' # connection via .env (auto-discovered) or env vars (opt-in: accept-env-vars) $ NEO4J_CLI_ACCEPT_ENV_VARS=1 NEO4J_URI=neo4j+s://f1ab…b2.databases.neo4j.io \ NEO4J_USERNAME=neo4j NEO4J_PASSWORD=$AURA_PW \ neo4j-cli query 'MATCH (n) RETURN count(n)'
> Install the neo4j skill for all my agents, then verify it's up to date everywhere→ loading skill neo4j-cli # self-skill only (CLI commands, Aura, query, :schema) $ neo4j-cli skill install --rw ▸ detecting installed agents… ✓ claude-code installed (v1.3.0) ✓ cursor installed (v1.3.0) ✓ windsurf installed (v1.3.0) ✓ copilot installed (v1.3.0) ✓ antigravity installed (v1.3.0) ○ gemini-cli not detected — skipped ○ cline not detected — skipped ✓ codex installed (v1.3.0) ○ pi not detected — skipped ✓ opencode installed (v1.3.0) ○ junie not detected — skipped ✓ kiro installed (v1.3.0) # full catalog — Cypher, GDS, GraphRAG, modeling, drivers, import, … $ neo4j-cli skill install --all --rw ▸ fetching catalog from neo4j/agent-skills… ✓ neo4j-cli installed (v1.3.0) ✓ neo4j-cypher-skill installed (v1.1.0) ✓ neo4j-gds-skill installed (v1.0.2) ✓ neo4j-graphrag-skill installed (v1.0.1) ✓ neo4j-modeling-skill installed (v1.0.0) … and 12 more # or install one catalog skill by name $ neo4j-cli skill install neo4j-cypher-skill --rw # check for version drift and update stragglers $ neo4j-cli skill check ! windsurf v1.2.0 outdated — run: neo4j-cli skill install --agent windsurf --rw $ neo4j-cli skill install --agent windsurf --rw All detected agents updated. Agents now have access to the full agent-skills catalog.
> Find the 5 movies most similar to "sci-fi movies" using vector search on the plot index→ loading skill neo4j-cli # add embedding credential (one-time) $ neo4j-cli credential embed add --name openai-shared --rw \ --provider openai --model text-embedding-3-small --api-key '<key>' ✓ credential "openai-shared" saved · set as default # link it to your dbms connection profile $ neo4j-cli credential dbms set-embed prod openai-shared ✓ prod → openai-shared linked # vector search — embed text inline, bind as $q $ neo4j-cli query \ "CALL db.index.vector.queryNodes('plot_idx', \$k, \$q) YIELD node, score RETURN node.title, score" \ --param 'q:embed=sci-fi movies' --param k=5 ┌──────────────────┬────────┐ │ title │ score │ ├──────────────────┼────────┤ │ "The Matrix" │ 0.94 │ │ "Inception" │ 0.91 │ │ "Interstellar" │ 0.89 │ │ "Ex Machina" │ 0.87 │ │ "Arrival" │ 0.85 │ └──────────────────┴────────┘ # standalone vector — no DB connection needed $ neo4j-cli query :embed "hello world" --format json {"dimensions":1536,"provider":"openai","model":"text-embedding-3-small","vector":[0.021,-0.013,0.007,...]} Added embed credential, linked to dbms profile, and returned top 5 semantically similar movies.
> Create an analyst user, give it a read-only role on the movies graph, then show me who has what→ loading skill neo4j-cli # create a user — password prompted on a TTY, or pass --set-password $ neo4j-cli admin user create alice --credential local --rw ✓ user "alice" created · password change required on first login # create a role and grant it to the user $ neo4j-cli admin role create analyst --credential local --rw $ neo4j-cli admin role grant --role analyst --user alice --credential local --rw ✓ alice · roles: PUBLIC, analyst # grant a read privilege on every graph to that role $ neo4j-cli admin privilege grant property read --on-graph '*' \ --role analyst --credential local --rw ✓ GRANT READ {*} ON GRAPH * TO analyst # who has what $ neo4j-cli admin user list --credential local --format table ┌───────┬──────────────────┬──────────────────────────┬───────────┐ │ user │ roles │ password_change_required │ suspended │ ├───────┼──────────────────┼──────────────────────────┼───────────┤ │ neo4j │ PUBLIC, admin │ false │ false │ │ alice │ PUBLIC, analyst │ true │ false │ └───────┴──────────────────┴──────────────────────────┴───────────┘ # databases live on the same tree $ neo4j-cli admin database list --credential local --format table $ neo4j-cli admin database create movies --credential local --wait --rw User "alice" created with the analyst role and READ on every graph.
The complete reference.
Install with curl (macOS / Linux) or PowerShell (Windows):
$ curl -sSfL https://neo4j.sh/install.sh | bash # PowerShell: irm https://neo4j.sh/install.ps1 | iex # Homebrew: brew install neo4j-labs/tap/neo4j-cli # npm: npm install -g @neo4j-labs/cli # PyPI/pipx: pipx install neo4j-cli
Version & help:
$ neo4j-cli --version # print installed version and exit $ neo4j-cli --help # top-level help $ neo4j-cli <command> --help # per-command help
Self-update:
$ neo4j-cli update # latest stable (alias: upgrade) $ neo4j-cli update check # report availability, exit 1 if newer version exists $ neo4j-cli update --version v1.0.0 # pin or downgrade to a specific version $ neo4j-cli update --pre-releases # opt into alpha/beta/rc tags
Installed skill bundles are refreshed automatically in the background whenever the binary version changes, in an interactive terminal only (never under an agent or script). Opt out with neo4j-cli config set skill-auto-refresh false --rw.
Prefix any installer with NEO4J_CLI_AUTO_INSTALL_SKILL=1 to auto-run skill install --rw after the binary is placed — supported on curl, PowerShell, Homebrew, and npm. Strictly opt-in.
Three credential types share add / list / use / remove. New installs store secrets in the OS keyring by default (macOS Keychain, Windows Credential Store, Linux Secret Service). Switch storage with neo4j-cli config set credential-storage keyring|insecure --rw; insecure writes plaintext credentials.json under your OS config directory.
aura-client — Aura Console API (client ID + secret). Required for any aura … command.
$ neo4j-cli credential aura-client add --name prod --client-id <id> --client-secret <secret> --rw $ neo4j-cli credential aura-client use prod
dbms — Neo4j Bolt connection profiles (URI, username, password, database). When a default exists, query connects without flags.
$ neo4j-cli credential dbms add --name prod --uri neo4j+s://… --username neo4j --password <pw> --rw $ neo4j-cli credential dbms set-embed prod openai-shared # link an embed credential $ neo4j-cli credential dbms use prod
embed — Embedding providers (openai / ollama / huggingface / gemini / vertex). Consumed by --param NAME:embed=… and query :embed.
$ neo4j-cli credential embed add --name openai-shared --provider openai --model text-embedding-3-small --api-key <key> --rw $ neo4j-cli credential embed use openai-shared
neo4j-cli config — persistent global settings stored in the OS config directory.
$ neo4j-cli config list # show all settings and current values $ neo4j-cli config get telemetry $ neo4j-cli config set telemetry false --rw # same effect as DO_NOT_TRACK=1 $ neo4j-cli config set skill-auto-refresh false --rw # disable post-update skill refresh $ neo4j-cli config set default-output-format json --rw # change default --format
Connection env vars — override stored credentials. Ignored by default; opt in with neo4j-cli config set accept-env-vars true --rw or NEO4J_CLI_ACCEPT_ENV_VARS=1. An override needs all three of URI / username / password:
NEO4J_URI=neo4j+s://host:7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=secret NEO4J_DATABASE=neo4j NEO4J_DEBUG=1 # enable driver diagnostics on stderr (same as --debug)
Embedding env vars (also gated by accept-env-vars):
NEO4J_EMBED_PROVIDER=openai # openai | ollama | huggingface | gemini | vertex NEO4J_EMBED_MODEL=text-embedding-3-small NEO4J_EMBED_API_KEY=sk-… # also reads OPENAI_API_KEY / HF_TOKEN NEO4J_EMBED_BASE_URL=https://… # custom endpoint (Ollama, HF dedicated)
Installer & telemetry env vars:
DO_NOT_TRACK=1 # disable telemetry for this invocation only NEO4J_CLI_AUTO_INSTALL_SKILL=1 # installer prefix: runs skill install --rw post-install
The same keys are also read from a .env file, which the CLI locates by walking up from the current directory to the git root. .env files and explicit flags are not affected by the accept-env-vars gate.
Run Cypher via the Bolt protocol. With a stored dbms credential, no connection flags are needed.
$ neo4j-cli query 'MATCH (n) RETURN count(n) AS n' $ echo 'MATCH (n) RETURN count(n)' | neo4j-cli query # stdin $ neo4j-cli query 'RETURN $ids' --param 'ids=[1,2,3]' # JSON-typed param $ neo4j-cli query … --debug # driver diagnostics to stderr (NEO4J_DEBUG=1)
Built-in commands — pass instead of a Cypher string:
$ neo4j-cli query :schema # labels, rel-types, property keys, indexes, constraints $ neo4j-cli query :schema --format json # machine-readable schema $ neo4j-cli query :embed "hello world" # embed text and print vector (no DB needed)
Connection resolution (highest priority first):
--uri/--username/--password/--databaseflags- Env vars:
NEO4J_URI,NEO4J_USERNAME,NEO4J_PASSWORD,NEO4J_DATABASE— only read whenaccept-env-varsis enabled .envfile (walks up to git root)--credential <name>or default stored dbms credential- Built-in defaults:
neo4j://localhost:7687, userneo4j, dbneo4j
http:// and https:// URIs are auto-rewritten to neo4j:// / neo4j+s://. For self-signed certs use neo4j+ssc://.
Bind a vector inline with --param NAME:embed=text — text is sent to the configured provider and the resulting []float32 is bound as $NAME for both EXPLAIN preflight and the real query.
$ 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.title, score" $ neo4j-cli query :embed "hello world" --format json # standalone, no DB needed
Providers and defaults: openai (api.openai.com/v1) · ollama (localhost:11434, no key) · huggingface (serverless; set --embed-base-url for dedicated endpoint) · gemini (GEMINI_API_KEY / GOOGLE_API_KEY) · vertex (Application Default Credentials; needs --vertex-project + --vertex-location).
Settings resolution (highest first): flag (--embed-provider, --embed-model, …) → env (NEO4J_EMBED_PROVIDER, NEO4J_EMBED_MODEL, …; requires accept-env-vars) → .env → stored embed credential → provider defaults.
API-key priority: OPENAI_API_KEY / HF_TOKEN → NEO4J_EMBED_API_KEY → .env → stored credential. One --credential dbms can drive both connection and embedding when the dbms profile carries an embed link.
Requires an aura-client credential. Get client ID + secret from Aura Account Settings.
Aura resources are organized as organization → project → instance. Instance / snapshot / agent / CMK / graph-analytics commands all need an --organization-id + --project-id pair, or a default workspace pinned via workspace use.
$ neo4j-cli aura organization list $ neo4j-cli aura project list --organization-id <org-id> $ neo4j-cli aura workspace use <org-id>/<project-id> --rw # pin default scope $ neo4j-cli aura instance list --format table $ neo4j-cli aura instance get <id> $ neo4j-cli aura instance create --name my-db --type free --rw $ neo4j-cli aura instance create --name prod --type professional \ --cloud-provider aws --region us-east-1 --memory 4GB \ --wait --rw $ neo4j-cli aura instance delete <id> --rw $ neo4j-cli aura instance deploy --from-docker dev --type free --rw # clone a local DB into a new Aura instance
--type takes the Aura tier names free, professional, business-critical and virtual-dedicated-cloud. The former free-db / professional-db / enterprise-db names are still accepted and mapped to their current equivalents.
instance create auto-stores DB credentials as a dbms credential named <instance-id>-default so query connects immediately. Pass --no-credential-storage to skip. --wait polls until the instance status is running; --timeout sets the deadline in seconds (default: 300).
aura instance snapshot — on-demand backups; restore by overwriting an instance from a snapshot:
$ neo4j-cli aura instance snapshot list --instance-id <id> $ neo4j-cli aura instance snapshot create --instance-id <id> --wait --rw $ neo4j-cli aura instance snapshot get <snapshot-id> --instance-id <id> $ neo4j-cli aura instance overwrite <id> --source-snapshot-id <snapshot-id> --rw # restore from a snapshot
aura graph-analytics session — Graph Analytics (GDS) sessions, standalone or attached to an instance:
$ neo4j-cli aura graph-analytics session list --instance-id <id> $ neo4j-cli aura graph-analytics session create --name my-session --memory 8GB --instance-id <id> --wait --rw $ neo4j-cli aura graph-analytics session get <session-id> $ neo4j-cli aura graph-analytics session delete <session-id> --yes --force --rw
aura cmk — customer-managed encryption keys:
$ neo4j-cli aura cmk list $ neo4j-cli aura cmk get <cmk-id> $ neo4j-cli aura cmk create --name my-key --type enterprise-db --cloud-provider aws --region us-east-1 --key-id arn:aws:kms:… --rw $ neo4j-cli aura cmk delete <cmk-id> --rw
aura agent — LLM-backed assistants bound to an instance. Seven agent leaves: list, get, create, update, replace, delete, invoke. Every leaf except list takes the agent id as a positional argument:
$ neo4j-cli aura agent list --format json $ neo4j-cli aura agent get <agent-id> $ neo4j-cli aura agent create --name docs-bot --description "Docs assistant" --dbid <dbid> \ --tools '[{"type":"text2cypher","name":"ask","description":"Answer questions about the graph"}]' --rw $ neo4j-cli aura agent create --name docs-bot --description "Docs assistant" --dbid <dbid> \ --tools '[…]' --system-prompt "You are a helpful graph analyst" --is-mcp-enabled --rw $ neo4j-cli aura agent update <agent-id> --description "Updated blurb" --rw # PATCH — sends only the flags you pass $ neo4j-cli aura agent replace <agent-id> --name docs-bot --description "Docs assistant" \ --dbid <dbid> --tools '[…]' --rw # PUT — full object, all four required $ neo4j-cli aura agent invoke <agent-id> --input "How many movies are there?" --rw $ neo4j-cli aura agent delete <agent-id> --rw --yes --force
create and replace both require --name, --description, --dbid (the Aura instance the agent queries), and --tools; update requires none of them and patches only what you supply. Optional on all three: --system-prompt, --is-private, --is-mcp-enabled (exposes the agent over MCP), --enabled.
--tools takes a JSON array of {type, name, description, config} objects — the type discriminator is camelCase: text2cypher, cypherTemplate, similaritySearch. Per-type config shapes are in the Aura v2beta1 spec.
invoke under --format json returns the full server response (content blocks, status, end_reason, usage); the default table output prints the joined text followed by a stats line — Status / End reason / Tool calls / Tokens.
aura agent evaluation-dataset / evaluation-run — score an agent against a fixed question set:
$ neo4j-cli aura agent evaluation-dataset create --name "Product Q&A" --questions-file ./questions.json --rw $ neo4j-cli aura agent evaluation-dataset list $ neo4j-cli aura agent evaluation-run create --agent-id <agent-id> --dataset-id <dataset-id> \ --metric accuracy --metric groundedness --wait --rw $ neo4j-cli aura agent evaluation-run list --agent-id <agent-id> $ neo4j-cli aura agent evaluation-run get <run-id> --format json # per-question results once finished $ neo4j-cli aura agent evaluation-run cancel <run-id> --rw
The questions file is a JSON array of 1–50 {query_number, query_text, expected_answer} objects. --metric is repeatable: accuracy, tool_trajectory, groundedness, relevance. Datasets also support get, update, delete; runs support delete (deletes need --yes --force).
Run Neo4j locally by shelling out to the host docker CLI. Requires Docker Desktop (or any Docker-compatible runtime aliased to docker) on PATH. Managed containers carry an org.neo4j.cli.managed=true label — no separate state file.
$ neo4j-cli docker create --name dev --wait --rw # enterprise eval; stores dbms cred $ neo4j-cli docker create --name dev --edition community --wait --rw $ neo4j-cli docker create --name gds --plugin apoc --plugin graph-data-science --rw # plugins via NEO4J_PLUGINS $ neo4j-cli docker list --format table $ neo4j-cli docker get dev $ neo4j-cli docker stop dev --rw $ neo4j-cli docker start dev --wait --rw $ neo4j-cli docker delete dev --yes --force --rw # removes container + stored credential $ neo4j-cli docker delete movies --remove-volume --yes --force --rw # also drop the data volume a docker load left
create auto-stores a dbms credential (named after --name) so neo4j-cli query --credential dev connects immediately. Host ports default to 7474/7687 and auto-increment when taken. Pass --version 5.26.0 to pin a Neo4j version; --accept-license upgrades to the commercial license.
--wait polls the Bolt port every second until the container accepts connections. --timeout <seconds> sets the deadline (default: 60). Without --wait, the command returns immediately after docker run exits — the DB may not be ready yet.
Ephemeral containers (--ephemeral) run with docker run --rm — no credential is persisted. Pass --env-out-file <path> to write an env-file for query --env:
$ neo4j-cli docker create --name tmp --ephemeral --env-out-file /tmp/n.env --wait --rw $ neo4j-cli query --env /tmp/n.env 'RETURN 1 AS ok' $ neo4j-cli docker stop tmp --rw # container auto-removed by Docker
Mount host directories with --data-dir, --logs-dir, or --import-dir to persist data across deletes. --data-dir is incompatible with --ephemeral.
Manage a local Neo4j Desktop 2 install — install the app, lifecycle local DBMSes, install plugins, register saved remote connections, and organise them with projects and tags. All commands except install talk to Desktop's local relate API on http://localhost:<port>/fastify/api, so Desktop must be running. --port pins the API port instead of probing 44222..44232.
$ neo4j-cli desktop install --rw # install Desktop 2 (DMG / AppImage / NSIS .exe) $ neo4j-cli desktop install --dry-run --rw # resolve manifest + URL only, no download $ neo4j-cli desktop list --format table # composed view: DBMSes + saved connections $ neo4j-cli desktop doctor # structured health check
dbms — local DBMS lifecycle. Desktop 2 ships enterprise-only; no --edition flag. Only one DBMS may run at a time on port 7687; pass --force on create/start to stop the conflicting one first. --wait polls the relate API every second until status=started; --timeout <seconds> sets the deadline (default: 30).
$ neo4j-cli desktop dbms list --format table $ neo4j-cli desktop dbms create --name dev --wait --rw # latest stable version auto-picked $ neo4j-cli desktop dbms create --name dev --version 2026.04.0 --wait --rw $ neo4j-cli desktop dbms start <id> --wait --rw $ neo4j-cli desktop dbms stop <id> --rw $ neo4j-cli desktop dbms update <id> --name dev2 --tags prod,eu --rw # rename / describe / replace project+tag sets $ neo4j-cli desktop dbms upgrade <id> --rw # upgrade to latest stable; --version pins, --backup snapshots first $ neo4j-cli desktop dbms delete <id> --rw
dbms plugin — manage plugins on a Desktop DBMS.
$ neo4j-cli desktop dbms plugin available <dbms-id> # catalog of installable plugins $ neo4j-cli desktop dbms plugin list <dbms-id> # currently installed $ neo4j-cli desktop dbms plugin install <dbms-id> apoc --rw $ neo4j-cli desktop dbms plugin uninstall <dbms-id> apoc --rw
connection — saved remote DB connection profiles (Aura, self-hosted, …). Desktop owns the credential — passwords go to safeStorage, not credentials.json.
$ neo4j-cli desktop connection list $ neo4j-cli desktop connection create --name aura-prod \ --uri neo4j+s://abc123.databases.neo4j.io --username neo4j --rw # prompts for password on TTY $ neo4j-cli desktop connection update <id> --description "dev tier" --rw $ neo4j-cli desktop connection update <id> --project Prod --tags backend,oncall --rw $ neo4j-cli desktop connection delete <id> --yes --force --rw
project / tag — manage Desktop's project and tag catalogs. --project / --tags on dbms update and connection update take names or UUIDs (comma-separated or repeated), replace the existing set, and clear it when empty. Older Desktop 2 builds without these endpoints fail with an upgrade message.
$ neo4j-cli desktop project list $ neo4j-cli desktop project create "Customer 360" --rw $ neo4j-cli desktop project update "Customer 360" --name c360 --rw $ neo4j-cli desktop project delete c360 --yes --force --rw $ neo4j-cli desktop tag create staging --color 5 --rw # palette index 1..12, not hex $ neo4j-cli desktop tag update staging --name pre-prod --rw $ neo4j-cli desktop tag delete pre-prod --yes --force --rw
Query against the currently-running Desktop DBMS or a saved connection without restating credentials:
$ neo4j-cli query --credential desktop 'MATCH (n) RETURN count(n)' $ neo4j-cli query --credential desktop-connection:<uuid> 'MATCH (n) RETURN count(n)'
A local, best-effort log of the commands you have run, written one redacted JSON line per command to history.jsonl (mode 0600) alongside config.json. On by default.
$ neo4j-cli history list # last 20 commands, newest first $ neo4j-cli history list --limit 5 # show the last 5 (0 = all) $ neo4j-cli history list --format json # structured entries $ neo4j-cli history clear --force --rw # empty the log (destructive)
Secret flag values (--password, --client-secret, --api-key, --uri userinfo, secret-named --param) are redacted before writing; Cypher query bodies are stored verbatim.
Toggle & cap via config keys:
$ neo4j-cli config set history-enabled false --rw # stop recording $ neo4j-cli config set history-limit 500 --rw # cap retained entries
Load a published example Neo4j dataset into a local container, a Desktop 2 DBMS, or a new Aura instance. A dataset is any GitHub <owner>/<repo> carrying a relate.project-install.json manifest — the CLI resolves it, downloads the matching .dump, and loads it.
dataset list — curated suggestions (any manifest-bearing repo works, not just these):
$ neo4j-cli dataset list # curated suggestion set $ neo4j-cli dataset list --format json # machine-readable
load — the load verb lives on each target's own tree. Datasets are addressed by <owner>/<repo> (e.g. neo4j-graph-examples/movies); --version accepts 5, 5.26, a calver like 2026.04.0, or latest.
$ neo4j-cli docker load neo4j-graph-examples/movies --name movies --wait --rw # new local container $ neo4j-cli desktop dbms load neo4j-graph-examples/movies --name movies --rw # new Desktop 2 DBMS $ neo4j-cli aura instance load neo4j-graph-examples/movies --name movies --type free --rw # new Aura instance
Loading into an existing target overwrites the --database (default neo4j), which must already exist — pass --force to confirm. aura instance load always creates a new instance (a local Docker daemon stages the dump); datasets needing the graph-data-science plugin can't be loaded into Aura.
--rw — write gate. Required for all state-mutating operations: Cypher writes, credential mutations, config changes, Aura provisioning, Docker container creation, Desktop DBMS management.
$ neo4j-cli query 'CREATE (:Person {name:"Alice"})' --rw $ neo4j-cli aura instance delete <id> --rw $ neo4j-cli config set telemetry false --rw
Without --rw, query runs EXPLAIN first and blocks mutating Cypher before execution. --rw is auto-applied on an interactive TTY; must be explicit for agent harnesses (Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Replit, Goose, Devin, Kiro…) and non-interactive scripts (CI, piped, redirected stdout, nohup).
--force — skip safety checks that would otherwise abort a command due to a conflicting resource. Required alongside --yes for all destructive leaves in non-TTY contexts.
$ neo4j-cli docker delete dev --yes --force --rw # delete even if running $ neo4j-cli desktop dbms start <id> --force --rw # stop conflicting DBMS first
--yes — suppress interactive confirmation prompts in destructive operations. In non-TTY contexts (agents, CI, scripts) destructive leaves (… delete / … remove — Aura instance/agent/CMK/graph-analytics session, docker delete, desktop dbms/connection/project/tag delete, credential … remove) require both --yes and --force; missing either exits with code 2.
$ neo4j-cli desktop connection delete <id> --yes --force --rw $ neo4j-cli aura instance delete <id> --yes --force --rw
Disable telemetry without writing config: DO_NOT_TRACK=1 neo4j-cli …
--format — explicit format override. Accepted values: default, json, table, toon (compact, agent-friendly).
$ neo4j-cli query 'MATCH (n) RETURN n LIMIT 5' # default: table on TTY, JSON when piped $ neo4j-cli query … --format json # {columns, rows, truncated, arrays_truncated} $ neo4j-cli query … --format table # force table even when piped $ neo4j-cli aura instance list --format table # management commands support table too $ neo4j-cli aura instance list --format json
stdio auto-detection — the CLI detects whether stdout is a TTY and adjusts output automatically without any flag.
- Interactive TTY — coloured table, progress spinners, human-readable sizes.
- Piped / redirected — plain text (one value per line for scalars, TSV-like rows for multi-column), no ANSI codes. Safe to pipe into
grep,awk,xargs,jq. - Agent harnesses — detected automatically; default to
toon(compact, agent-friendly). Use--format jsonfor structured consumption.
$ neo4j-cli query 'RETURN 42 AS n' | grep n # plain: "42" $ neo4j-cli query … --format json | jq '.rows[].n' # structured JSON pipeline $ neo4j-cli aura instance list --format json | jq '.[].id'
--max-rows / --truncate-arrays-over — limit result size to avoid flooding stdout.
$ neo4j-cli query … --max-rows 100 $ neo4j-cli query … --max-rows 500 --truncate-arrays-over 10 # cap arrays at 10 elements $ neo4j-cli query … --truncate-arrays-over 0 # disable array truncation
Diagnostic output always goes to stderr (--debug, warnings, error messages) so it never pollutes pipelines that consume stdout.
Self-skill — installs the embedded CLI skill bundle (SKILL.md + per-subcommand refs) into all detected agents:
$ neo4j-cli skill install --rw # all detected agents $ neo4j-cli skill install --agent claude-code --rw # scope to one agent
agent-skills catalog — curated skills for Cypher, GDS, GraphRAG, modeling, drivers, import and more, sourced from neo4j/agent-skills:
$ neo4j-cli skill install --all --rw # self-skill + full catalog $ neo4j-cli skill install neo4j-cypher-skill --rw # one catalog skill by name $ neo4j-cli skill install neo4j-cypher-skill --refresh --rw # force catalog re-fetch first
Manage:
$ neo4j-cli skill list # skills × agents matrix $ neo4j-cli skill check # version drift vs running binary $ neo4j-cli skill remove neo4j-cypher-skill --rw # remove a catalog skill $ neo4j-cli skill remove self --agent windsurf --rw # remove self-skill from one agent
Supported agents: Claude Code, Cursor, Windsurf, Copilot, Antigravity, Gemini CLI, Cline, Codex, Pi, OpenCode, Junie, Kiro. Self-skill bundles refresh automatically on binary version change (interactive terminals only); opt out with neo4j-cli config set skill-auto-refresh false --rw.
agent-context — emit a stable JSON envelope describing the command surface for agent discovery. Default is a compact flat index (path + short); pass a command path for one command's flags and examples, or --full for the complete tree:
$ neo4j-cli agent-context --format json | jq '.commands[].path' # compact index $ neo4j-cli agent-context aura instance list --format json # one command's details $ neo4j-cli agent-context --full --format json # complete recursive tree (large)