Documentation

Complete reference for the @rareprotocol/rare-cli package.

Install

npm install -g @rareprotocol/rare-cli

This makes the rare command available globally. Verify with:

rare --help

Getting Started

1. Configure a wallet

Import an existing private key:

rare configure --chain sepolia --private-key 0xYourPrivateKeyHere

Or generate a new wallet:

rare wallet generate --save

If you skip this step, the CLI auto-generates a wallet on first use. Check your address:

rare wallet address

2. 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.com

Set both at once:

rare configure --chain sepolia \
  --private-key 0x... \
  --rpc-url https://your-rpc-endpoint.com

3. View your config

rare configure --show

Private keys are masked in the output.

Deploy an NFT Collection

rare deploy erc721 "My Collection" "MC"
rare deploy erc721 "My Collection" "MC" --max-tokens 1000

Import 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 sepolia

Mint an NFT

Upload local media to IPFS and mint in one step:

rare mint \
  --contract 0x... \
  --name "My NFT" \
  --description "A description" \
  --image ./art.png

Mint 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 1

Query On-Chain Status

# Contract info
rare status --contract 0x...

# Include token details
rare status --contract 0x... --token-id 1

Configuration

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 --show

Supported 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.

mainnetFull
sepoliaFull
basePartial
base-sepoliaPartial

Full = deploy + auction + wallet + search. Partial = wallet + search + status.

Contract Addresses

ContractMainnetSepolia
Factory0xAe8E375a268Ed6442bEaC66C6254d6De5AeD4aB10x3c7526a0975156299ceef369b8ff3c01cc670523
Auction0x6D7c44773C52D396F43c2D511B81aa168E9a7a420xC8Edc7049b233641ad3723D6C60019D1c8771612

Underlying Solidity Contracts

Token contract

Used when minting NFTs

SovereignBatchMint.sol →

Factory contract

Used for collection deployments

SovereignBatchMintFactory.sol →

Auction / Market contract

Used for auction operations

SuperRareBazaar.sol →

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.

v0.1.1|MIT License|Requires Node.js 22+|Install CLI →|GitHub →