Packs

A pack is the mock of one service. It holds the routes the service answers and the response for each.

Shipped and available packs

integration-mock packs list
integration-mock packs install notion
integration-mock packs enable notion

Which pack answers a call

When several packs have the same id, the most specific one wins.

OrderLayerWhere it lives
1SnapshotMocks built from one real execution. Active until cleared
2Project./.integration-mock/packs/
3User~/.integration-mock/packs/
4LibraryShipped in the package

If no route matches, the mock answers 501 with a hint. It never calls the real service and never returns empty data.

{
  "error": "integration-mock: no route",
  "service": "slack",
  "method": "GET",
  "path": "/nope",
  "hint": "run `integration-mock record` or add to ./.integration-mock/packs/slack"
}

Writing a pack by hand

Use this for a service that has no pack and publishes no OpenAPI file.

integration-mock packs init acme --domain api.acme.com
integration-mock packs validate acme
integration-mock packs enable acme
curl http://127.0.0.1:8080/acme/example

Writing a pack in four commands: init, the generated routes file, validate, curl

packs init writes a working route and a 404 route, so both shapes are there to copy. A pack created while the mock is running is served as soon as you enable it.

This creates:

.integration-mock/
└── packs/
    └── acme/
        ├── pack.json          id, domains, prefix, source
        └── routes/
            └── main.json      routes; files in routes/ are merged in file-name order

With an AI agent

skills/integration-mock-author-pack/SKILL.md is an agent skill that writes a pack from a service's documentation. The agent writes the files and packs validate --json tells it what is wrong. integration-mock itself never calls a model.

Generating a pack from OpenAPI

integration-mock packs build acme --spec ./acme-openapi.json   # OpenAPI 3.x or Swagger 2
integration-mock packs build stripe --fetch                    # download the spec listed in sources.yaml

Editing a generated pack

FilePurpose
routes/10-generated.jsonWritten by packs build. Do not edit it
routes/00-overrides.jsonYour fixes. It sorts first, so it wins

To edit a shipped pack, copy it into your project first:

integration-mock packs eject slack

Downloaded specs are cached under ~/.integration-mock/vendor-specs/, so a rebuild works offline.