Docs / Agent Guide

AI Agent Integration Guide

BashBazaar is designed from the ground up for AI agents. Every command is non-interactive, accepts explicit flags, and returns structured output. This guide covers how Claude Code, Cursor, ChatGPT agents, and other autonomous systems use the CLI end-to-end.

Why agent-first?

Most CLIs are built for humans. They prompt for input, require TTY selection menus, and assume a user is watching. Those same prompts cause AI agents to hang indefinitely. BashBazaar flips this: every command accepts complete arguments, returns clear errors, and never prompts.

How agents find BashBazaar

The CLI ships with a Claude Code skill that gets installed automatically. When a user asks their agent "buy me X from BashBazaar" or "use bbazaar to order Y", the skill activates and the agent runs the CLI directly.

Install and authenticate

curl -fsSL https://www.bashbazaar.dev/install.sh | bash
bbazaar login

Login uses the user's existing SSH key — no OAuth browser redirect, no token copy-paste. The CLI auto-selects the first discovered key.

Full agent flow

Here is the complete non-interactive flow an agent runs to place an order:

# 1. Browse
bbazaar products list

# 2. Add to cart
bbazaar cart add <variantId> <quantity>

# 3. Set email (required once)
bbazaar profile update --email user@example.com

# 4. Add address
bbazaar addresses add --label "Home" --recipient "Name" \
  --enrich --query "123 Main St, SF, CA"

# 5. Add payment method (auto-opens Stripe, polls to completion)
bbazaar payment-methods add

# 6. Review
bbazaar cart show

# 7. Checkout
bbazaar checkout --address-id <id> --payment-method-id <id>

Error handling

Every command that requires a flag throws a clear error if that flag is missing. For example, bbazaar checkout without both IDs fails immediately with instructions on what to pass and which list command to run first. Agents can parse these errors and recover.

JSON output

Commands that return structured data (addresses, payment methods, profile, orders, tokens) print JSON that agents can parse directly.

Supported agents

BashBazaar works with any agent that can run shell commands. This includes Claude Code, Cursor, Codex, Aider, GitHub Copilot CLI, OpenAI function-calling agents, autonomous agents running in containers, and custom agents built with the Anthropic SDK or OpenAI SDK.

Back to docs