Commands for discovering, adding, inspecting, and removing API dependencies.
Search the canonical repository catalog for APIs.
apx search [query]Without a query, lists all APIs in the catalog.
| Flag | Shorthand | Type | Default | Description |
|---|---|---|---|---|
--format |
-f |
string | "" |
Filter by schema format (proto, openapi, avro, etc.) |
--lifecycle |
-l |
string | "" |
Filter by lifecycle state |
--domain |
-d |
string | "" |
Filter by domain |
--api-line |
string | "" |
Filter by API line (v1, v2, etc.) | |
--origin |
string | "" |
Filter by origin (first-party, external, forked) | |
--tag |
string | "" |
Filter by tag | |
--catalog |
-c |
string | (see below) | Path or URL to catalog file (default: catalog_url from apx.yaml, then catalog/catalog.yaml) |
# Search by keyword
apx search payments
# Filter by format and lifecycle
apx search --format proto --lifecycle stable
# Filter by domain
apx search --domain billing
# JSON output
apx --json search payments
# List all APIs
apx searchDisplay full identity and catalog data for a specific API.
apx show <api-id>Merges two data sources:
- Derived fields — Go module/import paths, tag pattern, source path (computed from the API ID)
- Catalog fields — latest stable/prerelease versions, lifecycle, owners (from
catalog/catalog.yaml)
| Flag | Type | Default | Description |
|---|---|---|---|
--source-repo |
string | "" |
Source repository (defaults from apx.yaml) |
--catalog |
string | (see search) | Path or URL to catalog file (default: catalog_url from apx.yaml, then catalog/catalog.yaml) |
$ apx show proto/payments/ledger/v1
API: proto/payments/ledger/v1
Format: proto
Domain: payments
Name: ledger
Line: v1
Source: github.com/acme-corp/apis/proto/payments/ledger/v1
Go module: github.com/acme-corp/apis/proto/payments/ledger
Go import: github.com/acme-corp/apis/proto/payments/ledger/v1
Tag pattern: proto/payments/ledger/v1/v*
Lifecycle: stable
Latest: v1.2.3
$ apx --json show proto/payments/ledger/v1Add a schema dependency to apx.yaml and apx.lock.
apx add <module-path>[@version]The @version suffix is optional. If omitted, the latest version is used.
| Flag | Shorthand | Type | Default | Description |
|---|---|---|---|---|
--catalog |
-c |
string | (see search) | Path or URL to catalog file (default: catalog_url from apx.yaml, then catalog/catalog.yaml) |
The catalog is consulted to detect external API provenance (origin, managed repo, import mode). If the catalog cannot be loaded, the dependency is still added without provenance metadata.
# Add at a specific version
apx add proto/payments/ledger/v1@v1.2.3
# Add latest version
apx add proto/users/profile/v1
# Add using a remote catalog
apx add proto/payments/ledger/v1 --catalog https://raw.githubusercontent.com/acme/apis/main/catalog/catalog.yamlAfter adding, generate code:
apx gen go && apx syncActivate locally generated overlays in each language's package manager.
apx sync [language] [module-path]Without a language argument, all supported languages are synced. Use --clean to reverse the activation without deleting the generated code.
| Language | Activate (sync) |
Deactivate (sync --clean) |
|---|---|---|
| Go | Updates go.work with all Go overlay paths |
Writes a minimal go.work with only the root module |
| Python | Runs pip install -e for each overlay |
Runs pip uninstall for each overlay |
| Flag | Type | Default | Description |
|---|---|---|---|
--clean |
bool | false |
Deactivate overlays from package managers |
--dry-run |
bool | false |
Show what would be done without making changes |
# Activate all languages
apx sync
# Activate only Go overlays
apx sync go
# Activate only Python overlays (requires active virtualenv)
apx sync python
# Activate a specific Python overlay
apx sync python proto/payments/ledger/v1
# Deactivate all languages
apx sync --clean
# Deactivate only Python
apx sync --clean python- For Python: a virtualenv must be active (
VIRTUAL_ENVenv var set) and overlays scaffolded (apx gen python) - For Go: overlays generated (
apx gen go); Go'sPostGenhook callsapx sync goautomatically after generation
Remove a local overlay and switch to the published module.
apx unlink <module-path>- Removes the dependency from
apx.lock - Deletes the overlay directory from
internal/gen/(all languages) - Prints hints for consuming the released module:
- Go:
go get github.com/<org>/apis/<module-path> - Python:
pip install <org>-<domain>-<api>-<line>
- Go:
apx unlink proto/payments/ledger/v1
# → Removed overlay for proto/payments/ledger/v1
# → Run: go get github.com/acme-corp/apis/proto/payments/ledger@v1.2.3
# → Python: Run 'pip install acme-payments-ledger-v1' to install the released packageYour import paths remain unchanged — they now resolve to the published module instead of the local overlay.
Check for compatible (same API line) updates and apply them.
apx update [module-path]Without arguments, checks all dependencies. With a module path, updates only that dependency.
| Flag | Shorthand | Type | Default | Description |
|---|---|---|---|---|
--dry-run |
bool | false |
Preview updates without applying them | |
--catalog |
-c |
string | (see search) | Path or URL to catalog file (default: catalog_url from apx.yaml, then catalog/catalog.yaml) |
# Check and apply all compatible updates
apx update
# Update a specific dependency
apx update proto/payments/ledger/v1
# Preview what would be updated
apx update --dry-run
# JSON output
apx --json updateAfter updating, regenerate code:
apx gen go && apx syncUpgrade a dependency to a new API line (major version transition).
apx upgrade <module-path> --to <line>| Flag | Type | Default | Description |
|---|---|---|---|
--to |
string | (required) | Target API line (e.g. v2) |
--dry-run |
bool | false |
Preview upgrade without applying |
--catalog |
string | (see search) | Path or URL to catalog file (default: catalog_url from apx.yaml, then catalog/catalog.yaml) |
# Upgrade from v1 to v2
apx upgrade proto/payments/ledger/v1 --to v2
# Preview the upgrade plan
apx upgrade proto/payments/ledger/v1 --to v2 --dry-run
# JSON output for CI
apx --json upgrade proto/payments/ledger/v1 --to v2 --dry-runAfter upgrading:
- Regenerate code:
apx gen go && apx sync - Update import paths in your code (the command prints the mapping)
- Run
apx breakingto inspect breaking changes
# 1. Discover available APIs
apx search payments
# 2. Inspect details
apx show proto/payments/ledger/v1
# 3. Add as dependency
apx add proto/payments/ledger/v1@v1.2.3
# 4. Generate client code and activate overlays
apx gen go # generates Go bindings, updates go.work automatically
apx gen python # generates Python package
apx sync python # pip install -e (requires active virtualenv)
# 5. Use canonical imports in your code
# import ledgerv1 "github.com/acme-corp/apis/proto/payments/ledger/v1"
# 6. When ready to consume published module
apx unlink proto/payments/ledger/v1
go get github.com/acme-corp/apis/proto/payments/ledger@v1.2.3- Adding Dependencies — detailed guide
- Discovery — search and show details
- Code Generation — generating client code