Official plugins for Pacto -- the OCI-distributed contract standard for cloud-native services.
| Plugin | Description |
|---|---|
| pacto-plugin-schema-infer | Infer a JSON Schema from a sample config file (JSON, YAML, TOML) |
| pacto-plugin-openapi-infer | Auto-detect and extract OpenAPI 3.1 specs from source code (FastAPI, Huma) |
Download the binary for your platform from the
latest release
and place it in your $PATH (or $(go env GOPATH)/bin).
Install all plugins:
make installInstall a single plugin:
cd plugins/pacto-plugin-schema-infer
make installEach plugin is a standalone binary that implements the Pacto plugin protocol. Pacto invokes a plugin by running its binary, sending a JSON request on stdin, and reading a JSON response from stdout.
Request (stdin):
{
"bundleDir": "/path/to/project",
"options": {
"key": "value"
}
}Response (stdout):
{
"files": [
{ "path": "relative/output.yaml", "content": "..." }
],
"message": "Human-readable summary"
}pacto-plugins/
plugins/
pacto-plugin-schema-infer/ # Each plugin is a standalone Go module
pacto-plugin-openapi-infer/
.github/
actions/ci/ # Shared CI action
workflows/ # CI, PR, and release workflows
Makefile # Root Makefile orchestrates all plugins
make build # Build all plugins to dist/
make test # Run unit tests for all plugins
make e2e # Run e2e tests for all plugins
make coverage # Run tests with coverage for all plugins
make lint # Run linters (gofmt, go vet) for all plugins
make ci # Run full CI pipeline (lint + test + e2e)
make install # Install all plugins to $GOPATH/bin
make clean # Remove build artifacts- Create a new directory under
plugins/with a Go module - Implement the plugin protocol in
cmd/main.go - Add unit tests (target: 100% coverage on
internal/packages) - Add e2e tests in
tests/e2e/(build tag:e2e) - Add a
Makefilefollowing the existing plugins' structure - Open a PR -- CI will automatically discover and test the new plugin
CI runs automatically on PRs and pushes to main. Each plugin is discovered
dynamically and tested in a matrix job. The pipeline includes:
gofmtformatting checkgo vetstatic analysisgocyclocomplexity check (threshold: 15)golangci-lint- Unit tests
- E2E tests
- Coverage reporting to Codecov
Releases are triggered by publishing a GitHub Release. The workflow cross-compiles each plugin for 6 platform/arch combinations:
| OS | Architecture |
|---|---|
| Linux | amd64, arm64 |
| macOS | amd64, arm64 |
| Windows | amd64, arm64 |
Binaries are attached to the GitHub Release as downloadable assets.
MIT