Link Cli logo

Link Cli

Organization
okou-ai
link-cli

Stripe Link agent wallet CLI. Use when the user wants an agent to make payments on their behalf, create one-time-use virtual cards, spend via Machine Payments Protocol (MPP), or manage their Link wallet. Triggers on mentions of "buy with Link", "agent payment", "Link wallet", "spend request", or "link-cli".

Overview

Publisherokou-ai
Repositoryokou-skills
Skill namelink-cli
Stars
81
Forks
19
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by okou-ai on GitHub. Read the source before you install it.

Installation

Install the Link Cli AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/okou-ai/okou-skills/tree/main/link-cli
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/okou-ai/okou-skills.git /tmp/okou-skills
mkdir -p .claude/skills
cp -r /tmp/okou-skills/link-cli .claude/skills/link-cli
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Link Cli in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Link Cli on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Link Cli is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

link-cli — Stripe Link Agent Wallet

Let AI agents get secure, one-time-use payment credentials from a Link wallet — so they can complete purchases on your behalf without ever storing your real card details. Uses the OAuth 2.0 device authorization grant (RFC 8628): no browser, no localhost callback, no API token.

Repo: https://github.com/stripe/link-cli Install: runs via npx -y @stripe/link-cli (no pre-install needed)

Auth Flow

link-cli uses device authorization. The pattern for every auth-dependent command:

  1. Run the command — if unauthenticated, it returns a verification_url + phrase
  2. Present the URL to the user and ask them to approve in the Link app
  3. Poll until authenticated — do not wait for the user to reply before polling

Credentials are stored at ~/.config/link-cli-nodejs/config.json.

1. Log In

bash
npx -y @stripe/link-cli auth login --format json

Returns verification_url, phrase, and _next.command. The user visits the URL and enters the phrase in their Link app.

2. Poll Until Authenticated

Use the _next.command from the login response, or:

bash
npx -y @stripe/link-cli auth status --interval 5 --max-attempts 60 --format json

Exits when authenticated is true. The --interval / --max-attempts flags control polling behavior.

3. Check Auth Status

bash
npx -y @stripe/link-cli auth status --format json

Returns authenticated (bool), credentials_path, and if pending, the current verification_url + phrase.

4. Log Out

bash
npx -y @stripe/link-cli auth logout --format json

Payment Methods

5. List Payment Methods

bash
npx -y @stripe/link-cli payment-methods list --format json

Returns saved payment methods with id, type (CARD), name, is_default, and card_details (brand, last4, exp_month, exp_year).


Spend Requests

The core flow: create a spend request → user approves in Link app → agent receives one-time credentials.

6. Create a Spend Request

bash
npx -y @stripe/link-cli spend-request create \
  --payment-method-id "<payment-method-id>" \
  --merchant-name "Gumroad" \
  --merchant-url "https://example.com/checkout" \
  --amount 100 \
  --currency usd \
  --context "Buying HTTPZine from Gumroad — a free comic about HTTP. Patrick Collison demoed this at Stripe Sessions 2026. This is a test of the Link CLI agent payment flow." \
  --format json

Required for virtual card flow (--credential-type card, the default):

  • --payment-method-id — from payment-methods list
  • --merchant-name — human-readable merchant name
  • --merchant-url — the merchant's website
  • --amount — in cents, max 50000 ($500.00)
  • --currency — 3-letter ISO code (default: usd)
  • --context — min 100 characters describing the purchase and rationale

Optional:

  • --credential-type shared_payment_token — for MPP/HTTP 402 flows (omits --merchant-name/--merchant-url)
  • --test — use test mode (generates test card 4242 4242 4242 4242)
  • --line-item name:<name>,unit_amount:<cents>,quantity:<n> — repeatable
  • --total type:<type>,display_text:<text>,amount:<cents> — repeatable

Returns an approval_url and _next.command for polling.

7. Poll for Approval

bash
npx -y @stripe/link-cli spend-request retrieve <spend-request-id> \
  --interval 2 --max-attempts 150 --format json

Exits when status is approved, denied, or expired. On timeout while pending, exits non-zero with POLLING_TIMEOUT.

8. Reveal Card Details

bash
npx -y @stripe/link-cli spend-request retrieve <spend-request-id> \
  --include card --format json

When approved, the response includes a card object with number, cvc, brand, exp_month, exp_year, billing_address, and valid_until. The card is one-time-use and expires after valid_until.

9. Update a Spend Request

bash
npx -y @stripe/link-cli spend-request update <spend-request-id> \
  --merchant-url "https://example.com/new-url" --format json

10. Request Approval (Separately)

If --request-approval was omitted during create:

bash
npx -y @stripe/link-cli spend-request request-approval <spend-request-id> --format json

Machine Payments Protocol (MPP)

For merchants that support MPP/HTTP 402, skip the checkout form entirely.

11. Decode an MPP Challenge

bash
npx -y @stripe/link-cli mpp decode \
  --challenge '<WWW-Authenticate header value>' --format json

Extracts the network_id needed for SPT spend requests.

12. Pay via MPP

bash
npx -y @stripe/link-cli mpp pay "https://api.example.com/resource" \
  --spend-request-id "<approved-spend-request-id>" \
  --method GET --format json

The spend request must be approved and have credential_type: shared_payment_token. The token is single-use — if payment fails, create a fresh spend request.

Options: --method (GET/POST/PUT/DELETE/PATCH), --data '<json>', --header "Key: value" (repeatable).


Guided Setup

13. Interactive Onboarding

bash
npx -y @stripe/link-cli onboard

Walks through auth, payment methods check, app download QR, and demo flows. Requires a TTY — not suitable for headless/agent-driven use.

14. Run Demo (TTY required)

bash
npx -y @stripe/link-cli demo --only-card --format json

Test mode only. Use --only-card or --only-spt to run a single flow.


MCP Server Mode

bash
npx -y @stripe/link-cli --mcp

Runs link-cli as a local MCP server for MCP-compatible clients.


Environment Variables

VariablePurpose
NO_UPDATE_NOTIFIER=1Suppress version update checks (use in CI/automation)
LINK_API_BASE_URLOverride API base URL
LINK_AUTH_BASE_URLOverride auth base URL

Guidelines

  1. Always use --format json — the default toon format is for human TTY consumption. JSON is machine-parseable.
  2. Never wait for the user between login and polling — call auth login, present the URL, and immediately start polling auth status. Same for spend requests: create, present approval_url, poll immediately.
  3. Test mode for demos — use --test on spend-request create to avoid real charges during testing.
  4. Context is required and must be ≥100 chars — the user reads this when approving. Describe the purchase and rationale clearly.
  5. Virtual cards are one-time-use and have a short validity window (typically ~1 hour). Use them immediately after approval.
  6. Credentials persist across sessions at ~/.config/link-cli-nodejs/config.json. Check auth status before assuming the user is logged in.
  7. Check _next in responses — many commands return a _next.command field with the exact polling command to use.
  8. Amounts are in cents — 100 = $1.00, 50000 = $500.00 (max).
  9. demo and onboard require TTY — they won't work in headless sandbox environments.
  10. No API token or connector needed — link-cli manages its own OAuth device flow and stores credentials locally.

Frequently asked questions

What does the Link Cli AI skill do?

Stripe Link agent wallet CLI. Use when the user wants an agent to make payments on their behalf, create one-time-use virtual cards, spend via Machine Payments Protocol (MPP), or manage their Link wallet. Triggers on mentions of "buy with Link", "agent payment", "Link wallet", "spend request", or "link-cli".

Why use Link Cli on TypingMind?

Because you install it once and use it with any model. Link Cli is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Link Cli in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/okou-ai/okou-skills/tree/main/link-cli. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Link Cli?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Link Cli?

As many as you like. As long as a model supports skills, you can use Link Cli with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Link Cli AI skill free?

It is published on GitHub by okou-ai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇