Getting Started

Your first mock in 5 minutes

No config files needed. You will install the CLI, open the UI, create a mock, and hit it with a real HTTP request.

1. Install the CLI

You need Node.js 20.19 or newer. Install the CLI globally with npm:

$npm install -g @mocko/cli

2. Start Mocko

$mocko

A folder argument is optional. Use mocko ./ if you also want to load file mocks from the current directory. Without a folder, Mocko starts with no pre-loaded file mocks.

Mocks created in the UI are temporary: they reset when Mocko stops unless you run with Redis. For repeatable project behavior, move mocks into files with file mocks.

3. Open the UI

Mocko opens at http://localhost:6625. Click New mock and fill in:

  • Method: GET
  • Path: /hello
  • Response body: Hello from Mocko!
Mocko control panel with the new mock form filled in: method GET, path /hello, and a plain text response body

4. Test it

$curl http://localhost:8080/hello
Hello from Mocko!

5. Move repeatable mocks to files

The UI is ideal for quick experiments. Once a mock becomes part of your development workflow, define it as a file mock so it can live with your project, run in CI, and be reviewed like any other change.

If you work with a coding agent, it can write the files for you: install the Mocko skill from Coding Agents.

What's next?

Move to file mocks

Keep mocks with your project so they can be reviewed and versioned.

Open guide

Create from the UI

Learn the control panel workflow for quick local experiments.

Open guide

Use recipes

Copy patterns for state, proxying, fixtures, and failures.

Open guide

Set up your coding agent

Install the Mocko skill so your agent can write and debug mocks.

Open guide