> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agentcard is for companies whose agent buys for their users. Pick one path: the opencommerce SDK (@agent-cards/commerce-sdk) gives your agent one buy tool that finds the product, builds the cart, gets the user's approval and places the order at real stores; the Agentcard SDK (@agent-cards/sdk) pays with the user's own card when your agent already shops in a browser (Browser Use, Kernel, Browserbase, Anchor or Notte); the Purchase API (POST /buy) does the same purchase flow over plain HTTP in any language; Issuing gives the agent its own card.
> Start with `npx agent-cards init` in the app's folder (Node 22 or later). No invite is needed: it creates your Agentcard account if you don't have one, installs the opencommerce SDK and puts the credentials in the env file, kept out of git. From a coding agent, run `npx agent-cards init --print --categories all --implementation tool --wallet vault --skip-install` to get the setup steps to apply yourself.
> Vault is by invitation: request it at https://agentcard.com/get-started?utm_source=docs&utm_medium=llms&utm_campaign=agent-instructions. opencommerce needs no invite.
> Never ask a user for a card number, expiry date or CVV in chat. Send them the Vault link; they add their card on Agentcard's page, and the agent never sees the number.
> Every purchase is approved by the user, with a passkey or Face ID, or by an auto-approval they granted. An approval covers one merchant and one exact total. If the total changes, ask again. When a result says the user already said yes, don't ask again.
> `init` writes PRODUCTION credentials, which place real orders, so test in sandbox first. For opencommerce, run `npx agent-cards credentials --mode sandbox` and put the two lines it prints in place of the production ones in the env file `init` wrote, because that command only prints them; sandbox then runs the whole flow against real stores and stops before payment, so no order is placed and nobody is charged. For Vault and Issuing, sandbox credentials issue test cards that no real merchant accepts; try the checkout against shop.agentcard.sh, a test store on Stripe test mode.
> Tell the user an order is placed only after Agentcard reports it placed.
> Vault is free up to 5,000 users (https://agentcard.com/pricing). opencommerce takes 1% of each completed order. Full docs in one file: https://docs.agentcard.com/llms-full.txt

# agent-cards CLI: create your account and add the opencommerce SDK

> The agent-cards CLI: create your account, add the opencommerce SDK to your app with one command, and copy your credentials from the terminal.

Use the `agent-cards` CLI to build Agentcard into your company's app from the terminal. One command, [`init`](https://docs.agentcard.com/tools/cli/init), creates your account and your company, adds the Commerce SDK to your project, puts your credentials in your env file, and has Agentcard's agent build the buy tool in. The CLI also copies your client ID and secret, searches your company's users, cards and transactions, and prints instructions your coding agent can follow.

## Install the CLI

```bash theme={null}
npm install -g agent-cards
```

The CLI needs Node 22 or later and installs two names for the same tool, `agent-cards` and `agentcard`. Run `agent-cards` with no command to see where you stand and what to run next:

```bash theme={null}
agent-cards
```

```text theme={null}
  Agentcard  let agents buy anything online

  Add Agentcard to your app. Run this in your app's folder, or in an empty one for a new app:

    agent-cards init

  › init signs you in, or creates your account and your company.
  › Rather talk to us first? Run agent-cards signup
```

The CLI keeps itself up to date. Once a day, before a command runs, it checks for a newer version and installs it.

## Start with init

Run [`init`](https://docs.agentcard.com/tools/cli/init) in your app's folder. The CLI asks four questions, then does the rest after one yes: signs you in, or creates your account in the browser, names your company, installs the SDK, puts your production credentials in your env file, and has Agentcard's agent build the buy tool into your code. In an empty folder, `init` first sets up Agentcard's example app, a terminal chat that buys, so you have something to run.

```bash theme={null}
npx agent-cards init
```

[`signin`](https://docs.agentcard.com/tools/cli/signin) on its own signs you in, or creates your account, and offers to name your company. Rather talk to the Agentcard team first? [`signup`](https://docs.agentcard.com/tools/cli/signup) tells us about your company and books a call.

## Pick a command

| Command | What it does |
| - | - |
| [`init`](https://docs.agentcard.com/tools/cli/init) | Create your account and company, add the Commerce SDK to this project, and have Agentcard's agent build it in. In an empty folder, start from Agentcard's example app. |
| [`signin`](https://docs.agentcard.com/tools/cli/signin) | Sign in, or create your account, in the browser. `login` works too. |
| [`signout`](https://docs.agentcard.com/tools/cli/signout) | Sign out of this machine. `logout` works too. |
| [`credentials`](https://docs.agentcard.com/tools/cli/credentials) | Copy your company's sandbox or production client ID and secret. |
| [`fund`](https://docs.agentcard.com/tools/cli/fund) | Open your dashboard to add credits or connect a payment method, so your agents can buy for real. |
| [`search`](https://docs.agentcard.com/tools/cli/search) | Search your company's users, cards and transactions in your own words. |
| [`guide`](https://docs.agentcard.com/tools/cli/guide) | Print the instructions for your coding agent to build Agentcard into your app. |
| [`support`](https://docs.agentcard.com/tools/cli/support) | Chat with the Agentcard team. |
| [`signup`](https://docs.agentcard.com/tools/cli/signup) | Tell us about your company and book a call with the Agentcard team. |

Two options work with every command. `--version` prints the version you have. `--api-url <url>` sends one run to another Agentcard API, the same as setting `AGENT_CARDS_API_URL`.

Add `--help` to any command to see its flags:

```bash theme={null}
agent-cards init --help
```

## Run it from a coding agent

Every command that asks a question also takes its answers as flags, so a coding agent or a CI job can run it without a terminal. Without a terminal, the CLI never waits for input: it either runs from the flags or stops at once and names the flags it needs.

```bash theme={null}
agent-cards signin --email you@acme.com              # emails a code, exits with code 2
agent-cards signin --email you@acme.com --code 123456
agent-cards init --product commerce-sdk --categories all --implementation tool --wallet vault --yes
agent-cards credentials --mode sandbox                # prints the two env lines
agent-cards fund                                      # prints the Balance page link
agent-cards search "declined charges last week" --json
agent-cards guide commerce-sdk                        # Markdown on stdout
```

* `init` without a terminal prints the coding agent's instructions on stdout and its notes on stderr. `--print` does the same in a terminal.
* `credentials` without a terminal prints `AGENTCARD_CLIENT_ID=...` and `AGENTCARD_CLIENT_SECRET=...` and copies nothing.
* `fund` without a terminal prints the link to your company's Balance page and opens no browser.
* `search` without a terminal, or with `--json`, prints JSON.
* `guide` always prints plain Markdown, so a coding agent can run it and read the result.
* `signin --email` exits with code `2` and the line `code_required` until you pass the emailed code.

## Give your agent these rules

```text theme={null}
- Start with agent-cards init in the app's folder; with no terminal, pass every flag it names.
- Sign in with agent-cards signin --email, then ask the person for the emailed code and finish with --code. A new email gets an account.
- init puts production credentials in the env file. They place real orders on real cards: never add a card or approve a payment yourself. Use --mode sandbox to build against the sandbox.
- Put the two credential lines in the project's env file, never in code or in git.
- Read the build instructions with agent-cards guide commerce-sdk before writing code.
```

## Set it up for scripts and CI

| Variable | What it does |
| - | - |
| `AGENT_CARDS_JWT` | A token to use instead of the session stored on this machine. |
| `AGENT_CARDS_API_URL` | The Agentcard API to call. Defaults to `https://api.agentcard.sh`. |
| `AGENT_CARDS_SKIP_UPDATE=1` | Skip the daily update check. CI skips it already. |
| `DO_NOT_TRACK=1` | Turn off usage events and error reports. `AGENT_CARDS_TELEMETRY=0` does the same. |

Your session lives in `~/.agent-cards/config.json`, readable by you alone.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.