Production-ready Go CLI for Apicurio Registry 3.x with semantic versioning, batch operations, and multi-API support.
- Multi-API Support - V2, V3, and Confluent-compatible (CCOMPAT) APIs
- Official SDK - Uses Apicurio Registry Go SDK with Kiota framework
- Semantic Versioning - Automatic version calculation based on schema changes
- Batch Operations - Process multiple schemas with parallel workers
- AsyncAPI Support - Register AsyncAPI documents with schema references (V3 only)
- Multiple Output Formats - JSON, table, summary, and markdown reports
- Authentication - None, Basic Auth, and OIDC (Keycloak)
- TLS/HTTPS - Full TLS 1.2+ support with certificate validation
- Enhanced Error Handling - Clear timeout detection and detailed API error messages
# Build
make build
# Get registry information
./bin/apicurio-client info --registry-url http://localhost:8081
# Register a schema
./bin/apicurio-client register \
--registry-url http://localhost:8081 \
--file schema.avsc
# Validate schema compatibility
./bin/apicurio-client validate \
--registry-url http://localhost:8081 \
--file schema-v2.avsc
# Batch validate multiple schemas
./bin/apicurio-client batch validate \
--registry-url http://localhost:8081 \
--dir ./schemas \
--format summary
# Register AsyncAPI document (V3 only)
./bin/apicurio-client asyncapi register \
--registry-url http://localhost:8081 \
--api-version v3 \
--file asyncapi.yaml
# Get dereferenced AsyncAPI document (V3 only)
./bin/apicurio-client asyncapi get \
--registry-url http://localhost:8081 \
--api-version v3 \
--group com.example \
--artifact-id my-apiGet registry system information and health status.
./bin/apicurio-client info \
--registry-url http://localhost:8081 \
--format markdownRegister a new schema or create a new version.
./bin/apicurio-client register \
--registry-url http://localhost:8081 \
--api-version v3 \
--file schema.avsc \
--format tableFlags:
--dry-run- Preview registration without actually registering--skip-validation- Skip validation before registration--format- Output format: json, table, summary, markdown--labels(alias--label) - Labels to attach to the created version askey=value. Repeatable and comma-separated forms are equivalent (--labels a=1 --labels b=2or--labels a=1,b=2). Values may contain=(split on the first=only); an empty value (key=) is allowed. Requires--api-version v3. Labels are applied only when a new version is created; re-registering unchanged content leaves the existing version's labels untouched. Applied labels appear in JSON output.
./bin/apicurio-client register \
--registry-url http://localhost:8081 \
--api-version v3 \
--file schema.avsc \
--labels bundleVersion=1.2.0 --labels gitTag=v1.2.0 --labels gitSha=abc1234Validate schema compatibility without registration (dry-run validation).
./bin/apicurio-client validate \
--registry-url http://localhost:8081 \
--file schema.avsc \
--format summaryRetrieve the latest version of a schema.
./bin/apicurio-client latest \
--registry-url http://localhost:8081 \
--namespace com.example \
--name UserValidate multiple schemas in a directory.
./bin/apicurio-client batch validate \
--registry-url http://localhost:8081 \
--dir ./schemas \
--pattern "*.avsc" \
--parallel 4 \
--format summaryFlags:
--dir- Directory to scan (default: current directory)--pattern- File pattern (default:*.avsc)--recursive- Scan subdirectories (default: true)--parallel- Number of parallel workers (default: 4)--continue-on-error- Continue processing on failures
Register multiple schemas to the registry.
./bin/apicurio-client batch register \
--registry-url http://localhost:8081 \
--dir ./schemas \
--dry-runAttach release provenance labels to every version created by the run (V3 only). The same labels apply to all schemas in the batch and are written only to newly created versions:
./bin/apicurio-client batch register \
--registry-url http://localhost:8081 \
--api-version v3 \
--dir ./schemas \
--labels bundleVersion=1.2.0 --labels gitTag=v1.2.0 --labels gitSha=abc1234Flags: in addition to the shared batch flags, supports --skip-validation,
--fail-on-error, and --labels/--label (see register).
Validate an AsyncAPI document against the registry (V3 only).
./bin/apicurio-client asyncapi validate \
--registry-url http://localhost:8081 \
--api-version v3 \
--file asyncapi.yamlRegister an AsyncAPI document with schema references (V3 only).
./bin/apicurio-client asyncapi register \
--registry-url http://localhost:8081 \
--api-version v3 \
--file asyncapi.yamlFlags:
--version- Override version from document--skip-validation- Skip validation before registration
Retrieve a dereferenced AsyncAPI document from the registry (V3 only).
./bin/apicurio-client asyncapi get \
--registry-url http://localhost:8081 \
--api-version v3 \
--group com.example \
--artifact-id my-apiFlags:
--version- Version to retrieve (default: branch=latest)--format- Output format: json, yaml (default: yaml)--no-fix- Disable automatic Avro schema wrapping fix
All commands support multiple output formats via the --format flag:
JSON (default) - Machine-readable structured output
./bin/apicurio-client register --file schema.avsc --format jsonTable - Human-readable formatted table
./bin/apicurio-client register --file schema.avsc --format tableSummary - Concise single-line output
./bin/apicurio-client register --file schema.avsc --format summaryMarkdown - Professional markdown reports
./bin/apicurio-client register --file schema.avsc --format markdown -o report.mdConfiguration priority: CLI flags > Environment variables > Config file
Create ~/.apicurio-client.yaml:
registry_url: http://localhost:8081
api_version: v3
# Authentication
auth: oidc
keycloak_url: https://keycloak.example.com
client_id: apicurio-client
client_secret: your-secret
realm: apicurio
# TLS
insecure: false# Connection
export APICURIO_REGISTRY_URL=http://localhost:8081
export APICURIO_API_VERSION=v3
# Schema defaults
export APICURIO_GROUP=default
export APICURIO_ARTIFACT_ID=MySchema
# Basic auth
export APICURIO_AUTH=basic
export APICURIO_USERNAME=admin
export APICURIO_PASSWORD=secret
# OIDC auth
export APICURIO_AUTH=oidc
export APICURIO_KEYCLOAK_URL=https://keycloak.example.com
export APICURIO_CLIENT_ID=apicurio-client
export APICURIO_CLIENT_SECRET=your-secret
export APICURIO_REALM=apicurio
# TLS
export APICURIO_INSECURE=true
# Logging
export APICURIO_VERBOSE=true
export APICURIO_DEBUG=true./bin/apicurio-client register \
--auth basic \
--username admin \
--password secret \
--file schema.avsc./bin/apicurio-client register \
--auth oidc \
--keycloak-url https://keycloak.example.com \
--client-id apicurio-client \
--client-secret your-secret \
--realm apicurio \
--file schema.avscSelect API version with --api-version flag:
- v2 (default) - Stable, production-ready, official SDK
- v3 - Latest features, improved API structure, official SDK
- ccompat - Confluent Schema Registry compatibility
# V3 API
./bin/apicurio-client register --api-version v3 --file schema.avsc
# CCOMPAT API
./bin/apicurio-client register --api-version ccompat --file schema.avscAvro schemas must include:
namespace- Schema namespace (e.g., "com.example")name- Schema name (e.g., "User")version- Semantic version (e.g., "1.0.0")
Example:
{
"type": "record",
"namespace": "com.example",
"name": "User",
"version": "1.0.0",
"fields": [
{"name": "id", "type": "string"},
{"name": "email", "type": ["null", "string"], "default": null}
]
}Version bumps are calculated automatically based on changes:
| Change Type | Example | Version Bump |
|---|---|---|
| Patch | Doc updates, metadata | 1.0.0 → 1.0.1 |
| Minor | Add optional field | 1.0.0 → 1.1.0 |
| Major | Remove field, change type | 1.0.0 → 2.0.0 |
The validate command detects version mismatches and suggests corrections.
apicurio-client/
├── cmd/apicurio-client/ # Entry point
│ └── main.go
├── internal/
│ ├── cli/ # Cobra commands (register, validate, info, batch, asyncapi)
│ ├── operations/ # Business logic (registration, validation)
│ ├── registry/ # Registry clients (V2, V3, CCOMPAT)
│ ├── schema/ # Avro schema parsing, diffing, versioning
│ ├── asyncapi/ # AsyncAPI document parsing and validation
│ ├── batch/ # Batch processing with parallel workers
│ ├── output/ # Output formatters (JSON, table, markdown)
│ ├── templates/ # Embedded markdown templates
│ ├── config/ # Configuration management
│ ├── logger/ # Logging
│ └── auth/ # Authentication (Basic, OIDC)
├── Makefile # Build and CI targets
├── Dockerfile # Container image
└── .github/workflows/ # CI/CD pipelines
Enhanced error messages with context and timeout detection:
Timeout errors:
[ERROR] failed to create artifact: operation timed out after exceeding context deadline (group=default, artifactId=User)
API errors:
[ERROR] failed to create artifact: HTTP 409 - Conflict: Artifact already exists (group=default, artifactId=User)
Network errors:
[ERROR] failed to create artifact: network timeout error (group=default, artifactId=User)
For self-signed certificates:
./bin/apicurio-client register --insecure --registry-url https://... --file schema.avscOr in config:
insecure: true# Download dependencies
go mod download
# Build
make build
# Run tests
make test
# Run linting
make lint
# Run all CI checks
make ci
# Build for all platforms
make build-allAutomated workflows included:
- CI: Linting, testing, building (Linux, macOS, Windows)
- Release: Multi-platform binaries, checksums, Docker images
Create release:
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0github.com/apicurio/apicurio-registry/go-sdk/v3- Official Apicurio SDKgithub.com/microsoft/kiota-abstractions-go- Kiota frameworkgithub.com/spf13/cobra- CLI frameworkgithub.com/spf13/viper- Configuration managementgithub.com/Masterminds/semver/v3- Semantic versioninggolang.org/x/oauth2- OAuth2/OIDC authenticationgopkg.in/yaml.v3- YAML parsing (AsyncAPI)
MIT License - see LICENSE for details.