Skip to content

feat(cli): add domains claim command for cross-store domain ownership#3084

Open
jorgemoya wants to merge 1 commit into
canaryfrom
jorgemoya/ltrac-1106-implement-domain-claiming-functionality-in-the-cli
Open

feat(cli): add domains claim command for cross-store domain ownership#3084
jorgemoya wants to merge 1 commit into
canaryfrom
jorgemoya/ltrac-1106-implement-domain-claiming-functionality-in-the-cli

Conversation

@jorgemoya

Copy link
Copy Markdown
Contributor

Linear: LTRAC-1106

What/Why?

The catalyst domains claim command was missed from the initial Native Hosting CLI work. It lets a user claim ownership of a custom domain that is already in use on another store/project — publish the ownership-verification TXT record, then run claim to release the domain from the other store and bind it to the current project (POST .../projects/{project_uuid}/domains/{domain}/claim).

The Domains API returns the TXT record to publish in the meta.ownership_verification field of a cross-store collision. Rather than let it surface as an opaque error, it's parsed into a typed DomainOwnershipVerificationError so:

  • domains add — on a 409 cross-store collision, prints the TXT record plus Then run: catalyst domains claim <domain>.
  • domains claim — on a 422 not-yet-verified claim, reprints the TXT record so the user can publish it and retry.

claim mirrors add/status: after a successful claim it shows the domain status, and --wait polls until the domain leaves pending verification.

Docs (CLI reference + native-hosting getting-started) are updated in a separate docs-v2 change.

Testing

pnpm --filter @bigcommerce/catalyst test src/cli/commands/domains.spec.ts (31 passing), plus pnpm typecheck and pnpm lint. New coverage: claimDomain success + 422 verification error, the claim command (success, unverified TXT reprint, --wait), and the add cross-store collision path. Verified catalyst domains claim --help on the built CLI.

Migration

None.

Add `catalyst domains claim <domain>` so users can claim ownership of a
custom domain that is already in use on another store. Publishing the
ownership-verification TXT record and then claiming releases the domain
from the other store and binds it to the current project.

The Domains API returns the TXT record in the `meta.ownership_verification`
field of a cross-store collision. Surface it as a typed
DomainOwnershipVerificationError so both `domains add` (on a 409 collision)
and `domains claim` (on a 422 unverified claim) print the record and the
next step instead of an opaque error.

Refs LTRAC-1106
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jorgemoya jorgemoya requested a review from a team as a code owner July 7, 2026 18:57
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6d780bc

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

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst Minor

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

@vercel

vercel Bot commented Jul 7, 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 Jul 7, 2026 6:57pm

Request Review

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from c6b3b07 (2026-07-07).

No bundle size changes detected.

@github-actions

github-actions Bot commented Jul 7, 2026

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 80 86 76 89
Accessibility 95 98 95 92
Best Practices 100 100 100 100
SEO 88 88 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.2 s 4.2 s 3.6 s 3.8 s
CLS 0.001 0 0.001 0
FCP 1.1 s 1.2 s 1.2 s 1.1 s
TBT 0 ms 0 ms 30 ms 20 ms
Max Potential FID 50 ms 50 ms 90 ms 90 ms
Time to Interactive 3.2 s 4.2 s 5.9 s 4.3 s

Full Unlighthouse report →

@jorgemoya

Copy link
Copy Markdown
Contributor Author

Testing

❯ node ../packages/catalyst/dist/cli.js domains claim www.jorgemoya.dev --api-host api.staging.zone
◢ @bigcommerce/catalyst v1.0.0                                                                                                                           3:26:54 PM

◐ Claiming domain www.jorgemoya.dev...                                                                                                                   3:26:54 PM

 ERROR  The domain is not bound to any project. Add it with the create endpoint instead. (domain: 'www.jorgemoya.dev' is not bound to any project.)      3:26:55 PM

ℹ Correlation ID: 99081c9d-3088-4b58-ac25-a259cfed883c                                                                                                  3:26:55 PM
Share this Correlation ID with BigCommerce support.
~/dev/catalyst/core on  jorgemoya/ltrac-1106-implement-domain-claiming-functionality-in-the-cli [✘!?] took 3s
❯ node ../packages/catalyst/dist/cli.js domains claim www.jorgemoya.dev --api-host api.staging.zone
◢ @bigcommerce/catalyst v1.0.0                                                                                                                           3:27:23 PM

◐ Claiming domain www.jorgemoya.dev...                                                                                                                   3:27:23 PM
✔ Domain www.jorgemoya.dev claimed.                                                                                                                     3:27:23 PM
www.jorgemoya.dev active    

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