New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@mock-verse/mocktail-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@mock-verse/mocktail-cli

**Craft your data cocktail — realistic mock data, shaken not stirred.**

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Mocktail-CLI

Note: .env file was sanitized in this package release. Use .env.example to set DATABASE_URL before running anything that needs a DB.

npm version

Mocktail‑CLI — The schema‑aware mock data generator for developers. Generate realistic, relation‑aware mock data from your Prisma schema directly from the command line.

Table of contents

What is Mocktail‑CLI?

Mocktail‑CLI is a Prisma‑aware CLI tool for generating realistic mock data based on your database schema. It supports nested relations, circular relation handling, deterministic seeds, and multiple output formats, helping you build and test without waiting on backend data.

Key features

  • Schema‑aware generation — reads your Prisma schema and generates data that matches model types and relations.
  • Relation handling — supports deep and circular relations with controlled depth.
  • Deterministic seeds — generate the same dataset every time with --seed and --seed-value.
  • Multiple output formats — JSON, SQL INSERT scripts, CSV.
  • Custom generators — define per‑model faker rules in mock.config.js.
  • CLI‑first — quick commands for generate, seed, and export.

Why use Mocktail‑CLI?

  • Save development time — no more hand‑crafting mock data.
  • Build realistic prototypes — frontend and backend can develop in parallel.
  • Reliable testing — deterministic seeds make tests repeatable.
  • Flexible outputs — works with files, databases, or API mocks.

Quickstart

Install

# global install
npm i -g mocktail-cli

# or run on demand
npx mocktail-cli generate --help

Generate mock data from a Prisma schema

npx mocktail-cli generate \
  --schema ./prisma/schema.prisma \
  --models User,Post \
  --count 50 \
  --output ./mocks/data.json \
  --seed
  • --depth 2 — set how deep nested relations go.
  • --output — output to a file or stdout.

CLI reference (examples)

# Generate 20 Users
mocktail-cli generate --schema ./prisma/schema.prisma --models User --count 20

# Generate Users and Posts with specific counts
mocktail-cli generate --schema ./prisma/schema.prisma --models User,Post --count 10,30 --output mocks.json

# Generate SQL inserts instead of JSON
mocktail-cli generate --schema ./prisma/schema.prisma --format sql --output seed.sql

Configuration

Define a mock.config.js or mock.config.json to customize generation.

module.exports = {
  defaults: { locale: 'en', seedConsistency: true },
  models: {
    User: { count: 20, faker: { name: 'fullName', email: 'email' } },
    Post: { count: 50, relations: { author: { connectBy: 'User' } } }
  }
}

Example workflows

Frontend prototyping

  • Generate realistic data: mocktail-cli generate --schema ./schema.prisma --count 50
  • Feed the output to your mock API server.

Testing with consistent seeds

  • Generate with seed: mocktail-cli generate --seed --seed-value 42
  • Run tests with consistent fixtures.

Roadmap

  • v1.0: CLI complete with flags for depth, output formats, custom config.
  • v1.1: Schema auto‑detection, advanced relation presets.
  • v1.2+: Integration with Mock‑Verse for API mocking and seeding.

Contributing

We welcome PRs, bug reports, and feature ideas.

  • Fork the repo
  • Create a feature branch
  • Submit PR with tests and docs

License & Contact

Mocktail‑CLI is MIT licensed. Issues and discussions welcome on the GitHub repository.

  • ☕🍹 Welcome to Mocktail CLI 🍹☕

Order up! Your personal code barista is here. Serving fresh, Prisma-aware mock data, shaken not stirred.

FAQs

Package last updated on 12 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts