Skip to main content
Run init in your app’s folder. The CLI asks four questions, installs @agent-cards/commerce-sdk with your package manager, and then Agentcard’s agent builds the buy tool into your code while you watch.

Answer the four questions

Each question lists every option, as radio buttons, or as checkboxes for the stores and the wallets. Options that aren’t ready yet are listed too, dimmed with “coming soon”, and the cursor skips them:
The CLI asks:
  1. Which Agentcard product you’re adding: Commerce SDK, first in the list. Vault and Issuing show under it but are coming soon, so you can’t pick them yet.
Then it says how many stores the Commerce SDK adds, and asks:
  1. Which stores your agent buys from: All stores, or the categories you check with the space bar. The categories are online shopping, food delivery, groceries, flights, hotels, restaurant reservations, fitness classes and event tickets.
  2. How your agent uses it: Tool, one buy tool your agent calls. API is coming soon.
  3. Which wallets pay, in the order shoppers see them: check Agentcard Vault, Stripe Link, or both with the space bar. The order you check them in is the order your users see them. With the Vault, your users save their card once and approve each purchase with their passkey. With Stripe Link, your users approve each store’s payment in their own Stripe Link wallet, which pays at store checkouts across the web and for the hotels, rental cars and flights they book. Each answer says which wallets can pay its carts. Shop Pay shows in the list but is coming soon.
With Stripe Link checked, Agentcard’s agent also mounts the Link sign-in routes and reads your Link app’s keys, LINK_CLIENT_ID, LINK_CLIENT_SECRET and LINK_PUBLISHABLE_KEY, from the environment on your server only, and lists them in .env.example. Put their values in your env file yourself: the CLI writes only Agentcard’s credentials there. Register the Link app with Stripe first, as Connecting a shopper’s Stripe Link wallet describes. Without a terminal, pass the wallets in order, such as --wallet vault,link. Then it shows your choices:

Approve once

The CLI lists every step that changes something, then asks one question, with yes as the answer when you press Enter:
The sign-in steps show only when you’re not signed in. Signed in to an account with no company yet, the list says Name your company instead. If your git repository has uncommitted changes, the CLI says so above the question: commit first, so you can review the agent’s changes apart from yours. A no installs and changes nothing. You can run init from any folder inside your app, such as src/: the CLI works on the nearest folder above it with a package.json, and Start it begins with the cd back into the app.

Install the SDK

A spinner shows while the SDK installs, then ✓ Installed @agent-cards/commerce-sdk. The package manager’s own output appears only when the install fails. The CLI uses the package manager your lockfile names: pnpm add with pnpm-lock.yaml, yarn add with yarn.lock, bun add with bun.lock or bun.lockb, and npm install otherwise. In a monorepo package it reads the workspace root’s lockfile. A folder with no package.json installs nothing, and the CLI tells you to run init from your app’s folder. --skip-install sets everything up without installing.

Let Agentcard’s agent build it in

After the install, Agentcard’s agent reads your code, wires in the buy tool, runs your typecheck, and ends with a short report. The agent runs on Agentcard’s account, so you need no model key of your own. Before it starts:
  • You need to be signed in. If you are not, the CLI opens app.agentcard.sh in your browser. Sign in, or sign up with a new email: a sign-in that init starts creates your Agentcard account. Then the browser hands you back to the terminal.
  • Your account needs a company. A new account names it right there, with your work email’s domain offered as the name, and the CLI creates the company with you as its owner:
An account with several companies picks one from a list. You never need the dashboard for any of it.
  • The CLI puts your company’s production client ID and secret in your app’s env file, and creates them when your company has none yet (that needs an owner or admin, and an active subscription). --mode sandbox puts the sandbox ones there instead. The file is .env.local for Next.js, .env otherwise. The CLI adds that file to .gitignore so the secret is never committed. Agentcard credentials already in the file, from an earlier run or another company, are replaced; the rest of the file stays. An env file that git already tracks is left alone.
  • With production credentials the agent checks the buy tool without buying anything. The agent stops at the add-a-card link, since adding a card and approving a payment are a real person’s own steps.
While the agent works, each step shows as one dim line, with the agent’s own messages in between and a spinner while it thinks:
The agent ends with a short report in bullets: what it built, each check it ran and whether it passed, and up to three things to check by hand. Then the CLI lists every file that changed and how to review them, has your company set up live purchases, and last, shows the command that starts your app:
The agent never commits, pushes or deploys. When it names no start command, the CLI shows your project’s dev or start script instead.

Turn on live purchases

Agentcard charges a fee on every live purchase, so production credentials buy for real only once your company can pay it: add credits to its balance, or connect a payment method to pay as you go. After the agent finishes, the CLI opens Commerce SDK → Balance in your dashboard, where you do either, and waits. When your company can pay, the CLI says ✓ Live purchases are on and shows the command that starts your app. Press Enter to skip and fund later: agent-cards fund opens the same page any time, and if it isn’t done in 30 minutes, Agentcard emails you the link. If your company can already pay, or with --mode sandbox, the CLI skips this step.

Know what the agent can touch

The agent works in your project folder: it reads, edits and searches files there, and runs commands such as installs, typechecks and tests. The CLI refuses file-tool requests for paths outside the folder and env files other than .env.example. The CLI also refuses commands that print an env file or the environment. Your app reads the credentials from the environment, so the agent never needs their values. The CLI checks the agent’s requests, but does not sandbox its commands. The agent’s commands run as you, with your permissions, so a command or a script the agent writes and runs can reach files outside the folder. Commit your work before you start, and review every change with git diff. A run stops after 30 minutes, or sooner when it reaches its limit for one run. Your account also has a daily limit for the agent. When you reach it, the CLI says so, and the limit resets within 24 hours:
Press Ctrl+C to stop the agent. What it changed so far stays in place, and the CLI lists those files:
Ctrl+C at a question before the approval cancels init before anything changes. If you cancel a later question, such as your company’s name, the CLI leaves the steps already done in place, such as copying the example app and installing the SDK:

Start from an empty folder

Run init in an empty folder and the CLI first copies Agentcard’s example app there: a terminal chat on the Vercel AI SDK that buys from real stores with the buy tool. Everything after that is the same as in any project: the four questions, one approval, the install, your credentials, and Agentcard’s agent fitting the app to your answers.
An empty folder has no package.json and nothing in it but dot files, such as .git or .gitignore. A folder with any other file in it is treated as your project. Run from a folder inside an app, such as src/, init works on the app as usual; an empty folder inside an app still gets the example app, since that is where you asked for a new one. The CLI says so first, before any question. The approval lists copying the app as the first step:
After the yes, the CLI downloads the app from GitHub, then carries on as in any project. A file already in the folder is never overwritten. The agent is told the app started from the example, so it keeps it working and changes it to fit your answers, such as the stores you picked. The last lines say how to start the app, and name the one value only you have, your Anthropic key. Without a terminal, the same flags as any project apply, and --yes copies the app, installs and prints the instructions. --print in an empty folder prints the instructions for your own coding agent and creates nothing.

Use your own coding agent

--print skips Agentcard’s agent and prints the instructions for your own, such as Claude Code, Cursor or Codex:
The instructions start with your setup, then the Commerce SDK guide that agent-cards guide commerce-sdk prints:

Run it without a terminal

A coding agent or a CI job answers every question with a flag:
Without a terminal, init installs the SDK and prints the instructions on stdout, the same as --print. Its other notes go to stderr, so > file captures the instructions alone. A missing flag stops it before anything runs:
Without a terminal the product is the Commerce SDK, so --product is optional. --product vault and --product issuing are refused until they set up here:
--implementation api is refused until the API arrives:
In a terminal, a flag answers its own question and the CLI asks the rest. --yes is the one approval, so nothing more is asked. With --print in a terminal, the install is the only change, so the CLI asks before it installs.