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

# Browse CLI + Link CLI

> Give your coding agent browser and payment tools to order flowers with your approval.

Give your coding agent a flower-delivery task with **Browse CLI** and **Link CLI**. Browse CLI operates the merchant’s website on Browserbase. Link CLI connects your wallet and requests your approval before the agent pays.

This guide uses a small **Floral Embrace** bouquet from **1-800-Flowers**, delivered on the next available date within a **\$100 total budget**.

## 1. Install the CLIs and skills

Use Node.js 22.18 or newer:

```bash theme={null}
npm install -g browse @stripe/link-cli
browse skills install
npx skills add stripe/link-cli --skill create-payment-credential
```

Install the skills for your coding agent.

Set `BROWSERBASE_API_KEY` in your environment to your [Browserbase API key](https://www.browserbase.com/settings):

```bash theme={null}
export BROWSERBASE_API_KEY="your_browserbase_api_key"
```

## 2. Connect your Link wallet

Check whether Link is already connected:

```bash theme={null}
link-cli auth status
```

If it isn't, start the login flow:

```bash theme={null}
link-cli auth login --client-name "Browserbase shopping agent" --interval 5 --timeout 300
```

Open the verification URL that Link returns, sign in, and approve the connection. Wait for authentication to finish before requesting a payment.

```bash theme={null}
link-cli payment-methods list
```

Add a payment method in [Link](https://app.link.com) if needed.

## 3. Give your agent the flower-delivery task

Give your coding agent this flower-delivery task:

```text theme={null}
Use Browse CLI in a remote Browserbase session named flowers to prepare a
1-800-Flowers delivery:
https://www.1800flowers.com/floral-embrace-191167

Choose the Small Floral Embrace bouquet for ZIP 94107 and the next available
delivery date. Keep the complete order under $100, including delivery,
service fees, and tax. Skip optional gifts and paid greeting cards; use the
complimentary message "Thinking of you!" signed "Your friend". Do not sign
up for marketing.

Ask me for the recipient's name, address, and phone number, plus the buyer's
contact information and billing address. Show me the bouquet, delivery date,
recipient, and complete total once the merchant shows every charge.

Use Link's create-payment-credential skill to request approval for that exact
flower order. This is a live merchant. Wait for Link to report approval,
then complete checkout once and verify the merchant's order confirmation.
Keep payment credentials out of model prompts, chat, screenshots, and logs.
```

For a rehearsal, ask your agent to create the spend request with [Link's `--test` flag](https://docs.stripe.com/agentic-commerce/link-cli/use-link-wallet-pay-online#test-your-integration). Link returns test credentials without charging your payment method. The merchant can reject them before the final order step.

## 4. Approve the complete order in Link

Review the complete order and total in Link before approving it. The agent must wait for `approved` before retrieving a credential. If the order changes, it needs fresh approval.

Keep the request ID while approval is pending. For `requires_action`, follow Link’s instructions; retry automatically only for `auto_resume`.

## 5. Complete checkout and verify the order

For a standard card form, the agent retrieves the approved virtual card into a temporary file outside the repository:

```bash theme={null}
LINK_CHECKOUT_DIR=$(mktemp -d)

link-cli spend-request retrieve lsrq_REPLACE_WITH_REQUEST_ID \
  --include card \
  --output-file "$LINK_CHECKOUT_DIR/card.json" \
  --format json
```

The browser automation should read the credential file directly and fill the merchant’s payment fields. If Link returns an incomplete billing address, use the billing address you supplied. Keep card details out of model prompts, chat, screenshots, and logs.

Submit once and verify the merchant’s confirmation. If the result is unclear, inspect it before retrying.

Delete the credential file and close the named browser session when finished:

```bash theme={null}
rm -f "$LINK_CHECKOUT_DIR/card.json"
rmdir "$LINK_CHECKOUT_DIR"
browse stop --session flowers
```

To add payments to an application you build, follow the [Stagehand guide](/integrations/stripe/stagehand).
