Skip to main content

pull

Pull event specs from a remote git registry into a local cache.

Synopsis​

event-spec pull [flags]

Flags​

FlagDefaultDescription
--forcefalseRe-clone the remote repository even if a local cache already exists
--ref""Check out this ref instead of the configured one — a commit SHA, a tag, or a branch name, resolved against the remote (overrides both registry.ref and registry.branch in the workspace config)

Usage​

Configure the git registry in event-spec.yaml:

event-spec.yaml
version: 1
workspace: "my-company"
registry:
mode: git
remote: https://github.com/my-org/analytics-specs.git
branch: main
specs_dir: ./specs

Then pull the remote specs:

event-spec pull

The CLI clones or fetches the remote repository into a local cache directory and indexes the spec files. The progress line names the ref the pull will check out, which is registry.ref when set and registry.branch otherwise.

To pin the cache to an exact commit or tag instead of following a branch, set registry.ref — see Registry — Git.

After pulling​

Once specs are cached locally, all other CLI commands work against the local cache:

event-spec pull # sync with remote
event-spec validate # validate against cached specs
event-spec generate web-app # generate using cached specs
event-spec diff ecommerce/product_viewed # diff cached versions

Version pinning​

Source configs can pin a specific git ref:

sources/web-app.yaml
version_pinning:
ecommerce/product_viewed: "1-0-0"

Events pinned to a specific version are generated with that version regardless of what's latest in the registry.

See also​