mock
Generate mock data and simulate API endpoints using CLI tools. Use when prototyping APIs or testing integrations.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bytesagain/mockMock — Mock Data & API Simulation Tool
Generate realistic mock data, define API endpoints, record and replay HTTP interactions, and manage response schemas — all from the command line. Perfect for frontend developers prototyping without a backend, QA engineers needing test fixtures, or anyone who needs fake-but-realistic data fast.
Prerequisites
- Python 3.8+
bashshelljq(for JSON formatting, optional but recommended)curl(for server testing)
Data Storage
All mock data is stored in ~/.mock/data.jsonl as newline-delimited JSON. Each record has a unique id, a type field (endpoint, response, schema, seed, recording), and a created_at timestamp.
Configuration is stored in ~/.mock/config.json.
Commands
server
Start a mock HTTP server on a specified port. Serves all defined endpoints with their configured responses.
MOCK_PORT=8080 bash scripts/script.sh server
endpoint
Create, list, or delete API endpoint definitions. Each endpoint has a method, path, status code, and response body reference.
MOCK_METHOD=GET MOCK_PATH="/api/users" MOCK_STATUS=200 MOCK_RESPONSE_ID=resp_abc bash scripts/script.sh endpoint
response
Define a response body template. Supports static JSON and dynamic field placeholders for mock data generation.
MOCK_BODY='{"id":"{{uuid}}","name":"{{name}}","email":"{{email}}"}' MOCK_NAME="user-response" bash scripts/script.sh response
record
Record an HTTP interaction (request + response) for later replay. Stores method, URL, headers, and response.
MOCK_URL="https://api.example.com/users" MOCK_METHOD=GET bash scripts/script.sh record
replay
Replay a previously recorded HTTP interaction by its record ID.
MOCK_RECORD_ID=rec_123 bash scripts/script.sh replay
schema
Define or validate a JSON schema for mock data. Used to generate type-safe mock responses.
MOCK_SCHEMA_NAME="User" MOCK_SCHEMA='{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}' bash scripts/script.sh schema
seed
Generate seed data from a schema. Produces N records of realistic fake data matching the schema definition.
MOCK_SCHEMA_ID=sch_123 MOCK_COUNT=10 bash scripts/script.sh seed
list
List all stored items (endpoints, responses, schemas, seeds, recordings) with optional type filtering.
MOCK_TYPE=endpoint bash scripts/script.sh list
export
Export all mock data or a filtered subset to a JSON file for sharing or backup.
MOCK_OUTPUT=/tmp/mock-export.json MOCK_TYPE=all bash scripts/script.sh export
config
View or update configuration settings (default port, data directory, response delay, CORS settings).
MOCK_KEY=port MOCK_VALUE=3000 bash scripts/script.sh config
help
Show usage information and available commands.
bash scripts/script.sh help
version
Display the current version of the mock skill.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bytesagain-mock": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
interview-mock-partner
Simulates behavioral interview questions for medical professionals.
mcp-builder
Bootstraps new Model Context Protocol (MCP) servers from a natural language description. Use when the user asks to build an MCP server, create an MCP tool, scaffold an MCP integration, or add MCP capabilities to an existing project. NOT for: general API design, non-MCP tool building, or frontend tasks.
human_test
Call real humans to test your product (URL or app). Get structured usability feedback with screen recordings, NPS scores, and AI-aggregated findings.
goldenseed
Deterministic entropy streams for reproducible testing and procedural generation. Perfect 50/50 statistical distribution with hash verification. Not cryptographically secure - use for testing, worldgen, and scenarios where reproducibility matters more than unpredictability.
scrapebadger
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API