@doma-protocol/cli
v0.4.0
Published
CLI tool for Doma Protocol
Keywords
Readme
Doma CLI
Command-line tool for interacting with the Doma Protocol — token trading, domain management, DNS records, and cross-chain bridging. Designed for both AI agents and developers.
Installation
npm install -g @doma-protocol/cliRequires Node.js >= 20.
Configuration
Configure with doma config set <key> <value>:
doma config set privateKey "your-private-key"
doma config set apiKey "your-api-key"Or edit ~/.doma/config.json directly:
{
"privateKey": "your-private-key",
"apiKey": "your-api-key"
}A private key is required for transaction commands (swap, bridge, dns set, nameservers set, etc.). Read-only commands like token, domain, and dns list work without one.
On macOS, doma config set privateKey stores the key in Keychain instead of the config file. Use --plaintext to store in config.json instead. On other platforms, config.json is used automatically.
Environment variables can also be used and take precedence over the config file:
| Config Key | Environment Variable | Description | Default |
| --------------- | ---------------------- | ---------------------------------------------- | ------- |
| privateKey | DOMA_PRIVATE_KEY | Wallet private key (required for transactions) | |
| apiKey | DOMA_API_KEY | API key for Doma GraphQL | |
| apiUrl | DOMA_API_URL | API endpoint (overridden by --testnet) | |
| routingApiUrl | DOMA_ROUTING_API_URL | Routing API endpoint | |
| chainId | DOMA_CHAIN_ID | Default chain ID | 97477 |
| testnet | DOMA_TESTNET | Use testnet | false |
Use --testnet on any command to target Doma Testnet:
doma --testnet dns list mydomain.comDNS and nameserver write operations on Doma chain use sponsored gas (gasless) via ERC-4337 and EIP-7702.
Supported Chains
| Chain | ID |
| ------------ | ------- |
| Doma Mainnet | 97477 |
| Doma Testnet | 97476 |
| Ethereum | 1 |
| Base | 8453 |
Commands
Token
Get detailed token information including price, 24h change, volume, trading venue, fees, and liquidity.
doma token <token>Balance
Check wallet balances. Defaults to ETH + USDC if no token is specified.
doma balance [token]Quote
Get a swap quote. Auto-detects the best route (launchpad bonding curve, Uniswap V3, or multi-step).
doma quote <tokenIn> <tokenOut> <amount>Swap
Execute a token swap.
doma swap <tokenIn> <tokenOut> <amount>Options:
-s, --slippage <bps>— Slippage tolerance in basis points (default: 50 = 0.5%)-y, --yes— Skip confirmation prompt
Bridge
Bridge ETH or USDC between Doma, Ethereum, and Base via Relay.
doma bridge <token> <amount> --from <chain> --to <chain>Default route is Doma → Base.
Domain
Get detailed on-chain information about a tokenized domain, including nameservers, DNSSEC DS keys, expiration, and token IDs.
doma domain <name>Subdomain
Manage subdomains through token staking.
doma subdomain check <label> <domain> # Check availability and price
doma subdomain claim <label> <domain> # Stake tokens to claim
doma subdomain unstake <nameOrId> # Unstake and release
doma subdomain list [domain] # List subdomains (--mine for yours)Alias: doma sub
DNS
Manage on-chain DNS records. Only available for domains using Doma nameservers.
doma dns list <domain> # List all records
doma dns set <domain> <name> <type> <value> # Set a record
doma dns delete <domain> <name> <type> # Delete a recordOptions:
--ttl <seconds>— TTL for the record (default: 3600)
Nameservers
Manage nameservers for a domain.
doma nameservers list <domain> # List current nameservers
doma nameservers set <domain> <ns1> [ns2] [ns3] [ns4] # Set nameservers (1-4)Aliases: doma ns set, doma ns list, doma ns ls
Only root domains are supported — subdomains cannot have nameservers set.
Config
Show and manage CLI configuration.
doma config # Show current config
doma config set <key> <value> # Set a config value
doma config delete <key> # Remove a config valueValid keys: privateKey, apiKey, apiUrl, chainId, testnet, routingApiUrl
Common Options
All commands support:
-c, --chain <chainId>— Target chain-f, --format <format>— Output format:json,table, orcompact
Programmatic use / scripting
quote, swap, and token accept -q, --quiet to suppress progress output so stdout contains only the final result — safe to pipe into jq or JSON.parse. swap --quiet also requires --yes (non-interactive execution has no TTY to answer the confirmation prompt).
doma swap USDC <name> 10 --yes --quiet --format json | jq '.["Tx Hash"]'Errors still print to stderr.
Development
npm install
npm run dev # Run with tsx
npm run build # Build to dist/
npm run typecheck # Type-check without emitting