# CLI & Chain Binary

The BitBadges CLI is the fastest way to interact with the BitBadges blockchain. A single install gives you everything: the chain binary (`bitbadgeschaind`), the SDK CLI (`bitbadges-cli`), and 104+ API routes — all from your terminal.

## Install (One-Liner)

```bash
curl -fsSL https://raw.githubusercontent.com/BitBadges/bitbadgeschain/master/install.sh | sh
```

This installs both:

* **`bitbadgeschaind`** — the chain binary (key management, signing, broadcasting, on-chain queries)
* **`bitbadges-cli`** — the SDK CLI (API access, review/audit, docs browser, skills, address tools)

Verify your installation:

```bash
bitbadgeschaind version
bitbadges-cli sdk status
```

## How They Work Together

The chain binary delegates every `bitbadges-cli` subcommand to the Node.js CLI via a single `cli` forwarder. These are equivalent:

```bash
bitbadgeschaind cli sdk review tx.json
bitbadges-cli sdk review tx.json

bitbadgeschaind cli api tokens get-collection 1
bitbadges-cli api tokens get-collection 1
```

Use whichever you prefer. The chain binary adds key management, transaction signing, and on-chain queries on top of what the SDK CLI provides.

## What You Can Do

| Capability                                   | Command                                    | Example                                                                                                                         |
| -------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| **Create a collection with no wallet setup** | `bitbadges-cli builder create-with-burner` | `bitbadges-cli builder templates subscription … \| bitbadges-cli builder create-with-burner --msg-stdin --manager bb1… --local` |
| **Query any collection**                     | `bitbadges-cli api tokens get-collection`  | `bitbadges-cli api tokens get-collection 1`                                                                                     |
| **Review and audit tokens**                  | `bitbadges-cli sdk review`                 | `bitbadges-cli sdk review tx.json`                                                                                              |
| **Browse 104+ API routes**                   | `bitbadges-cli api`                        | `bitbadges-cli api tokens --help`                                                                                               |
| **Convert addresses**                        | `bitbadges-cli sdk address convert`        | `bitbadges-cli sdk address convert 0x1234... --to bb1`                                                                          |
| **Look up token info**                       | `bitbadges-cli sdk lookup-token`           | `bitbadges-cli sdk lookup-token USDC`                                                                                           |
| **Browse docs**                              | `bitbadges-cli sdk docs`                   | `bitbadges-cli sdk docs learn/approvals`                                                                                        |
| **List builder skills**                      | `bitbadges-cli sdk skills`                 | `bitbadges-cli sdk skills smart-token`                                                                                          |
| **Create/sign transactions**                 | `bitbadgeschaind tx`                       | `bitbadgeschaind tx tokenization create-collection ./col.json --from mykey`                                                     |
| **Manage keys**                              | `bitbadgeschaind keys`                     | `bitbadgeschaind keys add mykey`                                                                                                |
| **Query on-chain state**                     | `bitbadgeschaind query`                    | `bitbadgeschaind query tokenization collection 1`                                                                               |

## For AI Agents

The CLI is the recommended interface for AI agents and automation. It provides:

* **Structured JSON output** for every command — easy to parse programmatically
* **`--help-json`** flag that outputs the full command tree as structured JSON for LLM tool discovery
* **`--dry-run`** for safe simulation before broadcasting
* **Shell completion** for interactive use: `eval "$(bitbadges-cli completion)"`
* **Pipe-friendly** — accepts stdin (`-`), file paths (`@file.json`), and inline JSON

See [CLI for AI Agents](https://docs.bitbadges.io/for-developers/cli/for-ai-agents) for end-to-end agent workflows.

For building token collections with AI assistants (Claude, Cursor, etc.), see the [BitBadges Builder Tools](https://docs.bitbadges.io/for-developers/ai-agents/builder-tools) which provide 50+ tools on top of the CLI.

## Next Steps

* [Installation](https://docs.bitbadges.io/for-developers/cli/installation) — all install methods and configuration
* [SDK Commands](https://docs.bitbadges.io/for-developers/cli/sdk-commands) — review, interpret, address tools, docs, skills
* [API Commands](https://docs.bitbadges.io/for-developers/cli/api-commands) — 104+ API routes from your terminal
* [Chain Commands](https://docs.bitbadges.io/for-developers/cli/chain-commands) — keys, transactions, on-chain queries
* [Builder Templates](https://docs.bitbadges.io/for-developers/cli/builder-templates) — flag-based generators for vault, subscription, bounty, auction, and 14 other token types
* [Create With Burner](https://github.com/trevormil/bitbadges-docs/blob/master/for-developers/cli/create-with-burner.md) — ship a create-collection tx without bringing your own wallet
* [Builder Commands](https://docs.bitbadges.io/for-developers/cli/builder-commands) — tools, review, verify, simulate, preview, doctor, session, resources
* [CLI for AI Agents](https://docs.bitbadges.io/for-developers/cli/for-ai-agents) — agent workflows and automation patterns
