feat: Implement UCP commands - #250
Draft
kreese-stripe wants to merge 2 commits into
Draft
Conversation
Real catalog search responses group results by product with the checkout-relevant fields (profile_id, sku, price, availability) nested under variants[0] rather than on the product itself, so the interactive view was silently omitting them. Fall back to variant fields, and render results as a table with dynamic column widths so SKU and network id stay copyable for the next `ucp checkout create` step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Committed-By-Agent: claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Search the catalog (ucp catalog search) — needs a query or at least one filter (brand/category/color/size/material/network-id/sku):
node packages/cli/dist/cli.js ucp catalog search --query "running shoes" --test
node packages/cli/dist/cli.js ucp catalog search --brand nike --limit 5 --test
node packages/cli/dist/cli.js ucp catalog search --sku sku_123 --test
Create a checkout (ucp checkout create) — needs --network-id and at least one --line-item:
node packages/cli/dist/cli.js ucp checkout create
--network-id profile_123
--line-item "sku_id:sku_123,quantity:2"
--test
On success this returns a _next hint suggesting the follow-up complete command.
Mint a Shared Payment Token for the checkout total:
node packages/cli/dist/cli.js spend-request create
--credential-type shared_payment_token
--amount <checkout_total_cents>
--context "Purchasing items from UCP checkout <checkout_id> for testing the UCP flow end to end"
--request-approval --test
Complete the checkout (ucp checkout complete ) — needs the approved SPT id:
node packages/cli/dist/cli.js ucp checkout complete <checkout_id>
--shared-payment-token <spt_id>
--test