Skip to content

Extract CLI into @eventcatalog/cli package#2109

Merged
boyney123 merged 1 commit intomainfrom
feat/extract-cli-package
Feb 10, 2026
Merged

Extract CLI into @eventcatalog/cli package#2109
boyney123 merged 1 commit intomainfrom
feat/extract-cli-package

Conversation

@boyney123
Copy link
Collaborator

What This PR Does

Extracts the CLI from @eventcatalog/sdk into a new standalone @eventcatalog/cli package. This gives cleaner separation of concerns — the SDK remains a pure programmatic API, while the CLI lives in its own package with its own dependencies (e.g. commander).

Changes Overview

Key Changes

  • New packages/cli/ package — contains CLI entry point, executor, list command, argument parser, and cli-docs registry
  • SDK cleanup — removed bin field, commander dependency, ./cli-docs export, and CLI source/test files from SDK
  • Updated imports — CLI now imports createSDK from @eventcatalog/sdk instead of relative ../index
  • CI/CD updatesverify-build.yml now packages and uploads the CLI artifact; turbo.json adds dependsOn: ["^build:bin"] to ensure correct build ordering
  • README updates — SDK README trimmed to SDK-only content with link to CLI; new CLI README with full CLI documentation

Packages affected

  • @eventcatalog/cli (new, minor)
  • @eventcatalog/sdk (patch — removes CLI, no API changes)

How It Works

The CLI package depends on @eventcatalog/sdk via workspace:* and re-exports the same eventcatalog binary. All CLI source files were moved with imports updated from relative SDK paths to the @eventcatalog/sdk package import. Tests were moved alongside and mock paths updated accordingly.

Turbo's build:bin task now uses dependsOn: ["^build:bin"] so workspace dependencies (SDK) always build before dependents (CLI).

Breaking Changes

  • @eventcatalog/sdk no longer provides the eventcatalog binary — users should install @eventcatalog/cli instead
  • The @eventcatalog/sdk/cli-docs export has moved to @eventcatalog/cli/cli-docs

Test Plan

  • pnpm run build:bin — all 5 packages build successfully
  • node packages/cli/dist/cli/index.js --help — shows help
  • node packages/cli/dist/cli/index.js list — lists SDK functions
  • SDK tests: 488 passed (16 files)
  • CLI tests: 22 passed (3 files)
  • @eventcatalog/cli@0.1.0 published to npm

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 38cde3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@eventcatalog/cli Minor
@eventcatalog/sdk Patch
@eventcatalog/core Patch
@eventcatalog/linter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@boyney123 boyney123 merged commit 0b35904 into main Feb 10, 2026
6 checks passed
@boyney123 boyney123 deleted the feat/extract-cli-package branch February 10, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant