跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 neo4j-cli-tools-skill

Neo4j Cli Tools Skill

与 Neo4j 命令行工具工作时使用 – New4j- cli( 现代统一)

309 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

与 Neo4j 命令行工具工作时使用 – New4j- cli( 现代统一)

何时用

- 密码查询、计划检查、Aura、Docker、证书、代理技能-`neo4j-cli'(**首选**)

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Neo4j CLI Tools skill、When to Use、When NOT to Use、Available CLI Tools、1. neo4j-cli、Schema-first workflow: always inspect schema before writing Cypher。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/neo4j-admin-reference.md、references/cypher-shell-reference.md、references/aura-cli-reference.md、references/neo4j-mcp-reference.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Use when working with Neo4j command-line tools — neo4j-cli (modern unified

Neo4j CLI Tools skillWhen to UseWhen NOT to UseAvailable CLI Tools1. neo4j-cliSchema-first workflow: always inspect schema before writing CypherRun Cypher (bolt URIs auto-rewritten; HTTP URIs rewritten to Bolt)Inline embedding parameter (text → vector; $q bound to []float32)Store a connection profile, then query without flagsLocal Docker: persistent or ephemeralInstall skills from catalog (neo4j-contrib/neo4j-skills)2. neo4j-admin

· allowed-tools:WebFetch, Bash

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
neo4j-cli-tools-skill
description
Use when working with Neo4j command-line tools — neo4j-cli (modern unified
allowed-tools
WebFetch, Bash实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 4
  • references/neo4j-admin-reference.md
  • references/cypher-shell-reference.md
  • references/aura-cli-reference.md
  • references/neo4j-mcp-reference.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「neo4j-cli-tools-skill」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-b60de8701f16a0da-Neo4j-Cli-%E5%B7%A5%E5%85%B7%E6%8A%80%E8%83%BD.html
请存为 .cursor/skills/neo4j-cli-tools-skill/SKILL.md 或 .claude/skills/neo4j-cli-tools-skill/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/neo4j-contrib/neo4j-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/neo4j-contrib/neo4j-skills' --list

npx skills add 'https://github.com/neo4j-contrib/neo4j-skills' --skill 'neo4j-cli-tools-skill'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: neo4j-cli-tools-skill description: Use when working with Neo4j command-line tools — neo4j-cli (modern unified CLI — Cypher via Bolt, schema inspection, Aura management, Docker containers, credential management, agent skill catalog install; install with curl -sSfL https://neo4j.sh/install.sh | bash), neo4j-admin (backup, restore, import, memory sizing), cypher-shell (ad-hoc queries, scripting, CI/CD), or neo4j-mcp (quick MCP server install). Does NOT cover Cypher query authoring — use neo4j-cypher-skill. Does NOT cover driver upgrades — use neo4j-migration-skill. Does NOT cover full MCP editor configuration — use neo4j-mcp-skill. allowed-tools: WebFetch, Bash version: 1.0.13

Neo4j CLI Tools skill

When to Use

  • Cypher queries, schema inspection, Aura, Docker, credentials, agent skills → neo4j-cli (preferred)
  • Admin tasks: backup, restore, import, memory sizing → neo4j-admin
  • Ad-hoc queries, scripting, CI/CD (Java required) → cypher-shell
  • MCP server install → neo4j-mcp

When NOT to Use

  • Writing or optimizing Cypher queries → neo4j-cypher-skill
  • Upgrading Neo4j drivers or migrating Cypher syntax → neo4j-migration-skill
  • Starting a new Neo4j project from scratch → neo4j-getting-started-skill

Available CLI Tools

1. neo4j-cli

Modern unified CLI. Bolt-native Cypher, schema inspection, Aura management, local Docker, credential storage, agent skill catalog install. Single binary — no Java required.

Install:

curl -sSfL https://neo4j.sh/install.sh | bash   # recommended
brew install neo4j-labs/tap/neo4j-cli            # Homebrew
pip install neo4j-cli / pipx install neo4j-cli   # PyPI
npm i -g @neo4j-labs/cli                         # npm

Self-update: neo4j-cli update (also refreshes installed skills automatically)

Key subcommands:

| Subcommand | Purpose | |---|---| | neo4j-cli query [cypher] | Run Cypher via Bolt — auto-rewrites HTTP URIs | | neo4j-cli query :schema | Inspect labels, rel types, indexes, constraints | | neo4j-cli query :embed [text] | Compute embedding vector standalone | | neo4j-cli aura instance ... | Provision and manage Aura instances | | neo4j-cli aura agent ... | Manage Aura Agents (list/get/create/invoke) | | neo4j-cli docker create/start/stop/delete | Manage local Neo4j Docker containers | | neo4j-cli credential aura-client ... | Store Aura API credentials | | neo4j-cli credential dbms ... | Store Neo4j connection profiles (URI + auth) | | neo4j-cli credential embed ... | Store embedding provider credentials | | neo4j-cli skill install [skill-name] | Install self-skill or any catalog skill | | neo4j-cli skill list / check / remove | Manage installed agent skills | | neo4j-cli update | Self-update binary + refresh installed skills |

Key patterns:

# Schema-first workflow: always inspect schema before writing Cypher
neo4j-cli query :schema --format toon

# Run Cypher (bolt URIs auto-rewritten; HTTP URIs rewritten to Bolt)
neo4j-cli query "MATCH (n:Person) RETURN n.name LIMIT 5" \
  --uri neo4j+s://xxx.databases.neo4j.io --username neo4j --password $PASS

# Inline embedding parameter (text → vector; $q bound to []float32)
neo4j-cli query "MATCH (c) SEARCH c IN (VECTOR INDEX chunk_embedding FOR \$q LIMIT 5) SCORE AS score RETURN c.text, score" \
  --param q:embed="graph database performance"

# Store a connection profile, then query without flags
neo4j-cli credential dbms add --name prod \
  --uri neo4j+s://xxx.databases.neo4j.io --username neo4j --password $PASS
neo4j-cli query --credential prod "MATCH (n) RETURN count(n)"

# Local Docker: persistent or ephemeral
neo4j-cli docker create --name dev --wait --rw
neo4j-cli query --credential dev 'RETURN 1 AS n'
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 n'

# Install skills from catalog (neo4j-contrib/neo4j-skills)
neo4j-cli skill install                          # self-skill into all detected agents
neo4j-cli skill install neo4j-cypher-skill       # one catalog skill, all agents
neo4j-cli skill install --all                    # self-skill + every catalog skill
neo4j-cli skill install --agent claude-code      # scope to one agent
neo4j-cli skill check                            # detect drift after upgrades

Agent output: Always use --format toon — ~40% fewer tokens than JSON. Set as default: neo4j-cli config set format toon.

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.

Async operations: instance create/resize/destroy and docker create accept --wait to block until terminal state.

Credentials precedence: flag > OS env (NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD, NEO4J_DATABASE) > .env walk-up > stored credential.

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

Full reference: neo4j-cli skill install keeps an always-in-sync skill in your agent.


2. neo4j-admin

Included with Neo4j. Backup, restore, dump/load, CSV import, memory sizing, password reset. Run as Neo4j system user.

Reference: neo4j-admin-reference.md

3. cypher-shell

Interactive Cypher REPL. Requires Java 21. Included with Neo4j. Use for ad-hoc queries, file-based batch scripting, CI/CD pipelines.

Reference: cypher-shell-reference.md

4. aura-cli

Legacy Aura cloud CLI. Prefer neo4j-cli aura for new work — covers all aura-cli operations plus credential storage, Docker, and agent skills.

Reference: aura-cli-reference.md

5. neo4j-mcp

MCP server for AI agent integration. For full install + editor config → use neo4j-mcp-skill (covers Claude Code, Desktop, Cursor, Windsurf, VS Code, Kiro, stdio vs HTTP transport, troubleshooting).

pip install neo4j-mcp-server && neo4j-mcp --version

Reference: neo4j-mcp-reference.md

Backup and Recovery

Edition gate

Online backup requires Enterprise Edition. Community Edition users must use dump/load only (database must be offline).

Backup (Enterprise — database stays online)

# Full online backup — database stays online during backup
neo4j-admin database backup \
  --to-path=/backups/ \
  --database=neo4j \
  --compress

# Differential backup — only changes since last full backup (faster)
neo4j-admin database backup \
  --to-path=/backups/ \
  --database=neo4j \
  --type=DIFF \
  --compress

# Backup to cloud storage (S3, GCS, or HTTPS)
neo4j-admin database backup \
  --to-path=s3://my-bucket/neo4j-backups/ \
  --database=neo4j

Restore (Enterprise)

AGENT GATE — destructive operation: Before running restore, show the user the exact command and target database name, and wait for explicit confirmation. A restore overwrites the existing database.

# Restore from a full or differential backup
# Requires DB to be stopped, or use --force-offline for a running instance
neo4j-admin database restore \
  --from-path=/backups/neo4j-2026-01-15T10-00-00/ \
  --database=neo4j \
  --overwrite-destination=true

# Restore to a new database name (non-destructive path)
neo4j-admin database restore \
  --from-path=/backups/neo4j-2026-01-15T10-00-00/ \
  --database=neo4j-restored

Dump / Load (all editions — database must be offline)

Use for migrations, dev/test data transfers, and Community Edition backups.

# Dump — stop the database first, or pass --force-offline
neo4j-admin database dump --to-path=/exports/ neo4j

# Load — overwrites if target DB exists
neo4j-admin database load \
  --from-path=/exports/neo4j.dump \
  --database=neo4j \
  --overwrite-destination=true

AGENT GATE — destructive operation: Before running load with --overwrite-destination=true, confirm target database name and path with the user.

Key flags

| Flag | Notes | |---|---| | --compress | Zstd compression on backup archives | | --type=DIFF | Differential: only changes since last full backup | | --to-path | Local path or s3://, gs://, https:// | | --overwrite-destination=true | Required if target database already exists | | --force-offline | Allow backup/restore of a running database in some scenarios |

Point-in-time restore strategy

  • Full backup: weekly (e.g. every Sunday)
  • Differential backup: daily (captures only changes since last full)
  • Naming convention: include timestamp in path — e.g. /backups/neo4j-2026-01-19T02-00-00/
  • Restore sequence: apply full backup first, then each differential in chronological order
# Example: restore Sunday full + Monday + Tuesday differentials
neo4j-admin database restore \
  --from-path=/backups/neo4j-2026-01-19T02-00-00/ \
  --database=neo4j --overwrite-destination=true

neo4j-admin database restore \
  --from-path=/backups/neo4j-2026-01-20T02-00-00/ \
  --database=neo4j --overwrite-destination=true

neo4j-admin database restore \
  --from-path=/backups/neo4j-2026-01-21T02-00-00/ \
  --database=neo4j --overwrite-destination=true

Environment Variables (neo4j-admin / cypher-shell)

  • NEO4J_URI / NEO4J_ADDRESS — connection URI
  • NEO4J_USERNAME / NEO4J_PASSWORD / NEO4J_DATABASE
  • NEO4J_CONF — path to neo4j.conf directory
  • NEO4J_HOME — Neo4j installation directory

Precedence: flags > env vars > config files. neo4j-cli uses its own credential store — see neo4j-cli credential dbms.

Resources


Checklist

  • [ ] Correct tool selected: neo4j-cli (preferred) / neo4j-admin / cypher-shell / neo4j-mcp
  • [ ] If using neo4j-cli: neo4j-cli skill install run after install or upgrade (keeps skill in sync)
  • [ ] Credentials via env or credential dbms; not hardcoded
  • [ ] Using --format toon for agent-facing neo4j-cli output
  • [ ] Destructive ops confirmed before execution
  • [ ] Post-op verify: connect + SHOW INDEXES + count
  • [ ] Backup taken before restore or schema change

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…