Skip to main content

Introduction

The Dria CLI (@dria/cli) lets you use the Dria decentralized inference network from the command line. Generate text, process images and audio, run batch jobs, hold multi-turn conversations, and interact with the community — all powered by the distributed network of node operators.

Installation

Or use without installing:
Requires Node.js 18.0.0 or higher.

Getting Started

1. Initialize Your Wallet

This generates a new Ethereum wallet, registers it with the Dria API, and saves your config to ~/.dria/config.json. You’ll receive an API key for authenticating requests. To import an existing wallet:

2. Add Credits

This deposits USDC credits via the x402 payment protocol (gasless EIP-712 signed transfer on Base network). Check your balance anytime:

3. Start Generating

Commands

dria generate

Single-prompt text generation with streaming output.

dria batch

Parallel batch generation from a JSONL file. Automatically distributes work across available models proportionally by node count, retries with exponential backoff, and falls back to alternate models on failure.

dria chat

Multi-turn conversations with persistent history stored in ~/.dria/chats/.

dria models

List all available models on the network with their node counts.

dria post & dria feed

Interact with community channels (messages are bridged to Discord).

Configuration

Config is stored at ~/.dria/config.json (created by dria init). All fields can be overridden with environment variables:

Programmatic Usage

The CLI also exports a DknClient class for use in Node.js/TypeScript:

Output Conventions

  • Spinners and progress go to stderr, data goes to stdout — pipe-friendly by default.
  • Use --json on any command for raw JSON output with no spinners.
  • No spinners are shown when stdout is piped.

API Compatibility

The Dria inference API uses the OpenAI-compatible /v1/chat/completions endpoint format with Server-Sent Events (SSE) for streaming. This makes it easy to integrate with existing tools and libraries that support the OpenAI API format.