
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
mocktail-cli
Advanced tools
Note: .env file was sanitized in this package release. Use .env.example to set DATABASE_URL before running anything that needs a DB.
Mocktail‑CLI — The comprehensive schema‑aware mock data generator for developers. Generate realistic, relation‑aware mock data from any schema type directly from the command line with enhanced relation detection, performance optimization, and extensible plugin system.
Mocktail-CLI is the most comprehensive schema-aware CLI tool for generating realistic mock data based on any schema type. It supports 15+ schema types including Prisma, GraphQL, JSON Schema, OpenAPI, TypeScript, Protocol Buffers, Avro, XML Schema, SQL DDL, Mongoose, Sequelize, Joi, Yup, Zod, and more with nested relations, circular relation handling, deterministic seeds, schema auto-detection, and multiple output formats. Perfect for building, testing, and prototyping without waiting on backend data.
--depth.--seed and --seed-value.mocktail-cli.config.js.EmailAddress, URL, JSON, DateTime, etc.)email, uri, date-time, uuid, etc.)userId, user_id, userRef, posts, userList@relation, @belongsTo, @hasMany patterns--locale flag to change data generation locale# global install
npm i -g mocktail-cli
# or run on demand
npx mocktail-cli generate --help
# Prisma schema
npx mocktail-cli generate \
--schema ./prisma/schema.prisma \
--type prisma \
--models User,Post \
--count 50 \
--out ./mocks/data.json \
--format json \
--seed
# GraphQL schema
npx mocktail-cli generate \
--schema ./schema.graphql \
--type graphql \
--models User,Post \
--count 50
# JSON Schema
npx mocktail-cli generate \
--schema ./schema.json \
--type json-schema \
--count 50
# OpenAPI specification
npx mocktail-cli generate \
--schema ./openapi.yaml \
--type openapi \
--count 50
# TypeScript interfaces
npx mocktail-cli generate \
--schema ./types.ts \
--type typescript \
--count 50
# Protocol Buffers
npx mocktail-cli generate \
--schema ./schema.proto \
--type protobuf \
--count 50
# Avro schema
npx mocktail-cli generate \
--schema ./schema.avsc \
--type avro \
--count 50
# XML Schema
npx mocktail-cli generate \
--schema ./schema.xsd \
--type xml-schema \
--count 50
# SQL DDL
npx mocktail-cli generate \
--schema ./schema.sql \
--type sql-ddl \
--count 50
# Mongoose schemas
npx mocktail-cli generate \
--schema ./models.js \
--type mongoose \
--count 50
# Sequelize models
npx mocktail-cli generate \
--schema ./models.js \
--type sequelize \
--count 50
# Joi validation schemas
npx mocktail-cli generate \
--schema ./validation.js \
--type joi \
--count 50
# Yup validation schemas
npx mocktail-cli generate \
--schema ./validation.js \
--type yup \
--count 50
# Zod schemas
npx mocktail-cli generate \
--schema ./validation.ts \
--type zod \
--count 50
--depth 2 — set how deep nested relations go (depth > 1 enables relations).--relations — enable automatic relation generation (works with any depth).--out — output to a file or stdout.--preset blog — generate domain-specific data.Mocktail-CLI supports 15+ schema types out of the box:
| Schema Type | File Extensions | Description | Auto-Detection |
|---|---|---|---|
| Prisma | .prisma | Database schema definitions | ✅ |
| GraphQL | .graphql, .gql | API schema definitions | ✅ |
| JSON Schema | .json | Data validation schemas | ✅ |
| OpenAPI | .yaml, .yml, .json | API specification schemas | ✅ |
| TypeScript | .ts, .tsx | Interface and type definitions | ✅ |
| Protocol Buffers | .proto | Google's data serialization format | ✅ |
| Avro | .avsc, .avro | Apache Avro data serialization | ✅ |
| XML Schema | .xsd | XML document structure definitions | ✅ |
| SQL DDL | .sql | Database table definitions | ✅ |
| Mongoose | .js | MongoDB object modeling | ✅ |
| Sequelize | .js | SQL ORM model definitions | ✅ |
| Joi | .js | Object schema validation | ✅ |
| Yup | .js | Schema validation library | ✅ |
| Zod | .ts, .js | TypeScript-first schema validation | ✅ |
Mocktail-CLI automatically detects schema types based on:
.prisma → Prisma, .graphql → GraphQL)model User → Prisma, type User → GraphQL)import * as mongoose → Mongoose)You can also explicitly specify the schema type using --type:
# Auto-detect schema type
mocktail-cli generate --schema ./my-schema
# Explicitly specify schema type
mocktail-cli generate --schema ./my-schema --type typescript
# schema.graphql
scalar EmailAddress
scalar URL
scalar JSON
scalar DateTime
type User {
id: UUID!
email: EmailAddress! # Generates: "john.doe@example.com"
website: URL # Generates: "https://example.com"
metadata: JSON # Generates: { key: "data", value: "content" }
createdAt: DateTime! # Generates: "2024-01-15T10:30:00Z"
}
# Generate with custom scalars
mocktail-cli generate --schema schema.graphql --count 5
{
"type": "object",
"properties": {
"email": { "type": "string", "format": "email" },
"website": { "type": "string", "format": "uri" },
"birthDate": { "type": "string", "format": "date" },
"lastLogin": { "type": "string", "format": "date-time" },
"id": { "type": "string", "format": "uuid" }
}
}
# Complex schema with cycles
mocktail-cli generate --schema complex-schema.graphql --count 3
# Output shows cycle detection:
# 🔄 Detected 3 circular dependencies:
# • self-reference cycle: User → User (weak)
# • complex-cycle cycle: User → Post → Comment → User (strong)
# 🛠️ Applied resolution strategy: smart-break
# • Deferred 2 relations for later population
# Generate Spanish mock data
mocktail-cli generate --locale es --count 5
# Output: Names like "María García", "José Luis Rodríguez"
# Generate French mock data
mocktail-cli generate --locale fr --count 5
# Output: Names like "Pierre Dubois", "Marie Lefebvre"
# Generate Japanese mock data
mocktail-cli generate --locale ja --count 5
# Output: Names like "田中太郎", "佐藤花子"
# Generate German mock data with relations
mocktail-cli generate --locale de --relations --count 10
# Output: Names like "Hans Müller", "Anna Schmidt"
en (English), es (Spanish), fr (French), de (German), it (Italian),
pt_BR (Portuguese Brazil), ja (Japanese), ko (Korean), zh_CN (Chinese Simplified),
ru (Russian), ar (Arabic), hi (Hindi), nl (Dutch), sv (Swedish),
da (Danish), no (Norwegian), fi (Finnish), pl (Polish), tr (Turkish), th (Thai)
# Generate 20 Users (flat records)
mocktail-cli generate --models User --count 20
# Generate Users and Posts with specific counts
mocktail-cli generate --models User,Post --count 10,30 --out ./mocks
# Generate SQL inserts instead of JSON
mocktail-cli generate --format sql --out ./seeds
# Use a preset for ecommerce data
mocktail-cli generate --preset ecommerce --count 100
# Generate locale-specific data
mocktail-cli generate --locale es --count 20 --out ./spanish-data
mocktail-cli generate --locale fr --relations --count 50
The --depth and --relations flags work independently to control relation generation:
# Flat records (no relations)
mocktail-cli generate --count 5
# or
mocktail-cli generate --depth 1 --count 5
# Nested relations with depth 2
mocktail-cli generate --depth 2 --count 5
# Enable relations with default depth (2)
mocktail-cli generate --relations --count 5
# Both flags work together
mocktail-cli generate --relations --depth 3 --count 5
# Disable relations even with depth > 1
mocktail-cli generate --depth 2 --no-nest --count 5
Key points:
--depth 1 = Flat records (no nesting)--depth 2+ = Enables relations with specified nesting level--relations = Enables relations with default depth of 2--no-nest = Disables relations regardless of other flags| Option | Alias | Description |
|---|---|---|
-c, --count <number> | Number of records per model (default: 5) | |
-o, --out <directory> | Output directory | |
-f, --format <type> | Output format: json, sql, ts, csv (default: json) | |
-s, --schema <path> | Schema path (default: ./prisma/schema.prisma, auto-detect enabled) | |
-t, --type <type> | Schema type: prisma, graphql, json-schema, openapi (auto-detected if not specified) | |
-m, --models <models> | Comma-separated list of models (optional) | |
--mock-config <path> | Path to mocktail-cli.config.js | |
-d, --depth <number> | Nested relation depth - depth > 1 enables relations (default: 1) | |
--no-nest | Disable nested relations (flat structure) | |
--relations | Enable automatic relation generation (works with any depth) | |
--dedupe | Enable deduplication of records | |
--pretty | Pretty-print JSON output (default: true) | |
--no-pretty | Disable pretty-printing JSON output | |
--no-log | Suppress console logs during mock generation | |
--seed | Insert generated data into DB | |
--seed-value <number> | Seed value for reproducible data generation | |
--locale <locale> | Locale for generating culturally appropriate data (e.g., en, es, fr, ja) (default: en) | |
--preset <type> | Relation preset: blog, ecommerce, social | |
--force-logo | Force show the logo animation even if shown before | |
-h, --help | Display help with usage and examples |
| Option | Description |
|---|---|
--enable-advanced-relations | Enable enhanced relation detection with confidence scoring |
--relation-confidence <threshold> | Set relation detection confidence threshold (0-1, default: 0.5) |
--performance-mode | Enable performance optimizations for large datasets |
--memory-limit <mb> | Set memory limit in MB (default: 1024) |
--batch-size <size> | Set batch size for processing (default: 1000) |
--enable-plugins | Enable plugin system |
--plugin-dir <path> | Directory to load plugins from |
--verbose | Enable verbose output with detailed information |
--quiet | Suppress output except errors |
--no-logo | Suppress logo output globally |
---
## Configuration
Define a `mocktail-cli.config.js` or `mocktail-cli.config.json` to customize generation.
```js
module.exports = {
defaults: { locale: 'en', seedConsistency: true },
models: {
User: { count: 20, faker: { name: 'fullName', email: 'email' } },
Post: { count: 50, relations: { author: { connectBy: 'User' } } }
}
}
Mocktail-CLI includes several built-in plugins for enhanced data generation:
# Automatically generates context-aware dates
mocktail-cli generate --enable-plugins --count 100
# Generates realistic email addresses with domain patterns
mocktail-cli generate --enable-plugins --count 100
// plugins/my-generator.js
module.exports = {
name: 'my-generator',
version: '1.0.0',
description: 'Custom data generator',
generators: [
{
name: 'customField',
fieldTypes: ['string'],
generate: (field, context) => `custom-${Math.random()}`,
validate: (field) => field.name === 'customField'
}
],
hooks: {
beforeGeneration: async (context) => {
console.log('🚀 Custom plugin activated!');
}
}
};
# Load plugins from directory
mocktail-cli generate --enable-plugins --plugin-dir ./plugins
# Use with specific models
mocktail-cli generate --models User --enable-plugins --count 1000
# Generate 100,000 records with performance optimizations
mocktail-cli generate \
--count 100000 \
--performance-mode \
--memory-limit 4096 \
--batch-size 2000 \
--enable-advanced-relations
# Limited memory environment
mocktail-cli generate \
--count 50000 \
--performance-mode \
--memory-limit 1024 \
--batch-size 1000 \
--format csv
// mocktail-cli.config.js
module.exports = {
performance: {
maxMemoryUsage: 2048, // MB
batchSize: 1000,
enableMemoryMonitoring: true,
enableProgressTracking: true,
timeoutMs: 300000 // 5 minutes
}
};
mocktail-cli generate --relations --count 50mocktail-cli generate --relations --seed --seed-value 42mocktail-cli generate --depth 3 --count 20mocktail-cli generate --preset social --relations --count 100 --seed
# Generate 1 million records with all optimizations
mocktail-cli generate \
--count 1000000 \
--performance-mode \
--memory-limit 8192 \
--batch-size 5000 \
--enable-advanced-relations \
--format sql \
--out ./large-dataset
# Use custom plugins for enhanced data generation
mocktail-cli generate \
--enable-plugins \
--plugin-dir ./custom-plugins \
--enable-advanced-relations \
--count 10000
# Full production setup with all enhancements
mocktail-cli generate \
--schema ./schema.prisma \
--count 100000 \
--enable-advanced-relations \
--relation-confidence 0.8 \
--performance-mode \
--memory-limit 4096 \
--batch-size 2000 \
--enable-plugins \
--format json \
--out ./production-data \
--seed \
--seed-value 42
How Mocktail-CLI compares with other schema-aware mock data tools:
| Feature / Tool | Mocktail-CLI | Prisma-Seed | Prisma-Generator-Fake | Mockoon / MirageJS | faker-js |
|---|---|---|---|---|---|
| Multi-schema support (Prisma, GraphQL, etc.) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
| Schema aware (reads schema) | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | ❌ No |
| Auto-detect schema files | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
| Handles relations (deep / circular-safe) | ✅ Deep + safe | ⚠️ Limited | ⚠️ Limited | ❌ Manual | ❌ No |
| Deterministic seeds | ✅ --seed-value | ⚠️ Partial | ⚠️ Partial | ❌ No | ✅* |
| Output formats | ✅ JSON / SQL / CSV / TS | ❌ Mostly JSON | ❌ Mostly JSON | ✅ JSON / API | ⚠️ Code-driven only |
| CLI-first workflow | ✅ Yes | ⚠️ Partial | ⚠️ Plugin-only | ✅ Yes (server) | ❌ No |
| Relation presets (blog / ecommerce / social) | ✅ Built-in | ❌ No | ❌ No | ❌ No | ❌ No |
| DB seeding | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
| Extensible config | ✅ mocktail-cli.config.js | ⚠️ Partial | ⚠️ Partial | ⚠️ Partial | ⚠️ Manual only |
| Enhanced relation detection | ✅ NEW | ❌ No | ❌ No | ❌ No | ❌ No |
| Performance optimization | ✅ NEW | ❌ No | ❌ No | ❌ No | ❌ No |
| Plugin system | ✅ NEW | ❌ No | ❌ No | ❌ No | ❌ No |
| Better error messages | ✅ NEW | ❌ No | ❌ No | ❌ No | ❌ No |
| Large dataset support | ✅ NEW | ❌ No | ❌ No | ❌ No | ❌ No |
| Locale support (i18n) | ✅ NEW | ❌ No | ❌ No | ❌ No | ⚠️ Manual |
* faker-js supports faker.seed(...) for deterministic values, but it is not schema-aware and doesn’t handle relations automatically.
❤️ Mocktail-CLI uses @faker-js/faker internally for realistic field data — every record feels lifelike.
Takeaway:
We welcome PRs, bug reports, and feature ideas.
License Update: From v1.1.1-beta.0, Mocktail-CLI is licensed under BSL-1.1. Older versions (<=1.1.0-beta.3) remain MIT.
Order up! Your personal code barista is here. Serving fresh, Prisma-aware mock data, shaken not stirred.
FAQs
**Craft your data cocktail — realistic mock data, shaken not stirred.**
We found that mocktail-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.