Documentation
Complete reference for the @rareprotocol/rare-cli package.
Install
npm install -g @rareprotocol/rare-cliThis makes the rare command available globally. Verify with:
rare --helpGetting Started
1. Configure a wallet
Import an existing private key:
rare configure --chain sepolia --private-key 0xYourPrivateKeyHereOr generate a new wallet:
rare wallet generate --saveIf you skip this step, the CLI auto-generates a wallet on first use. Check your address:
rare wallet address2. Set an RPC endpoint
Public RPC endpoints are rate-limited. Use your own (Alchemy, Infura, etc.):
rare configure --chain sepolia --rpc-url https://your-rpc-endpoint.comSet both at once:
rare configure --chain sepolia \
--private-key 0x... \
--rpc-url https://your-rpc-endpoint.com3. View your config
rare configure --showPrivate keys are masked in the output.
Deploy an NFT Collection
rare deploy erc721 "My Collection" "MC"
rare deploy erc721 "My Collection" "MC" --max-tokens 1000Import an Existing Collection
Import an existing ERC-721 contract into the RARE Protocol registry:
rare import erc721 --contract 0x...
rare import erc721 --contract 0x... --chain sepoliaMint an NFT
Upload local media to IPFS and mint in one step:
rare mint \
--contract 0x... \
--name "My NFT" \
--description "A description" \
--image ./art.pngMint with a pre-built metadata URI:
rare mint --contract 0x... --token-uri ipfs://Qm...Additional options:
rare mint \
--contract 0x... \
--name "My NFT" \
--description "A cool piece" \
--image ./art.png \
--video ./animation.mp4 \
--tag art --tag digital \
--attribute "Base=Starfish" \
--to 0x...recipient \
--royalty-receiver 0x...Auctions
# Create an auction (auto-approves the NFT transfer)
rare auction create \
--contract 0x... \
--token-id 1 \
--starting-price 0.1 \
--duration 86400
# Place a bid
rare auction bid --contract 0x... --token-id 1 --amount 0.5
# Settle after the auction ends
rare auction settle --contract 0x... --token-id 1
# Cancel (only if no bids placed)
rare auction cancel --contract 0x... --token-id 1
# Check auction status (read-only)
rare auction status --contract 0x... --token-id 1Search
# Search all NFTs
rare search tokens --query "portrait"
# Search your own NFTs
rare search tokens --mine
# Search NFTs by owner
rare search tokens --owner 0x...
# Find active auctions (defaults to PENDING + RUNNING)
rare search auctions
# Filter by auction state
rare search auctions --state SETTLED
# Search your collections
rare search collectionsAll search commands support --take <n> and --cursor <n> for pagination.
List All Collections
Fetches every collection you own (auto-paginates):
rare list-collectionsQuery On-Chain Status
# Contract info
rare status --contract 0x...
# Include token details
rare status --contract 0x... --token-id 1Configuration
Config is stored at ~/.rare/config.json. Each chain has its own private key and RPC URL.
# Set private key and RPC for a chain
rare configure --chain sepolia --private-key 0x... --rpc-url https://...
# Configure multiple chains
rare configure --chain base --rpc-url https://your-base-rpc.com
rare configure --chain arbitrum --private-key 0x... --rpc-url https://your-arb-rpc.com
# Change default network
rare configure --default-chain mainnet
# View current config
rare configure --showSupported Chains
All commands accept --chain to select a network. Defaults to sepolia.
Note: RARE Protocol deploy and auction commands are currently available on mainnet and sepolia only.
Full = deploy + auction + wallet + search. Partial = wallet + search + status.
Contract Addresses
| Contract | Mainnet | Sepolia |
|---|---|---|
| Factory | 0xAe8E375a268Ed6442bEaC66C6254d6De5AeD4aB1 | 0x3c7526a0975156299ceef369b8ff3c01cc670523 |
| Auction | 0x6D7c44773C52D396F43c2D511B81aa168E9a7a42 | 0xC8Edc7049b233641ad3723D6C60019D1c8771612 |
Underlying Solidity Contracts
Best Practices
Use sepolia for testing
Default to sepolia and only switch to mainnet when you're ready.
Set a reliable RPC endpoint
Public endpoints throttle and drop requests. Alchemy and Infura provide free tiers.
Don't share your private key
The config at ~/.rare/config.json contains your key in plaintext. Keep it secure.
Check status before transacting
Use `rare status` and `rare auction status` to inspect on-chain state first.
Back up your wallet
If you lose your private key, you lose access to your assets. Store a copy somewhere safe.