Skip to content

Commit 6f1175c

Browse files
authored
docs: standardize CLI references to npx emulate (#87)
`emulate` is a zsh built-in command, so bare `emulate` invokes the shell built-in instead of the npm binary. Update all user-facing CLI examples, help output, and system prompts to use `npx emulate`. Add an AGENTS.md rule to prevent regressions.
1 parent 7628ca8 commit 6f1175c

7 files changed

Lines changed: 35 additions & 31 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Use `pnpm` for all package management commands (not npm or yarn).
66

77
Exception: End-user install instructions should use `npm` (e.g. `npx emulate`, `npm install emulate`) since npm is universal.
88

9+
## CLI Invocation
10+
11+
`emulate` is a zsh built-in command (it sets shell emulation mode). Running bare `emulate` in zsh invokes the shell built-in, not the npm binary. Always use `npx emulate` in user-facing CLI examples, docs, skills, help output, and post-command messages. The only exception is when `emulate` appears as a subprocess argument to another tool (e.g. `portless github.emulate emulate start`), where the binary is resolved by the parent process rather than the shell.
12+
913
## Dependencies
1014

1115
Always check for the latest npm version when adding dependencies. Use `pnpm add <package>` (without version) to get the latest, or verify with `npm view <package> version` first.

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ All services start with sensible defaults. No config file needed:
2222

2323
```bash
2424
# Start all services (zero-config)
25-
emulate
25+
npx emulate
2626

2727
# Start specific services
28-
emulate --service vercel,github
28+
npx emulate --service vercel,github
2929

3030
# Custom port
31-
emulate --port 3000
31+
npx emulate --port 3000
3232

3333
# Use a seed config file
34-
emulate --seed config.yaml
34+
npx emulate --seed config.yaml
3535

3636
# Generate a starter config
37-
emulate init
37+
npx emulate init
3838

3939
# Generate config for a specific service
40-
emulate init --service vercel
40+
npx emulate init --service vercel
4141

4242
# List available services
43-
emulate list
43+
npx emulate list
4444
```
4545

4646
### Options
@@ -64,7 +64,7 @@ The port can also be set via `EMULATE_PORT` or `PORT` environment variables.
6464
portless proxy start
6565

6666
# Start emulate with portless integration
67-
emulate start --portless
67+
npx emulate start --portless
6868
```
6969

7070
Each service registers as a portless alias and gets a named HTTPS URL:
@@ -82,7 +82,7 @@ The `--portless` flag overwrites any existing portless aliases matching `*.emula
8282
For a custom base URL without portless (any reverse proxy), use `--base-url` or the `EMULATE_BASE_URL` env var:
8383

8484
```bash
85-
emulate start --base-url "https://{service}.myproxy.test"
85+
npx emulate start --base-url "https://{service}.myproxy.test"
8686
```
8787

8888
The `PORTLESS_URL` env var is automatically set by the `portless` CLI wrapper when running a command through it (e.g. `portless github.emulate emulate start`), typically to a value like `https://{service}.emulate.localhost`. It supports `{service}` interpolation, just like `--base-url` and `EMULATE_BASE_URL`. When no explicit `baseUrl` is provided, it is used as a fallback.
@@ -156,7 +156,7 @@ afterAll(() => Promise.all([github.close(), vercel.close()]))
156156

157157
## Configuration
158158

159-
Configuration is optional. The CLI auto-detects config files in this order: `emulate.config.yaml` / `.yml`, `emulate.config.json`, `service-emulator.config.yaml` / `.yml`, `service-emulator.config.json`. Or pass `--seed <file>` explicitly. Run `emulate init` to generate a starter file.
159+
Configuration is optional. The CLI auto-detects config files in this order: `emulate.config.yaml` / `.yml`, `emulate.config.json`, `service-emulator.config.yaml` / `.yml`, `service-emulator.config.json`. Or pass `--seed <file>` explicitly. Run `npx emulate init` to generate a starter file.
160160

161161
```yaml
162162
tokens:

apps/web/app/api/docs-chat/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const DEFAULT_MODEL = "anthropic/claude-haiku-4.5";
1414

1515
const SYSTEM_PROMPT = `You are a helpful documentation assistant for emulate, a local drop-in replacement for Vercel, GitHub, Google, Slack, Apple, Microsoft, AWS, Okta, MongoDB Atlas, Resend, and Stripe APIs used in CI and no-network sandboxes.
1616
17-
emulate provides fully stateful, production-fidelity API emulation, not mocks. The CLI is installed as the "emulate" npm package and run via "npx emulate" or just "emulate". It also supports a programmatic API via createEmulator and a Next.js adapter (@emulators/adapter-next) for embedding emulators in your app.
17+
emulate provides fully stateful, production-fidelity API emulation, not mocks. The CLI is installed as the "emulate" npm package and run via "npx emulate". It also supports a programmatic API via createEmulator and a Next.js adapter (@emulators/adapter-next) for embedding emulators in your app.
1818
1919
You have access to the full emulate documentation via the bash and readFile tools. The docs are available as markdown files in the /workspace/ directory.
2020

apps/web/app/docs/page.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ All services start with sensible defaults. No config file needed:
2626

2727
```bash
2828
# Start all services (zero-config)
29-
emulate
29+
npx emulate
3030

3131
# Start specific services
32-
emulate --service vercel,github
32+
npx emulate --service vercel,github
3333

3434
# Custom port
35-
emulate --port 3000
35+
npx emulate --port 3000
3636

3737
# Use a seed config file
38-
emulate --seed config.yaml
38+
npx emulate --seed config.yaml
3939

4040
# Generate a starter config
41-
emulate init
41+
npx emulate init
4242

4343
# Generate config for a specific service
44-
emulate init --service github
44+
npx emulate init --service github
4545

4646
# List available services
47-
emulate list
47+
npx emulate list
4848
```
4949

5050
## Options

packages/emulate/src/commands/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export function initCommand(options: InitOptions): void {
3535
writeFileSync(fullPath, content, "utf-8");
3636

3737
console.log(`Created ${filename}`);
38-
console.log(`\nRun 'emulate' to start the emulator.`);
38+
console.log(`\nRun 'npx emulate' to start the emulator.`);
3939
}

packages/emulate/src/commands/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function printBanner(
239239
if (configSource) {
240240
lines.push(` ${pc.dim("Config:")} ${configSource}`);
241241
} else {
242-
lines.push(` ${pc.dim("Config:")} defaults ${pc.dim("(run")} emulate init ${pc.dim("to customize)")}`);
242+
lines.push(` ${pc.dim("Config:")} defaults ${pc.dim("(run")} npx emulate init ${pc.dim("to customize)")}`);
243243
}
244244
lines.push("");
245245

skills/emulate/SKILL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ All services start with sensible defaults:
3030

3131
```bash
3232
# Start all services (zero-config)
33-
emulate
33+
npx emulate
3434

3535
# Start specific services
36-
emulate --service vercel,github
36+
npx emulate --service vercel,github
3737

3838
# Custom base port (auto-increments per service)
39-
emulate --port 3000
39+
npx emulate --port 3000
4040

4141
# Use a seed config file
42-
emulate --seed config.yaml
42+
npx emulate --seed config.yaml
4343

4444
# Generate a starter config
45-
emulate init
45+
npx emulate init
4646

4747
# Generate config for a specific service
48-
emulate init --service vercel
48+
npx emulate init --service vercel
4949

5050
# List available services
51-
emulate list
51+
npx emulate list
5252
```
5353

5454
### Options
@@ -133,7 +133,7 @@ Configuration is optional. The CLI auto-detects config files in this order:
133133
3. `service-emulator.config.yaml` / `.yml`
134134
4. `service-emulator.config.json`
135135

136-
Or pass `--seed <file>` explicitly. Run `emulate init` to generate a starter file.
136+
Or pass `--seed <file>` explicitly. Run `npx emulate init` to generate a starter file.
137137

138138
### Config Structure
139139

@@ -261,7 +261,7 @@ Each service also has a fallback user. If no token is provided, requests authent
261261
[portless](https://github.com/vercel-labs/portless) gives emulators trusted HTTPS URLs with auto-generated certs. Use the `--portless` flag to auto-register each service as a portless alias:
262262

263263
```bash
264-
emulate start --portless
264+
npx emulate start --portless
265265
# github https://github.emulate.localhost
266266
# google https://google.emulate.localhost
267267
# ...
@@ -280,9 +280,9 @@ portless github.emulate emulate start --service github
280280
For a custom base URL without portless (any reverse proxy):
281281

282282
```bash
283-
emulate start --base-url "https://{service}.myproxy.test"
283+
npx emulate start --base-url "https://{service}.myproxy.test"
284284
# or
285-
EMULATE_BASE_URL="https://{service}.myproxy.test" emulate start
285+
EMULATE_BASE_URL="https://{service}.myproxy.test" npx emulate start
286286
```
287287

288288
The `PORTLESS_URL` env var is automatically set by the `portless` CLI wrapper when running a command through it (e.g. `portless github.emulate emulate start`), typically to a value like `https://{service}.emulate.localhost`. It supports `{service}` interpolation, just like `--base-url` and `EMULATE_BASE_URL`. When no explicit `baseUrl` is provided, it is used as a fallback.

0 commit comments

Comments
 (0)