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
- The npm package ships eight packs:
generic-rest,gmail,google-drive,google-sheets,hubspot,openai,salesforceandslack. packs listalso shows the packs you can download, markedavailable.packs installdownloads a pack into~/.integration-mock/packs/. It is the onlypackscommand besidesbuild --fetch,updateandauditthat uses the network.- Only enabled packs answer calls.
Which pack answers a call
When several packs have the same id, the most specific one wins.
| Order | Layer | Where it lives |
|---|---|---|
| 1 | Snapshot | Mocks built from one real execution. Active until cleared |
| 2 | Project | ./.integration-mock/packs/ |
| 3 | User | ~/.integration-mock/packs/ |
| 4 | Library | Shipped 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

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
- Every operation becomes a route.
- Response bodies come from the spec's
example, then a namedexamplesentry, then a generated value. - Generated values are deterministic, so building twice gives identical files and a real upstream change stands out in the diff.
- A broken
$refcosts one response body, not the build. Everything skipped is named in the report.
Editing a generated pack
| File | Purpose |
|---|---|
routes/10-generated.json | Written by packs build. Do not edit it |
routes/00-overrides.json | Your 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.