Skip to content

LTRAC-908: feat(cli) - Add catalyst init command#3049

Draft
jorgemoya wants to merge 1 commit into
alphafrom
jorgemoya/ltrac-908-port-init-command-from-create-catalyst-into-the-catalyst-cli
Draft

LTRAC-908: feat(cli) - Add catalyst init command#3049
jorgemoya wants to merge 1 commit into
alphafrom
jorgemoya/ltrac-908-port-init-command-from-create-catalyst-into-the-catalyst-cli

Conversation

@jorgemoya

Copy link
Copy Markdown
Contributor

Linear: LTRAC-908
Part of LTRAC-138 — consolidating create-catalyst into the catalyst CLI.

What/Why?

Ports the init command from @bigcommerce/create-catalyst into the catalyst CLI so it can connect an existing Catalyst project to a BigCommerce store and channel — one of the remaining gaps in the CLI consolidation.

Rather than porting create-catalyst's bespoke Https/CliApi/Config utilities, it reuses the catalyst CLI's existing libraries:

  • Credentials: flags/env → persisted .bigcommerce/project.json (getProjectConfig) → interactive device-code login(). Credentials obtained via login are persisted so later commands (deploy, project, …) don't re-prompt.
  • Channels: fetchAvailableChannels + getChannelInit (already in lib/channels.ts).
  • Env: writes .env.local to the current working directoryinit is expected to run from inside core/, the same place dev/build/deploy run (unlike create, which scaffolds a sibling repo and targets <projectDir>/core/.env.local).

--env KEY=VALUE overrides are parsed via the existing parseEnvAssignment helper and win over channel-provided values.

Testing

pnpm test, pnpm typecheck, and pnpm lint all pass in packages/catalyst. New init.spec.ts covers credential resolution (flags, persisted config, interactive login + persistence, abort, non-abort error) and the --env merge/validation paths.

Manual: catalyst init --store-hash <h> --access-token <t> (and interactive catalyst init) connects a channel and writes .env.local.

Migration

None. Purely additive — registers a new init subcommand; create-catalyst init is unaffected (the shim removal is tracked separately in LTRAC-910).

Port the `init` command from create-catalyst into the catalyst CLI so it
connects an existing Catalyst project to a BigCommerce store and channel.
It resolves credentials from flags/env, the persisted project config, or an
interactive device-code login (persisting the result), then fetches available
channels, prompts for one, fetches its channel init data, and writes
.env.local in the current working directory.

Reuses the existing channels, login, project-config, telemetry, and
env-config libraries rather than porting create-catalyst's bespoke
Https/CliApi/Config utilities.

Refs LTRAC-908
Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Jun 15, 2026 8:35pm

Request Review

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f9ef068

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 5034ea3 (2026-06-15).

Metric Baseline Current Delta
Total JS 435.4 kB 434.5 kB -0.9 kB (-0.2%)

Per-Route First Load JS

Route Baseline Current Delta
/(default)/(auth)/change-password/page 318.8 kB 317.5 kB -1.3 kB (-0.4%)
/(default)/(auth)/login/forgot-password/page 318 kB 316.7 kB -1.3 kB (-0.4%)
/(default)/(auth)/login/page 318.4 kB 317.2 kB -1.2 kB (-0.4%)
/(default)/(auth)/register/page 354.6 kB 353.3 kB -1.3 kB (-0.4%)
/(default)/(faceted)/brand/[slug]/page 330.5 kB 329.2 kB -1.3 kB (-0.4%)
/(default)/(faceted)/category/[slug]/page 339 kB 337.6 kB -1.4 kB (-0.4%)
/(default)/(faceted)/search/page 330.5 kB 329.2 kB -1.3 kB (-0.4%)
/(default)/[...rest]/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/account/addresses/page 358 kB 356.7 kB -1.3 kB (-0.4%)
/(default)/account/orders/[id]/page 321.6 kB 320.4 kB -1.2 kB (-0.4%)
/(default)/account/orders/page 322.6 kB 321.3 kB -1.3 kB (-0.4%)
/(default)/account/settings/page 329.2 kB 327.9 kB -1.3 kB (-0.4%)
/(default)/account/wishlists/[id]/page 336.4 kB 335.3 kB -1.1 kB (-0.3%)
/(default)/account/wishlists/page 331.5 kB 330.3 kB -1.2 kB (-0.4%)
/(default)/blog/[blogId]/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/blog/page 314.5 kB 313.3 kB -1.2 kB (-0.4%)
/(default)/cart/page 334.3 kB 333.1 kB -1.2 kB (-0.4%)
/(default)/compare/page 325.7 kB 324.4 kB -1.3 kB (-0.4%)
/(default)/gift-certificates/balance/page 317.5 kB 316.2 kB -1.3 kB (-0.4%)
/(default)/gift-certificates/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/gift-certificates/purchase/page 357.1 kB 355.8 kB -1.3 kB (-0.4%)
/(default)/page 330.7 kB 329.4 kB -1.3 kB (-0.4%)
/(default)/product/[slug]/page 385.4 kB 384.2 kB -1.2 kB (-0.3%)
/(default)/webpages/[id]/contact/page 355.5 kB 354.2 kB -1.3 kB (-0.4%)
/(default)/webpages/[id]/normal/page 321.6 kB 320.4 kB -1.2 kB (-0.4%)
/(default)/wishlist/[token]/page 326.3 kB 325.2 kB -1.1 kB (-0.3%)
/maintenance/page 307.1 kB 306.4 kB -0.7 kB (-0.2%)

Threshold: 5% increase. Routes with ⚠️ exceed the threshold.

@github-actions

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 92 95

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 87 75 92
Accessibility 95 92 95 98
Best Practices 100 100 100 100
SEO 88 100 88 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.6 s 4.1 s 3.9 s 3.3 s
CLS 0.001 0 0.037 0
FCP 1.2 s 1.1 s 1.2 s 1.2 s
TBT 0 ms 0 ms 0 ms 0 ms
Max Potential FID 50 ms 40 ms 60 ms 40 ms
Time to Interactive 3.6 s 4.1 s 4.5 s 3.3 s

Full Unlighthouse report →

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