Skip to content

CLI Reference

The drs CLI manages DRS nodes via the Cloudflare API. It handles initialization, address management, DNS configuration, and deployment.

Global Options

Most commands require Cloudflare credentials:

FlagDescription
--cf-token <token>Cloudflare API token
--account-id <id>Cloudflare account ID
--kv-namespace <id>KV namespace ID (for address/config operations)
--jsonOutput as JSON (for scripting)

Commands

drs init

Initialize a new DRS node. Creates DNS records, KV namespaces, and generates an Ed25519 keypair.

Terminal window
drs init --domain mycompany.com --cf-token <token> [--node-type standard|exchange]

What it creates:

  • KV namespace for addresses
  • KV namespace for config
  • _drs._tcp.mycompany.com SRV record
  • _drskey.mycompany.com TXT record with the public key
  • Initial node config and manifest in KV

Output: Public key, private key, KV namespace IDs, and next steps.

drs add-address

Add a routable address to the node.

Terminal window
drs add-address <local-part> \
--routes '[{"value_type":"USDC","transfer_type":"ethereum","destination":"0x..."}]' \
--cf-token <token> --account-id <id> --kv-namespace <addresses-id>

drs remove-address

Remove an address from the node.

Terminal window
drs remove-address <local-part> \
--cf-token <token> --account-id <id> --kv-namespace <addresses-id>

drs list-addresses

List all configured addresses.

Terminal window
drs list-addresses \
--cf-token <token> --account-id <id> --kv-namespace <addresses-id>

drs update-config

Update the node’s accepted pairs, pathways, or other configuration.

Terminal window
drs update-config \
--accepts '[{"value_type":"USDC","transfer_type":"ethereum","reference":"0x...","sponsor":"circle.com"}]' \
--cf-token <token> --account-id <id> --kv-namespace <config-id>

drs check-dns

Verify that DNS records are correctly configured for a domain.

Terminal window
drs check-dns mycompany.com

Checks for:

  • _drs._tcp SRV record (port 443, valid target)
  • _drskey TXT record (valid base64 public key, 32 bytes)

drs test-resolve

Perform a full end-to-end resolution: DNS discovery, resolve, and signature verification.

Terminal window
drs test-resolve alice@mycompany.com

drs status

Show the current status of a DRS node.

Terminal window
drs status --domain mycompany.com \
--cf-token <token> --account-id <id> --kv-namespace <config-id>

drs rotate-key

Generate a new Ed25519 keypair and update the DNS TXT record.

Terminal window
drs rotate-key --domain mycompany.com --cf-token <token>

After rotation, update the Worker secret:

Terminal window
wrangler secret put DRS_SIGNING_KEY --env mycompany

drs sync

Sync local YAML address files to KV. Useful for managing addresses as code.

Terminal window
drs sync --dir ./addresses \
--cf-token <token> --account-id <id> --kv-namespace <addresses-id>

Address file format (addresses/alice.yaml):

status: active
routes:
- value_type: USDC
transfer_type: ethereum
destination: "0xABC..."
- value_type: ETH
transfer_type: ethereum
destination: "0xABC..."