For AI Agents

The Rare Protocol CLI is built for automation and agent workflows. Structured output, deterministic commands. Use the Cursor skill below to teach your agent how to deploy collections, mint NFTs, and run auctions.

Quick start

npm install -g @rareprotocol/rare-cli

Verify with rare --help

Cursor skill (SKILL.md)

.cursor/skills/rare-cli/SKILL.md
---
name: rare-cli
description: Interact with the Rare Protocol CLI for NFT collections, minting, and auctions. Use when deploying collections, minting NFTs, creating/settling auctions, searching tokens, or configuring the rare CLI.
---

# Rare Protocol CLI

## Quick Reference

Install and verify:

```bash
npm install -g @rareprotocol/rare-cli
rare --help
```

## Configuration

Config is stored at `~/.rare/config.json`. Each chain has its own private key and RPC URL.

```bash
# Set private key and RPC for a chain
rare configure --chain sepolia --private-key 0x... --rpc-url https://...

# Generate a new wallet
rare wallet generate --save

# View current config (keys masked)
rare configure --show
```

## Key Commands

**Deploy collection:**
```bash
rare deploy erc721 "My Collection" "MC"
rare deploy erc721 "My Collection" "MC" --max-tokens 1000
```

**Import existing collection:**
```bash
rare import erc721 --contract 0x...
rare import erc721 --contract 0x... --chain sepolia
```

**Mint NFT:**
```bash
rare mint --contract 0x... --name "My NFT" --description "..." --image ./art.png
rare mint --contract 0x... --token-uri ipfs://Qm...
```

**Auctions:**
```bash
rare auction create --contract 0x... --token-id 1 --starting-price 0.1 --duration 86400
rare auction bid --contract 0x... --token-id 1 --amount 0.5
rare auction settle --contract 0x... --token-id 1
rare auction cancel --contract 0x... --token-id 1
rare auction status --contract 0x... --token-id 1
```

**Search:**
```bash
rare search tokens --query "portrait"
rare search tokens --mine
rare search tokens --owner 0x...
rare search auctions
rare search auctions --state SETTLED
rare search collections
rare list-collections
```

**Status:**
```bash
rare status --contract 0x...
rare status --contract 0x... --token-id 1
```

## Chains

Use `--chain` to select network. Default: `sepolia`.

Supported: `sepolia`, `mainnet`, `base`, `base-sepolia`

Full support (deploy + auction + wallet + search): mainnet, sepolia.
Partial (wallet + search + status): base, base-sepolia.

## Best Practices

- Use sepolia for testing; switch to mainnet only when ready
- Set a reliable RPC endpoint (Alchemy, Infura); public endpoints throttle
- Never share private key; `~/.rare/config.json` contains plaintext keys
- Run `rare status` and `rare auction status` before transacting
- Back up your wallet; lost key = lost assets

Place in .cursor/skills/rare-cli/SKILL.md for project scope, or ~/.cursor/skills/rare-cli/SKILL.md for personal scope.