Cyphra
Cyphra is a TypeScript-first toolkit for Neo4j that combines:
- A schema DSL (
.cyphrafiles) with a Prisma-like feel - A Cypher-first query layer (tagged templates + a small builder) — Queries
- Runtime — Neo4j driver wrapper, sessions, transactions — Runtime (also available as
@cyphra/runtime) - Versioned migrations with tracking on
__CyphraMigrationnodes — Migrations - A CLI (
init,validate,generate,schema print/schema ddl,migrate,push) — CLI
Cypher stays visible. The graph model stays first-class.
Install
Recommended: one dependency for the library surface (schema, query, runtime, migrator):
pnpm add cyphraThe CLI is published separately:
pnpm add -D @cyphra/cliAdvanced: install @cyphra/schema, @cyphra/query, @cyphra/runtime, and @cyphra/migrator individually if you want explicit subpackage boundaries.
Example project
See the Example app page — run pnpm example:basic from the monorepo after pnpm build.
Quick start
import { cypher, CyphraClient } from "cyphra";
const client = new CyphraClient({
uri: process.env.NEO4J_URI!,
user: process.env.NEO4J_USER!,
password: process.env.NEO4J_PASSWORD!,
});
await client.withSession(async (session) => {
await client.runCompiled(session, cypher`RETURN 1 AS n`);
});
await client.close();Last updated on