apx is a cross-platform CLI tool that orchestrates API schema management, validation, and publishing. It provides a unified interface for working with Protocol Buffers, OpenAPI, Avro, JSON Schema, and Parquet schemas while enforcing organizational policies and automating semantic versioning.
- π Multi-format support: Protocol Buffers, OpenAPI, Avro, JSON Schema, Parquet
- π Schema validation: Lint and validate schemas using industry-standard tools
- π₯ Breaking change detection: Automatically detect breaking changes and suggest semantic version bumps
- ποΈ Code generation: Generate Go, Python, and Java code from schemas
- π Policy enforcement: Enforce organizational policies and allowed plugins
- π·οΈ Git integration: Create subdirectory tags for modular releases
- π³ Container support: Run tools locally or in containers
- π Rich output: Human-friendly CLI output with optional JSON for automation
brew install infobloxopen/tap/apxDownload the latest release from GitHub Releases for your platform.
go install github.com/infobloxopen/apx/cmd/apx@latestInstall required external tools:
curl -sSL https://raw.githubusercontent.com/infobloxopen/apx/main/scripts/install-tools.sh | bashOr manually install:
- buf - Protocol Buffer tooling
- spectral - OpenAPI linting
- oasdiff - OpenAPI diff tool
- protoc - Protocol Buffer compiler
apx config initThis creates an apx.yaml configuration file with sensible defaults.
# Initialize a new schema module
apx init proto payment/v1
# Lint schemas
apx lint
# Check for breaking changes
apx breaking --against main
# Generate code
apx gen go
apx gen python
apx gen java
# Check policy compliance
apx policy check
# Suggest semantic version bump
apx semver suggest --against v1.0.0
# Publish a release (CI only by default)
apx publish --version v1.1.0--config <file>: Specify config file (default:apx.yaml)--verbose: Enable verbose output--quiet: Suppress output--json: Output in JSON format--no-color: Disable colored output
The apx.yaml file controls all behavior:
version: 1
org: your-org-name
repo: your-apis-repo
module_roots:
- proto
- openapi
- avro
- jsonschema
- parquet
language_targets:
go:
enabled: true
plugins:
- name: protoc-gen-go
version: v1.64.0
- name: protoc-gen-go-grpc
version: v1.5.0
policy:
forbidden_proto_options:
- "^gorm\\."
allowed_proto_plugins:
- protoc-gen-go
- protoc-gen-go-grpc
publishing:
tag_format: "{subdir}/v{version}"
ci_only: true
tools:
buf:
version: v1.45.0
spectral:
version: v6.11.0
execution:
mode: "local" # or "container"See apx.example.yaml for a complete configuration reference.
Initialize a new schema module.
Kinds: proto, openapi, avro, jsonschema, parquet
# Create a new protobuf module
apx init proto payment/ledger/v1
# Create an OpenAPI module
apx init openapi user/v2Lint and validate schema files.
# Lint current directory
apx lint
# Lint specific path
apx lint proto/payment/v1
# JSON output for CI
apx lint --jsonCheck for breaking changes against a Git reference.
# Check against main branch
apx breaking --against main
# Check against specific tag
apx breaking --against v1.0.0
# Check specific module
apx breaking --against main proto/payment/v1Suggest semantic version bump based on changes.
# Get version suggestion
apx semver suggest --against v1.0.0
# Output: MAJOR (due to breaking changes)Generate code for the specified language.
# Generate Go code
apx gen go --out ./gen/go
# Clean output before generation
apx gen python --clean --out ./gen/python
# Generate with manifest
apx gen java --manifestLanguages: go, python, java
Check policy compliance.
# Check all modules
apx policy check
# Check specific path
apx policy check proto/payment/v1Build a catalog of all discovered modules.
apx catalog build
# Creates catalog.jsonPublish a module release.
# Publish with version (CI only by default)
apx publish --version v1.2.3
# Create tag only
apx publish --version v1.2.3 --tag-only
# Force local publish
apx publish --version v1.2.3 --forceConfiguration management.
# Initialize config
apx config init
# Validate config
apx config validateAPX automatically discovers schema modules by scanning configured module_roots for:
- Protocol Buffers:
*.protofiles - OpenAPI:
openapi.{yaml,yml,json}files - Avro:
*.avscfiles - JSON Schema: Files with
$schemaproperty - Parquet:
schema.{json,ddl}files
APX uses industry-standard tools to detect breaking changes:
- Protocol Buffers:
buf breaking - OpenAPI:
oasdiff breaking - Avro: Compatibility mode validation
- JSON Schema:
jsonschema-diff - Parquet: Conservative policy checks
APX automatically suggests version bumps based on detected changes:
- MAJOR: Any breaking changes in any format
- MINOR: New features, additive changes
- PATCH: Bug fixes, documentation updates
Enforce organizational standards:
policy:
forbidden_proto_options:
- "^gorm\\." # Ban GORM options
- "validate\\." # Ban validation options
allowed_proto_plugins:
- protoc-gen-go
- protoc-gen-go-grpc
openapi:
spectral_ruleset: ".spectral.yaml"
avro:
compatibility: "BACKWARD"APX creates subdirectory tags for modular repositories:
# Creates tag: proto/payment/v1/v1.2.3
apx publish --version v1.2.3 proto/payment/v1Tag format is configurable via publishing.tag_format.
name: API Schema CI
on:
pull_request:
paths:
- 'proto/**'
- 'openapi/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
- name: Install APX
run: go install github.com/infobloxopen/apx/cmd/apx@latest
- name: Install Tools
run: |
curl -sSL https://raw.githubusercontent.com/infobloxopen/apx/main/scripts/install-tools.sh | bash
- name: Lint Schemas
run: apx lint --json
- name: Check Breaking Changes
run: apx breaking --against origin/main --json
- name: Check Policy
run: apx policy check --json
publish:
if: github.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
- name: Install APX
run: go install github.com/infobloxopen/apx/cmd/apx@latest
- name: Get Version Suggestion
id: version
run: |
VERSION=$(apx semver suggest --against $(git describe --tags --abbrev=0))
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Publish Release
if: steps.version.outputs.version != 'NONE'
run: |
apx publish --version v$(steps.version.outputs.version)
env:
CI: true0: Success2: Lint errors3: Breaking changes detected4: Policy violations5: Tool execution failure6: Configuration error
make buildmake test
make test-integrationSee CONTRIBUTING.md for development guidelines.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
- π Documentation
- π Issues
- π¬ Discussions