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 offline license file
  • 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

Place the Enterprise license.jwt file in the central catalog root. You can commit it with the catalog or write it during CI/CD. If you store it elsewhere, set EC_LICENSE to its file path. Email hello@eventcatalog.dev to request an offline trial key.

VariableDescription
EC_LICENSEOptional path to the Enterprise offline license file. Defaults to license.jwt in the catalog root.
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.