$npx -y skills add neo4j-contrib/neo4j-skills --skill neo4j-cli-tools-skillUse when working with Neo4j command-line tools — neo4j-cli (modern unified
| 1 | # Neo4j CLI Tools skill |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - Cypher queries, schema inspection, Aura, Docker, credentials, agent skills → `neo4j-cli` (**preferred**) |
| 6 | - Admin tasks: backup, restore, import, memory sizing → `neo4j-admin` |
| 7 | - Ad-hoc queries, scripting, CI/CD (Java required) → `cypher-shell` |
| 8 | - MCP server install → `neo4j-mcp` |
| 9 | |
| 10 | ## When NOT to Use |
| 11 | |
| 12 | - **Writing or optimizing Cypher queries** → `neo4j-cypher-skill` |
| 13 | - **Upgrading Neo4j drivers or migrating Cypher syntax** → `neo4j-migration-skill` |
| 14 | - **Starting a new Neo4j project from scratch** → `neo4j-getting-started-skill` |
| 15 | |
| 16 | ## Available CLI Tools |
| 17 | |
| 18 | ### 1. neo4j-cli |
| 19 | |
| 20 | Modern unified CLI. Bolt-native Cypher, schema inspection, Aura management, local Docker, credential storage, agent skill catalog install. Single binary — no Java required. |
| 21 | |
| 22 | **Install:** |
| 23 | ```bash |
| 24 | curl -sSfL https://neo4j.sh/install.sh | bash # recommended |
| 25 | brew install neo4j-labs/tap/neo4j-cli # Homebrew |
| 26 | pip install neo4j-cli / pipx install neo4j-cli # PyPI |
| 27 | npm i -g @neo4j-labs/cli # npm |
| 28 | ``` |
| 29 | |
| 30 | **Self-update:** `neo4j-cli update` (also refreshes installed skills automatically) |
| 31 | |
| 32 | **Key subcommands:** |
| 33 | |
| 34 | | Subcommand | Purpose | |
| 35 | |---|---| |
| 36 | | `neo4j-cli query [cypher]` | Run Cypher via Bolt — auto-rewrites HTTP URIs | |
| 37 | | `neo4j-cli query :schema` | Inspect labels, rel types, indexes, constraints | |
| 38 | | `neo4j-cli query :embed [text]` | Compute embedding vector standalone | |
| 39 | | `neo4j-cli aura instance ...` | Provision and manage Aura instances | |
| 40 | | `neo4j-cli aura agent ...` | Manage Aura Agents (list/get/create/invoke) | |
| 41 | | `neo4j-cli docker create/start/stop/delete` | Manage local Neo4j Docker containers | |
| 42 | | `neo4j-cli credential aura-client ...` | Store Aura API credentials | |
| 43 | | `neo4j-cli credential dbms ...` | Store Neo4j connection profiles (URI + auth) | |
| 44 | | `neo4j-cli credential embed ...` | Store embedding provider credentials | |
| 45 | | `neo4j-cli skill install [skill-name]` | Install self-skill or any catalog skill | |
| 46 | | `neo4j-cli skill list / check / remove` | Manage installed agent skills | |
| 47 | | `neo4j-cli update` | Self-update binary + refresh installed skills | |
| 48 | |
| 49 | **Key patterns:** |
| 50 | ```bash |
| 51 | # Schema-first workflow: always inspect schema before writing Cypher |
| 52 | neo4j-cli query :schema --format toon |
| 53 | |
| 54 | # Run Cypher (bolt URIs auto-rewritten; HTTP URIs rewritten to Bolt) |
| 55 | neo4j-cli query "MATCH (n:Person) RETURN n.name LIMIT 5" \ |
| 56 | --uri neo4j+s://xxx.databases.neo4j.io --username neo4j --password $PASS |
| 57 | |
| 58 | # Inline embedding parameter (text → vector; $q bound to []float32) |
| 59 | neo4j-cli query "MATCH (c) SEARCH c IN (VECTOR INDEX chunk_embedding FOR \$q LIMIT 5) SCORE AS score RETURN c.text, score" \ |
| 60 | --param q:embed="graph database performance" |
| 61 | |
| 62 | # Store a connection profile, then query without flags |
| 63 | neo4j-cli credential dbms add --name prod \ |
| 64 | --uri neo4j+s://xxx.databases.neo4j.io --username neo4j --password $PASS |
| 65 | neo4j-cli query --credential prod "MATCH (n) RETURN count(n)" |
| 66 | |
| 67 | # Local Docker: persistent or ephemeral |
| 68 | neo4j-cli docker create --name dev --wait --rw |
| 69 | neo4j-cli query --credential dev 'RETURN 1 AS n' |
| 70 | neo4j-cli docker create --name tmp --ephemeral --env-out-file /tmp/n.env --wait --rw |
| 71 | neo4j-cli query --env /tmp/n.env 'RETURN 1 AS n' |
| 72 | |
| 73 | # Install skills from catalog (neo4j-contrib/neo4j-skills) |
| 74 | neo4j-cli skill install # self-skill into all detected agents |
| 75 | neo4j-cli skill install neo4j-cypher-skill # one catalog skill, all agents |
| 76 | neo4j-cli skill install --all # self-skill + every catalog skill |
| 77 | neo4j-cli skill install --agent claude-code # scope to one agent |
| 78 | neo4j-cli skill check # detect drift after upgrades |
| 79 | ``` |
| 80 | |
| 81 | **Agent output:** Always use `--format toon` — ~40% fewer tokens than JSON. Set as default: `neo4j-cli config set format toon`. |
| 82 | |
| 83 | **Write gate:** Write operations require `--rw` under agent harnesses. Do NOT add it preemptively — if a command fails with "this command writes; pass --rw to allow it", surface the error and ask the user once. |
| 84 | |
| 85 | **Async operations:** `instance create/resize/destroy` and `docker create` accept `--wait` to block until terminal state. |
| 86 | |
| 87 | **Credentials precedence:** flag > OS env (`NEO4J_URI`, `NEO4J_USERNAME`, `NEO4J_PASSWORD`, `NEO4J_DATABASE`) > `.env` walk-up > stored credential. |
| 88 | |
| 89 | **S |