
Emulate
Run stateful local stand-ins for Vercel, GitHub, Google, Slack, Apple, Microsoft, and AWS APIs so tests and CI work without the public internet.
Install
npx skills add https://github.com/vercel-labs/emulate --skill emulateWhat is this skill?
- Zero-config `npx emulate` starts seven named providers on ports 4000–4006 with sensible defaults
- Stateful, production-fidelity API emulation—not shallow HTTP mocks
- CLI flags for `--service`, `--port`, `--seed config.yaml`, plus `emulate init` and `emulate list`
- Seed YAML to preload deployments, repos, or other fixture state for repeatable tests
- Allowed-tools scope: Bash via `npx emulate:*` and `emulate:*` for agent-driven setup
Adoption & trust: 122 installs on skills.sh; 1.3k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Canonical shelf is Ship/testing because the skill’s triggers center on tests, CI, and no-network sandboxes against production-fidelity APIs. Testing is the primary job—emulate is not a mock stub generator but a local service you assert against in integration suites.
Common Questions / FAQ
Is Emulate safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Emulate
# Service Emulation with emulate Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation, not mocks. ## Quick Start ```bash npx emulate ``` All services start with sensible defaults: | Service | Default Port | |-----------|-------------| | Vercel | 4000 | | GitHub | 4001 | | Google | 4002 | | Slack | 4003 | | Apple | 4004 | | Microsoft | 4005 | | AWS | 4006 | ## CLI ```bash # Start all services (zero-config) npx emulate # Start specific services npx emulate --service vercel,github # Custom base port (auto-increments per service) npx emulate --port 3000 # Use a seed config file npx emulate --seed config.yaml # Generate a starter config npx emulate init # Generate config for a specific service npx emulate init --service vercel # List available services npx emulate list ``` ### Options | Flag | Default | Description | |------|---------|-------------| | `-p, --port` | `4000` | Base port (auto-increments per service) | | `-s, --service` | all | Comma-separated services to enable | | `--seed` | auto-detect | Path to seed config (YAML or JSON) | | `--base-url` | none | Override advertised base URL (supports `{service}` template) | | `--portless` | off | Serve over HTTPS via portless (auto-registers aliases) | The port can also be set via `EMULATE_PORT` or `PORT` environment variables. The advertised base URL (used in OAuth redirects, webhook URLs, etc.) can be overridden via `--base-url`, the `EMULATE_BASE_URL` env var (supports `{service}` template), or per-service `baseUrl` in the seed config. When running under portless, the `PORTLESS_URL` env var is also detected automatically. ## Programmatic API ```bash npm install emulate ``` Each call to `createEmulator` starts a single service: ```typescript import { createEmulator } from 'emulate' const github = await createEmulator({ service: 'github', port: 4001 }) const vercel = await createEmulator({ service: 'vercel', port: 4002 }) github.url // 'http://localhost:4001' vercel.url // 'http://localhost:4002' await github.close() await vercel.close() ``` ### Options | Option | Default | Description | |--------|---------|-------------| | `service` | *(required)* | `'vercel'`, `'github'`, `'google'`, `'slack'`, `'apple'`, `'microsoft'`, or `'aws'` | | `port` | `4000` | Port for the HTTP server | | `seed` | none | Inline seed data (same shape as YAML config) | | `baseUrl` | none | Override advertised base URL. Per-service `baseUrl` in seed config takes highest priority, then this option, then `EMULATE_BASE_URL` env var (supports `{service}`), then `PORTLESS_URL` (supports `{service}`, automatically set by the `portless` CLI wrapper), then `http://localhost:<port>`. | ### Instance Methods | Method | Description | |--------|-------------| | `url` | Base URL of the running server | | `reset()` | Wipe the store and replay seed data | | `close()` | Shut down the HTTP server, returns a Promise | ## Vitest / Jest Setup ```typescript import { createEmulator, type Emulator } from 'emulate' let github: Emulator let vercel: Emulator beforeAll(async () => { ;[github, vercel] = await Promise.all([ createEmulator({ service: 'github', port: 4001 }), createEmulator({ service: 'vercel', port: 4002 }), ]) process.env.GITHUB_EMULATOR_URL = github.url process.env.VERCEL_EMULATOR