[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-976":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},976,"link-cli","stripe\u002Flink-cli","stripe","Let your agents spend on your behalf. Your payment credentials are never exposed. You approve every purchase.","https:\u002F\u002Flink.com\u002Fagents",null,"TypeScript",566,60,12,1,0,10,17,70,30,9.36,"MIT License",false,"main",true,[],"2026-06-12 02:00:21","# Link CLI\n\nLink CLI lets agents get secure, one-time-use payment credentials from a Link wallet to complete purchases on your behalf — without storing your real card details.\n\nThe CLI can produce one of two credential types:\n\n- A virtual card (PAN) for use with a standard web checkout form. The issued card works anywhere, and is not restricted to Link-enabled sellers or sellers that use Stripe.\n- A [Shared Payment Token](https:\u002F\u002Fdocs.stripe.com\u002Fagentic-commerce\u002Fconcepts\u002Fshared-payment-tokens) (SPT) when the seller accepts programmatic payments through [Machine Payment Protocols](https:\u002F\u002Fmpp.dev) (MPP)\n\nFor now, this is only available to US Link accounts.\n\n## Installation\n\n```bash\nnpm i -g @stripe\u002Flink-cli\n```\n\nOr run directly with `npx`:\n\n```bash\nnpx @stripe\u002Flink-cli\n```\n\n### Use with agents\n\nInstall the skill:\n\n```bash\nnpx skills add stripe\u002Flink-cli\n```\n\nBy default when called from an agent (non-TTY), all commands use `toon` output — a compact, LLM-friendly text format. All commands accept `--format [format]` for structured output. Other formats: `json`, `yaml`, `md`, `jsonl`.\n\nList available commands:\n\n```bash\nlink-cli --llms-full\n```\n\nGet a command's full schema with `--schema`. Example:\n\n```bash\nlink-cli spend-request create --schema\n```\n\n#### MCP Server\n\nLink CLI can run as a local MCP server. Add the following to your MCP client config (`.mcp.json`, etc.)\n\n```json\n{\n  \"mcpServers\": {\n    \"link\": {\n      \"command\": \"npx\",\n      \"args\": [\"@stripe\u002Flink-cli\", \"--mcp\"]\n    }\n  }\n}\n```\n\n## Quickstart\n\nRun a guided onboarding and demo flow:\n\n```bash\nlink-cli onboard\n```\n\n### Login\n\nThe `link-cli` requires a Link account. You can log in to your existing one or [register online](https:\u002F\u002Fapp.link.com).\n\n```bash\nlink-cli auth login\n```\n\nYou receive a verification URL and a short phrase. Visit the URL, log in to your Link account, and enter the phrase to approve the connection.\n\n### List payment methods\n\n```bash\nlink-cli payment-methods list\n```\n\nReturns the cards and bank accounts saved to your Link account. Use the `id` field as `payment_method_id` in the next step. If you have no payment methods, [add new ones in Link](https:\u002F\u002Fapp.link.com\u002Fwallet).\n\n### Create a spend request\n\nCreate a spend request with a payment method, merchant details, line items, and amounts:\n\n```bash\nlink-cli spend-request create \\\n  --payment-method-id csmrpd_xxx \\\n  --merchant-name \"Stripe Press\" \\\n  --merchant-url \"https:\u002F\u002Fpress.stripe.com\" \\\n  --context \"Purchasing 'Working in Public' from press.stripe.com. The user initiated this purchase through the shopping assistant.\" \\\n  --amount 3500 \\\n  --line-item \"name:Working in Public,unit_amount:3500,quantity:1\" \\\n  --total \"type:total,display_text:Total,amount:3500\" \\\n  --request-approval\n```\n\nThe `--request-approval` flag triggers a push notification to the user for approval, then polls until the request is approved or denied.\n\nEasily approve requests with the [Link app](https:\u002F\u002Flink.com\u002Fdownload).\n\n#### Line items and totals\n\n`--line-item` and `--total` use repeatable `key:value` format.\n\n**`--line-item` keys:** `name` (required), `quantity`, `unit_amount`, `description`, `sku`, `url`, `image_url`, `product_url`\n\n```bash\n--line-item \"name:Running Shoes,unit_amount:12000,quantity:1,description:Trail runners\"\n```\n\n**`--total` keys:** `type` (required; one of: `subtotal`, `tax`, `total`), `display_text` (required), `amount` (required)\n\n```bash\n--total \"type:subtotal,display_text:Subtotal,amount:12000\" \\\n--total \"type:total,display_text:Total,amount:12000\"\n```\n\n#### Credential types\n\nBy default, a spend request provisions a virtual card. For merchants that support the [Machine Payments Protocol](https:\u002F\u002Fmpp.dev) (HTTP 402) and the Stripe payment method, instead pass `--credential-type \"shared_payment_token\"`. \n\n### Execute payment\n\nThe approved spend request includes a `card` object with `number`, `cvc`, `exp_month`, `exp_year`, `billing_address`, and `valid_until`. Enter these into the merchant's checkout form. \n\n```bash\nlink-cli spend-request retrieve lsrq_001\n```\nBy default, retrieving a spend request doesn't include card details. Pass `--include card` to see unmasked card details.\n\nTo avoid leaking card credentials into agent transcripts or logs, use `--output-file` to write the full card to a secure local file while stdout shows only redacted data (brand, last4, expiry):\n\n```bash\nlink-cli spend-request retrieve lsrq_001 --include card --output-file \u002Ftmp\u002Flink-card.json --format json\n```\n\nThe file is created with `0600` permissions. If the file already exists, the command fails unless `--force` is passed. When `--output-file` is set, the JSON output replaces the `card` object with redacted fields and adds a `card_output_file` path.\n\nFor agent polling, pass `--interval` and optionally `--max-attempts`:\n\n```bash\nlink-cli spend-request retrieve lsrq_001 --interval 2 --max-attempts 150\n```\n\nPolling exits successfully only after the request reaches a terminal status such as `approved`, `denied`, or `expired`. If polling reaches `--timeout` or exhausts `--max-attempts` while the request is still non-terminal, the command exits non-zero with `code: \"POLLING_TIMEOUT\"` so callers do not treat a still-pending request as complete.\n\nIf the merchant supports MPP, use `link-cli mpp pay` instead:\n\n```bash\nlink-cli mpp pay https:\u002F\u002Fclimate.stripe.dev\u002Fapi\u002Fcontribute \\\n  --spend-request-id lsrq_001 \\\n  --method POST \\\n  --data '{\"amount\":100}'\n```\n\n## Advanced\n\n### Authentication\n\n```bash\nlink-cli auth login --client-name \"Claude Code\"   # identify the connecting agent\nlink-cli auth status                               # check auth status\nlink-cli auth logout                               # disconnect\n```\n\nWhen you provide `--client-name`, the Link app displays it when you approve the connection — for example, `Claude Code on my-macbook` instead of `link-cli on my-macbook`.\n\n`auth status` includes an `update` field when a newer version is available:\n\n```json\n{\n  \"authenticated\": true,\n  \"update\": {\n    \"current_version\": \"0.1.2\",\n    \"latest_version\": \"0.2.0\",\n    \"update_command\": \"npm install -g @stripe\u002Flink-cli\"\n  }\n}\n```\n\nSet `NO_UPDATE_NOTIFIER=1` to suppress update checks (for example, in CI).\n\n### Spend request lifecycle\n\nA spend request moves through: **create** → **request approval** → **approved** (with credentials).\n\n**Required fields for create:** `payment_method_id`, `merchant_name`, `merchant_url`, `context`, `amount`\n\n**Constraints:** `context` must be at least 100 characters; `amount` must not exceed 50000 (cents); `currency` must be a 3-letter ISO code.\n**Test mode:** Pass `--test` to create testmode credentials (uses test card `4242424242424242`), useful for development and integration testing without real payment methods.\n\n```bash\n# Update before approval\nlink-cli spend-request update lsrq_001 \\\n  --merchant-url https:\u002F\u002Fpress.stripe.com\u002Fworking-in-public\n\n# Request approval separately (alternative to create --request-approval)\nlink-cli spend-request request-approval lsrq_001\n\n# Retrieve at any time (includes card credentials after approval)\nlink-cli spend-request retrieve lsrq_001\n```\n\n### MPP\n\nUse `mpp pay` to complete purchases on merchants that use the [Machine Payments Protocol](https:\u002F\u002Fmpp.dev). The spend request must use `credential_type: \"shared_payment_token\"` and you must approve it before paying. The SPT is one-time-use — if payment fails, create a new spend request.\n\n```bash\nlink-cli mpp pay https:\u002F\u002Fclimate.stripe.dev\u002Fapi\u002Fcontribute \\\n  --spend-request-id lsrq_001 \\\n  --method POST \\\n  --data '{\"amount\":100}' \\\n  --header \"X-Custom: value\"\n```\n\nUse `mpp decode` to validate a raw `WWW-Authenticate` header and extract the `network_id` needed for `shared_payment_token` spend requests:\n\n```bash\nlink-cli mpp decode \\\n  --challenge 'Payment id=\"ch_001\", realm=\"merchant.example\", method=\"stripe\", intent=\"charge\", request=\"...\"'\n```\n\n### Environment variables\n\n| Variable | Effect |\n|----------|--------|\n| `LINK_API_BASE_URL` | Override the API base URL |\n| `LINK_AUTH_BASE_URL` | Override the auth base URL |\n| `LINK_HTTP_PROXY` | Route all requests through an HTTP proxy (requires `undici`) |\n\n## Onboard\n\nRun the guided setup flow — authenticates, checks payment methods, shows the app download QR, and runs both demo flows:\n\n```bash\nlink-cli onboard\n```\n\n## Demo\n\nRun an interactive demo of both Link payment flows (always uses test mode — no real charges):\n\n```bash\nlink-cli demo              # shows menu to choose flow\nlink-cli demo --only-card  # virtual card flow only\nlink-cli demo --only-spt   # machine payment (SPT) flow only\n```\n\n## Development\n\n```bash\npnpm install\npnpm run build\npnpm run link-cli --help\n```\n\nWatch mode:\n\n```bash\npnpm run dev\n```\n\nRun tests:\n\n```bash\npnpm run test\n```\n\nType-check and lint:\n\n```bash\npnpm run typecheck\npnpm biome check .\n```\n\n## Releasing\n\nThis project uses [Changesets](https:\u002F\u002Fgithub.com\u002Fchangesets\u002Fchangesets) to manage versioning and publishing. Only `@stripe\u002Flink-cli` is published to npm — internal packages (`@stripe\u002Flink-sdk`, `@stripe\u002Flink-typescript-config`) are ignored by changesets.\n\n### Add a changeset\n\nWhen you make a user-facing change, add a changeset before merging:\n\n```bash\npnpm changeset\n```\n\nFollow the prompts to select the package (`@stripe\u002Flink-cli`) and the semver bump type (patch, minor, or major). This creates a markdown file in `.changeset\u002F` describing the change.\n\n### Version\n\nOnce changesets have accumulated on `main`, create a version PR:\n\n```bash\npnpm changeset version\n```\n\nThis consumes all pending changesets, bumps the version in `packages\u002Fcli\u002Fpackage.json`, and updates `CHANGELOG.md`.\n\n### Publish\n\nAfter the version PR is merged:\n\n```bash\npnpm run build\npnpm changeset publish\n```\n\nThis publishes `@stripe\u002Flink-cli` to npm. CI also runs `pnpm --filter @stripe\u002Flink-cli publish --dry-run --no-git-checks` on every push to `main` to verify the package is publishable.\n","Link CLI 是一个命令行工具，允许代理以安全的方式使用一次性支付凭证代表用户完成购买，而无需暴露用户的实际支付信息。它支持生成两种类型的支付凭证：一种是可以在任何地方使用的虚拟卡（PAN），另一种是在卖家接受通过机器支付协议（MPP）进行的程序化支付时使用的共享支付令牌（SPT）。该工具采用TypeScript编写，适用于需要提高支付安全性同时保持便捷性的场景，如企业内部采购或个人购物助手等。目前仅对美国地区的Link账户开放。",2,"2026-06-11 02:40:39","CREATED_QUERY"]