The APIFae manual
APIFae replaces the API you depend on with one you control — locally and in CI — and keeps that stand-in honest as the real API changes.
That second half is the point. Most mocking tools solve the first-day problem and
then rot: the mock is written once, the real API moves, and the tests keep passing
against a fiction. APIFae treats drift as the core problem rather than an
afterthought, which is why diff and
patch exist alongside the mock server.
It is a single native binary. There is no runtime to install first.
Start here
| If you want to | Read |
|---|---|
| Get a mock serving in the next few minutes | Getting started |
| Build against an API that does not exist yet | Mock an API before it exists |
| Catch the real API drifting away from your mocks | Keep a mock honest |
| Run that check in GitHub Actions | Check drift in CI |
| Capture a real API and replay it | Record and replay |
| Know what a recording keeps of your credentials | Secrets and redaction |
| Know what a command is for | Commands |
| Look up a flag, a default or an exit code | Reference |
| Know whether it can do the thing you need | FAQ |
| Fix an error you just hit | Troubleshooting |
What works today
Twelve commands do real work: init, up, serve, validate, status,
diff, patch, record, ca, scenario, config and report. Everything
in this manual is written against those.
Four more — login, logout, push and pull — name a hosted service that
does not exist yet. They exit non-zero with a message saying so rather than
pretending to have worked. Nothing in the local workflow needs an account; see
Commands that refuse.
Sharing a workspace with your team today means committing it to git.
Install
APIFae is distributed as a single binary for macOS, Linux and Windows.
macOS and Linux
curl -fsSL https://apifae.com/install.sh | sh
Homebrew
brew install apifae/tap/apifae
Windows, with Scoop
scoop bucket add apifae https://github.com/apifae/scoop-bucket
scoop install apifae
npm, if you would rather pin it per project than per machine:
npm install --global apifae
Then check it:
$ apifae --version
EXIT: 0
What has actually been verified
Publishing a channel and proving it installs are different claims, and APIFae keeps them apart deliberately.
Every channel above is published by a green release pipeline. Rather fewer have been installed and run on every operating system they reach, and some combinations nobody has tried at all. So try the one you need early rather than reading the list above as uniform coverage — and if it does not work, open an issue. An untried combination is exactly the one worth hearing about.
The CLI as a container image
ghcr.io/apifae/cli is a multi-arch image (linux/amd64 and linux/arm64)
carrying the same binary — not a fifth entry in the list above, because
pulling it does not put apifae on your PATH the way the four channels
above do. It exists for validate and diff in CI and in a pre-commit hook,
where "run this without installing anything but Docker" is the point:
$ docker run --rm -v "$PWD":/work ghcr.io/apifae/cli validate
It is not built for up: the image sets no host of its own, so a server
started inside it is reachable from outside the container only if the
mounted workspace's own config binds 0.0.0.0. See Check drift in
CI for
the pre-commit hook that runs this image directly.