██████╗  ██╗  ██╗ ██╗
██╔══██╗ ██║  ██║ ╚═╝
██║  ██║ ███████║ ██╗
██║  ██║ ██╔══██║ ██║
██████╔╝ ██║  ██║ ██║
╚═════╝  ╚═╝  ╚═╝ ╚═╝
Terminal AI OS
● AI READY
v0.1.0
↓ Scroll

Install

Get DHI running on your machine in minutes

Prerequisites

DHI works on macOS and Linux and requires Go 1.26+, Ollama with qwen2.5:1.5b (default), plus rg, jq, and curl. ddgr + agent-browser power web_search/fetch_url; s-search powers site_search.

Quick install

curl -fsSL https://raw.githubusercontent.com/hrhrprasath/dhi/dhi/install.sh | sh

Or install via Go

go install github.com/hrhrprasath/dhi/cmd/dhi@latest

Build from source

git clone https://github.com/hrhrprasath/dhi.git
cd dhi && go build -o build/dhi ./cmd/dhi
./build/dhi

First run

On first launch, DHI auto-populates ~/.dhi/ with default config, pipeline definitions, and scripts. Ensure Ollama is running with your chosen model — DHI checks health on startup (● READY).

Why DHI?

A fundamentally different approach to AI integration

01

Local Light Models

Built for Qwen 1B/3B via Ollama — runs entirely on your machine. No API costs, no data leaving your laptop, sub-second classification on a Mac Mini M4. Privacy-first by default.

02

Cognitive Sandwich

Three-layer architecture: Intent (LLM classifies input → strict JSON) → Execute (deterministic Go pipelines, zero AI) → Synthesize (LLM formats response). AI is used only where it adds value.

03

Agent vs Harness vs MCP

Agents are autonomous — AI decides what to do and does it. MCP is a protocol for tool exposure. DHI is a harness: AI classifies intent, but deterministic Go code executes — you stay in control.

04

Code in Control

The AI suggests and classifies; it never executes actions directly. All pipelines are pure Go code or auditable bash scripts. Predictable, debuggable, testable. You decide what runs.

05

Extensible by Design

Write a bash script once, add 4 lines to pipelines.yaml, and it’s a new action. No AI retraining, no framework changes. Pipelines can be internal (Go) or external (YAML-defined with script references).

06

Self-Learning & Feedback

Weighted pipeline associations (weight 0.8) with keyword learning and confidence calibration. Correct/incorrect feedback loops improve classification over time without cloud retraining.

07

Topics vs Sessions

Topics are like opencode conversations or ChatGPT threads — they persist history, can be named, searched, forked, and resumed across restarts. Sessions are ephemeral interaction flows within a topic — like a single opencode task or a ChatGPT response turn. Topics live in ~/.dhi/data/topics/; sessions exist only in memory.

How It Works

User Input → Task Queue → LLM ClassifyQwen via Ollama → Execute PipelineDeterministic Go / Bash → LLM SynthesizeSummary for user → Output

Head-to-head comparison

Dimension DHI Harness AI Agent MCP
Who executes? ● Deterministic Go code ● AI decides & executes ● Protocol, no execution
AI scope Classify + synthesize only Full autonomy Tool definition
Extensibility ● YAML + scripts ● Depends on framework ● Server-based
Debuggability ● Full (Go tests + logs) ● Non-deterministic ● Depends on server
Local-first ● 100% local, 1B-3B models ● Usually cloud ● Protocol-agnostic

How to Use?

Navigate the terminal UI, run commands, and manage your AI harness

Basic Flow

Type a command in the input bar → DHI classifies your intent via local LLM → executes the appropriate pipeline → displays the result. All without leaving the terminal.

Getting Help

Press /help (or /? / :h) then Enter to open the help popup — it lists every slash command and keybinding.

Tab Navigation

Press Tab to cycle focus through the panels:

Input  →  Conversation  →  Topics  →  Input  (loop)

When the log popup is open:

Input  →  Conversation  →  Log  →  Input  (loop)

Focused panels are highlighted with an orange border. Use ↑ / ↓ to scroll within the active panel.

Slash Commands

Type these in the input bar and press Enter:

Command Description
/help, /?, :h Open the help popup
/todo Open todo list (active / done tabs)
/schedule Open scheduled tasks (active / completed tabs)
/rss Open RSS reader
/rss add <url> Add a new RSS feed source
/topic, /topics Browse and switch conversation topics
/model, /models Browse and switch AI models
/log, /logs, /l Open log viewer
/new Create a new conversation topic
/fork Fork the current topic into a new one
/resume Switch back to the previous topic
/good Rate the last response positively (trains the model)
/bad Rate the last response negatively
/quit, /q, :q Exit DHI

Auto-Completion

Type / followed by a few characters — matching commands appear below the input. Press Tab to cycle through suggestions, Enter to confirm.

RSS Reader

/rss opens the built-in feed reader. Add sources with /rss add <feed-url> — they are stored as OPML in ~/.dhi/data/rss/feed.opml (override with DHI_RSS_OPML_PATH), so you can import an existing reader export by replacing that file. Feeds refresh in the background while DHI runs.

Three tabs (← / → to switch):

Tab Contents
AI CURATED LLM summary of the latest entries — press s to refresh
RAW Every entry across all feeds
BOOKMARKS Entries you saved with B

Keys inside the reader: ↑ / ↓ navigate, Enter opens the entry URL in your browser, B toggles a bookmark, R removes a feed source, s refreshes the AI summary (or fetches the entry into a topic), Esc closes.

YouTube noise is filtered via ~/.dhi/config.yaml:

rss:
  skip_shorts: true

Inline Commands

Input without a / prefix is sent to the LLM classifier. DHI automatically detects your intent and runs the matching pipeline:

“search for latest AI news” → runs web_search “add buy milk to my todo” → runs todo “schedule meeting at 3pm” → runs schedule

The Name

The story behind the name

DHI stands for Deterministic Harness Intelligence — a Terminal AI OS that keeps you in control. The acronym spells DHI in ASCII art on startup, and the name reflects the project’s philosophy: deterministic execution, harness pattern, and intelligence augmentation rather than replacement.

DHI is your command center: it listens, suggests, and executes your commands with precision.

Deterministic

Every action is defined in Go or bash — predictable, testable, auditable. No AI hallucination in execution.

Harness

A structured framework that wires intent to action. You wear the harness; the AI is your tool, not your replacement.

Intelligence

Local LLMs provide classification, conversation, and synthesis — working for you, not autonomously.

Features

Built-in pipelines that ship with every install

Web Search

ddgr + agent-browser with auto-summarization via LLM

Site Search

Site-scoped search opened in your browser via s-search

Fetch URL

Extract page content via agent-browser with LLM summarization

Open URL

Open any link in the default browser, with unsafe-URL rejection

Todo

Full CRUD manager with persistent JSON storage

Schedule

Natural language time parsing + cron-based recurring tasks

RSS

OPML feed reader with bookmarks, background refresh, and AI-curated summaries

Stocks

Yahoo Finance lookup via curl/jq pipeline

Music

Spotify search + playback (macOS via AppleScript, Linux via xdg-open)

System

Live CPU/RAM/GPU metrics with progress bars

Conversations

Topic-managed chat with auto-summarization context

Customize

Extend DHI without touching Go code

Pipelines — ~/.dhi/pipelines.yaml

Define new actions by adding to the YAML. Each pipeline has a name, action type, and optional weight for self-learning.

# ~/.dhi/pipelines.yaml
pipelines:
  my_command:
    action: bash
    command: scripts/my_script {arg}
    weight: 0.6
    summarize: true

Action Types

Each pipeline action has a type that determines how it executes:

Type What it does Key fields
bash Runs a shell script script, command
http Makes an HTTP request via curl url, method, auth
exec Runs a system command directly command, args
internal Calls a built-in Go handler handler

Examples of each type:

pipelines:
  greet:
    action: bash
    script: scripts/greet {name}

  check_api:
    action: http
    url: https://api.example.com/status
    method: GET
    summarize: true

  deploy:
    action: exec
    command: /usr/local/bin/deploy
    args: ["--env", "staging"]

  todo:
    action: internal
    handler: todo

Scripts — ~/.dhi/scripts/

Bash scripts are referenced by pipeline actions. Drop a new script in ~/.dhi/scripts/ and wire it in pipelines.yaml.

#!/usr/bin/env bash
# ~/.dhi/scripts/my_script
QUERY="$1"
curl -s "https://api.example.com/search?q=$QUERY" | jq '.'

Config — ~/.dhi/config.yaml

Switch AI providers, models, or adjust generation parameters. Ollama is the default; any OpenAI-compatible endpoint works via the ai: block (keys use ${VAR} environment expansion):

# ~/.dhi/config.yaml
ai:
  provider: ollama
  base_url: http://localhost:11434/v1
  model: qwen2.5:1.5b
  max_tokens: 4096
  temperature: 0.7
# Groq
ai:
  provider: groq
  base_url: https://api.groq.com/openai/v1
  api_key: ${GROQ_API_KEY}
  model: llama-3.1-70b-versatile

# OpenRouter
ai:
  provider: openrouter
  base_url: https://openrouter.ai/api/v1
  api_key: ${OPENROUTER_API_KEY}
  model: anthropic/claude-sonnet-4