TUI / CLI PRS

EIN CLI - Product Requirements Specification

Why CLI is Better

  1. Developer-First: Early adopters are devs who live in the terminal
  2. AI Agents: Agents don’t need UI, just commands
  3. Automation: Scriptable, composable, integrable
  4. Speed: Faster to build in 48h
  5. Demo Power: CLI demos look more technical and professional

CLI Experience

Installation

# One-liner everyone loves
curl -fsSL <https://infernet.ai/install.sh> | bash
 
# Or via npm
npm install -g @infernet/cli
 

Main Commands

For Providers

# Initialize node
$ infernet init
Initializing Infernet node...
Wallet address: 0x742d35Cc6634C0532925a3b844Bc9e7595f7F8e0
Config saved to ~/.infernet/config.json
 
# Add model
$ infernet add llama-3.3 --price 0.0001
Added llama-3.3 at $0.0001 USDC/token
Downloading model weights... [████████████] 100%
 
# Start node
$ infernet start
Infernet node running on port 8402
Dashboard: <http://localhost:8402/stats>
Earnings: $0.00 USDC
 
# View real-time status
$ infernet status --watch
┌─────────────────────────────────────────────┐
 Node: 0x742d...F8e0    Status: Online
├─────────────────────────────────────────────┤
 Model Price Requests Earned│
├──────────────┼──────────┼──────────┼───────┤
 llama-3.3 $0.0001 1,247 $1.25
 mistral-7b $0.00008 892 $0.71
 stable-diff $0.01 43 $0.43
├──────────────┴──────────┴──────────┴───────┤
 Total: $2.39 USDC       Uptime: 4h 32m
└─────────────────────────────────────────────┘
 

For Consumers

# Simple query
$ infernet query "Explain blockchain in 20 words"
Finding best node for llama-3.3...
Node 0x8a1f selected ($0.0001/token)
Estimated cost: ~$0.002 USDC
Payment sent via X402
 
Blockchain is a digital, decentralized, and immutable ledger
where transactions are recorded securely and transparently.
 
Cost: $0.0019 USDC | Tokens: 19 | Latency: 124ms
 
# Interactive chat
$ infernet chat --model claude --max-price 0.0005
Infernet Chat (claude, max $0.0005/token)
Balance: 12.47 USDC
 
You: How does Ethereum work?
AI: Ethereum is a blockchain platform that allows executing...
[Cost: $0.0234 | Node: 0x3f2a]
 
You: ^C
Session summary: $0.0234 spent, 234 tokens
 
# Streaming for apps
$ infernet stream "Write a poem about AI" --json
{"chunk": "In", "node": "0x3f2a", "cost": 0.0001}
{"chunk": " silicon", "node": "0x3f2a", "cost": 0.0002}
{"chunk": " dreams", "node": "0x3f2a", "cost": 0.0003}
 

Advanced Commands

# List all nodes with a model
$ infernet nodes --model gpt-4 --sort price
┌──────────────┬─────────┬─────────┬──────────┬────────┐
 Node Price Latency Rep Status
├──────────────┼─────────┼─────────┼──────────┼────────┤
 0x3f2...8b1 $0.0008 89ms 4.9 Live
 0x8a1...3c4 $0.0009 124ms 4.8 Live
 0x5d4...7e9 $0.0012 156ms 4.7 Busy
└──────────────┴─────────┴─────────┴──────────┴────────┘
 
# Benchmark nodes
$ infernet bench --model llama-3.3 --iterations 10
Benchmarking 5 nodes with 10 iterations each...
 
Results:
1. 0x3f2: Avg 124ms, $0.0001/tok, 0 failures
2. 0x8a1: Avg 156ms, $0.00009/tok, 1 failure
3. 0x5d4: Avg 189ms, $0.00012/tok, 0 failures
 
# Monitor spending
$ infernet wallet
Wallet: 0x742d35Cc6634C0532925a3b844Bc9e7595f7F8e0
Balance: 8.32 USDC (Base)
 
Usage (last 24h):
├─ Total spent: $4.67 USDC
├─ Requests: 127
├─ Avg cost/request: $0.0368
└─ Most used: llama-3.3 (89 requests)
 
# Export history
$ infernet history --format csv > usage.csv
Exported 1,247 transactions to usage.csv
 

For Developers (SDK)

# In your project
$ npm install @infernet/sdk
 
# Integration example
$ infernet examples
 
// api.js
import { Infernet } from '@infernet/sdk';
 
const infernet = new Infernet({
  wallet: process.env.WALLET_SECRET, // Wallet API v2
  maxPrice: 0.0005 // maximum price per token
});
 
// Auto-select cheapest node
const response = await infernet.query({
  model: 'llama-3.3',
  prompt: 'Generate a README for my project'
});
 
// Or specify node
const response = await infernet.query({
  node: '0x3f2a...',
  prompt: 'Explain quantum computing'
});
 

CLI Use Cases

1. Autonomous AI Agent

# Agent that monitors crypto prices and generates reports
while true; do
  PRICE=$(curl -s <https://api.coinbase.com/btc>)
  ANALYSIS=$(infernet query "Analyze this BTC price: $PRICE")
  echo "$ANALYSIS" >> daily-report.txt
  sleep 3600
done
 

2. CI/CD Pipeline

# .github/workflows/ai-review.yml
- name: AI Code Review
  run: |
    DIFF=$(git diff HEAD^)
    infernet query "Review this code: $DIFF" > review.md
 

3. Batch Processing

# Process 1000 documents
cat documents.txt | while read doc; do
  infernet query "Summarize: $doc" >> summaries.txt
done
 

Interactive Demo

Terminal 1: Provider

$ infernet init --demo
Demo mode: Using mock GPU
Node initialized: 0xDEMO1
 
$ infernet add llama-3.3 --price 0.0001
$ infernet start --verbose
Node online at <http://localhost:8402>
Waiting for requests...
 
[12:34:56] Received request from 0xABC...
[12:34:56] Processing 45 tokens...
[12:34:57] Payment verified: $0.0045 USDC
[12:34:57] Inference complete in 892ms
 

Terminal 2: Consumer

$ infernet chat --demo
Demo mode: Using test USDC
Demo balance: 100.00 USDC
 
You: Give me 3 Web3 startup ideas
Finding 3 nodes, selecting cheapest...
Paying 0xDEMO1 via X402...
 
AI: 1. DeFi for international remittances...
    2. NFTs for educational credentials...
    3. DAO for collective financing...
 
Cost: $0.0087 | Node: 0xDEMO1 | 87 tokens
 

Terminal 3: Monitor

$ infernet explore --live
Infernet Network Explorer
 
[LIVE FEED]
12:34:57 | 0xABC paid 0xDEMO1 | $0.0087 | 87 tokens
12:34:58 | 0xDEF paid 0xDEMO2 | $0.0156 | 195 tokens
12:34:59 | New node 0xDEMO3 joined | llama-3.3 @ $0.00008
 
Network Stats:
├─ Active Nodes: 3
├─ Total Volume (1h): $47.82 USDC
├─ Avg Response Time: 156ms
└─ Requests/min: 24.7
 

Why This CLI Will Win

  1. Technically Impressive:
    • Well-designed CLI demonstrates expertise
    • Easy to demo live
    • Looks “hacker” and professional
  2. Real Use Cases:
    • Developers can integrate it NOW
    • AI agents can use it
    • Scriptable for automation
  3. Perfect Demo:
    • 3 terminals showing the complete flow
    • Real-time metrics
    • Visible X402 payments
  4. Hackathon-Friendly:
    • Faster to build than a web UI
    • Fewer potential bugs
    • Focused on core functionality

Implementation (48h)

Day 1

  • Basic CLI with core commands
  • X402 integration for payments
  • Working provider node
  • Registry contract on Base

Day 2

  • Complete consumer client
  • JavaScript SDK
  • Polished end-to-end demo
  • Documentation and video

Demo Script (3 min)

  1. Setup (30s): 3 terminals side by side
  2. Provider (30s): infernet init && infernet start
  3. Consumer (60s): Interactive chat with payments
  4. Monitor (30s): Show network activity
  5. Code (30s): 5 lines to integrate
  6. Vision (30s): “Every GPU earning, every app with AI”

The CLI is PERFECT because:

  • It aligns with the technical hackathon audience
  • It demonstrates capabilities without UI distractions
  • It’s what early adopters would actually use
  • It looks impressive in live demos

See also: tui-v1, EIN Spec, project-architecture, submission

Shall we start building?