Skip to main content

Federation CLI reference

View as Markdown

Run Federation from the central catalog directory:

npx eventcatalog federate

The command loads federation.sources and federation.rules from eventcatalog.config.js.

Requirements

  • A central EventCatalog project
  • An EventCatalog Enterprise license key
  • At least one configured source, unless you are cleaning previous output
  • Git for GitHub sources that do not publish an index
  • Network and repository access for GitHub sources

Options

OptionDescriptionDefault
--no-cacheDisable content cache reads for this run and refresh fetched entries.Reuse valid cached content
--verbose, -vShow the attributes for warning diagnostics. Error attributes are always shown.Concise warning summary
--help, -hShow command help.

Examples

Run Federation:

npx eventcatalog federate

Show every warning:

npx eventcatalog federate --verbose

Refresh content without reading existing cache entries:

npx eventcatalog federate --no-cache

Pass options through an npm script:

npm run federate -- --verbose

Select local sources through a configuration environment variable:

EVENTCATALOG_FEDERATION_LOCAL=true npx eventcatalog federate

EVENTCATALOG_FEDERATION_LOCAL is not a built-in Federation variable. It is an example of using your own environment variable inside eventcatalog.config.js.

Environment variables

VariableDescription
EVENTCATALOG_SCALE_LICENSE_KEYLicense key used to enable Federation.
EVENTCATALOG_GITHUB_TOKENPreferred GitHub token for private repositories and authenticated content requests.
GITHUB_TOKENGitHub token fallback when EVENTCATALOG_GITHUB_TOKEN is not set.

The command loads variables from .env in the central catalog before Federation starts.

Command stages

The command reports progress for:

  1. Configured source discovery
  2. Source fetching and indexing
  3. Central catalog ownership indexing
  4. Graph resolution and diagnostics
  5. Content hydration and cache reuse
  6. Public asset composition
  7. Lockfile recording

Warning and error output

Without --verbose, warnings produce a summary and a hint to rerun with verbose output.

With --verbose, each diagnostic includes:

  • Severity
  • Human-readable message
  • Stable federation/* rule ID
  • Rule-specific attributes

Errors always include their details and stop before new generated output is installed.

No configured sources

When no sources are configured and no previous Federation state exists, the command reports that there is nothing to do.

When previous output exists, running with an empty source list removes the previous federated/ output, managed public files, and lockfile.

Generated files

A successful run can update:

  • federated/
  • public/ for managed remote public assets
  • .eventcatalog-cache/federation/content/
  • eventcatalog.lock

See Generated output reference.