specter は軽量なモック API サーバーです。エンドポイントを YAML で定義して、すぐに起動できます。
- Hot reload:
config.ymlを編集すると変更がすぐ反映されます - Response templates、faker、stateful mocking、rate limiting に対応
- 単一バイナリで動作し、追加のランタイム依存はありません
Docker
docker run -v $(pwd)/config.yml:/config.yml ghcr.io/saku0512/specter -c /config.ymlHomebrew (macOS / Linux)
brew tap Saku0512/specter https://github.com/Saku0512/specter
brew install spectercurl (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/Saku0512/specter/main/install.sh | bashPowerShell (Windows)
irm https://raw.githubusercontent.com/Saku0512/specter/main/install.ps1 | iexリリースには SHA256SUMS.txt と SPDX JSON SBOM が添付されます。install.sh と install.ps1 は、バイナリを配置する前に SHA256 を検証します。
手動で確認する場合:
VERSION=v1.0.1
ASSET=specter_linux_amd64
curl -LO "https://github.com/Saku0512/specter/releases/download/${VERSION}/${ASSET}"
curl -LO "https://github.com/Saku0512/specter/releases/download/${VERSION}/SHA256SUMS.txt"
grep " ${ASSET}$" SHA256SUMS.txt | sha256sum --check -
gh attestation verify "${ASSET}" --repo Saku0512/specterspecter init # config.yml を生成
specter init --template crud # CRUD スターターを生成
specter examples # サンプル設定を一覧表示
specter doctor -c config.yml # 設定・参照ファイル・ポートを診断
specter -c config.yml # サーバーを起動routes:
- path: /users
method: GET
response:
- id: 1
name: Aliceこの設定で GET /users にアクセスすると、YAML に書いたレスポンスが返ります。
- Config reference — routes、matching、templates、faker、state、rate limiting など
- Examples gallery — auth、CRUD、pagination、GraphQL、webhook、SSE、OpenAPI など
- Comparison guide — json-server、Prism、WireMock との違い
- JSON Schema — エディタ補完・validation 用 schema
- VS Code Extension — Specter config の補完と inline validation
- CLI reference — flags、env vars、
init/examples/gen/validate/doctor/record - Introspection API —
/__specter/requests、/__specter/state
動作する設定例は config.example.yml を見てください。
通常のテストは make test で実行できます。Go fuzzing をローカルで回す場合は次を使います。
make fuzz
FUZZTIME=30s make fuzzfuzz target は config YAML parser と request matcher をインメモリで検証するため、ネットワークアクセスは不要です。
MIT