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
Requires Node.js 18.0.0 or higher.
Getting Started
1. Initialize Your Wallet
~/.dria/config.json. You’ll receive an API key for authenticating requests.
To import an existing wallet:
2. Add Credits
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:
| Field | Env Var | Default | Description |
|---|---|---|---|
privateKey | DKN_PRIVATE_KEY | — | Ethereum private key |
apiKey | DKN_API_KEY | — | API key from registration |
apiBase | DKN_API_BASE | https://inference.dria.co | API base URL |
network | DKN_NETWORK | base | Blockchain network for payments |
Programmatic Usage
The CLI also exports aDknClient class for use in Node.js/TypeScript:
Output Conventions
- Spinners and progress go to stderr, data goes to stdout — pipe-friendly by default.
- Use
--jsonon 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.