⚡ xdh (xdharness)
Autonomous Terminal Agent Harness & TUI
Cross-platform intelligence for Android Termux, Linux, macOS, and Windows
Features • Installation • Quick Start • Slash Commands • Documentation & Wiki • Architecture • Contributing
🌟 Highlights
xdh is a lightweight, high-performance terminal agent harness and Text User Interface (TUI) built for autonomous code generation, system exploration, and agentic workflows. Designed with first-class support for Android Termux as well as standard desktop operating systems.
██╗ ██╗██████╗ ██╗ ██╗
╚██╗██╔╝██╔══██╗██║ ██║
╚███╔╝ ██║ ██║███████║
██╔██╗ ██║ ██║██╔══██║
██╔╝ ██╗██████╔╝██║ ██║ xdharness v1.0.2
🚀 Features
- 🖥️ 3-Segment Layout: Real-time context header (tokens, RAM, latency, provider/model), scrollable history viewport with collapsible blocks, and dynamic multi-line composer.
- 🎯 Reusable Skills System: Built-in
create_skill&call_skillengine. Define, discover, and run skills via/skill list,/skill run <name>, or autonomous agent calls. - 🤖 Multi-Agent Orchestration: Built-in
create_agent&spawn_agents. Launch multiple specialized subagents (researcher, coder, tester, reviewer, custom personas) concurrently in parallel threads to solve tasks cooperatively. - 🔌 Dynamic Plugin Management: Add, install from git repositories, delete, and manage community or personal plugins via
/pluginand autonomous tool injection intoTOOLS_SPEC. - ❓ Interactive User Question Prompting: Agents can invoke
ask_questionwith selectable options to clarify ambiguity during execution, awaiting user input before proceeding. - ⚡ Mid-Run User Guidance Interruption: Send a message or press
ESC/Ctrl+Cwhile an agent is executing to immediately pause, incorporate guidance (e.g. "don't do that, do this instead"), and pivot smoothly. - 🛡️ Fault-Tolerant Resilience: 5-stage connection retry backoff (increasing by +5s intervals: 5s, 10s, 15s, 20s, 25s) with automatic failover between LLM providers.
- ♾️ Unconstrained Autonomous Execution: Removed artificial tool round limits for complex, hundreds-step autonomous pipelines.
- 🎨 7 Curated Color Palettes:
tokyo_night,dracula,catppuccin,monokai,nord,cyberpunk, andgruvbox. - 📱 Mobile & Termux First: Smooth step-scroll animation for touch gestures, compact mini-banners for narrow viewports (<70 cols), and zero heavy C-extension dependencies.
- 🧠 Context Optimization: Automatic message history compaction when nearing token capacity thresholds.
📦 Installation
From Source (Git)
git clone https://github.com/PwnedBytes0x1/xdh.git
cd xdh
pip install -r requirements.txt
pip install -e .
Direct Execution
python3 -m xdh --version
Termux Quick Setup
pkg update && pkg install python git -y
git clone https://github.com/PwnedBytes0x1/xdh.git
cd xdh
pip install -r requirements.txt
ln -s $(pwd)/xdh.py $PREFIX/bin/xdh
chmod +x $PREFIX/bin/xdh
xdh
⚡ Quick Start
-
Launch
xdh:xdh
-
Configure Your Provider & Key: Type
/settingsinside the interface or edit~/.xdharness/config.json. You can switch providers dynamically:xdh ❯ /provider openrouter xdh ❯ /model anthropic/claude-3.5-sonnet
-
Interact: Type plain language prompts to instruct the agent to inspect files, execute tests, refactor code, or run background builds.
⌨️ Slash Commands
| Command | Description | Example |
|---|---|---|
/settings |
Open interactive settings & quick toggles | /settings theme dracula |
/provider |
Switch active provider | /provider openai |
/model |
Switch model for active provider | /model gpt-4o |
/theme |
Switch color theme palette | /theme catppuccin |
/tools |
Enable or disable agent function tools | /tools on or /tools off |
/thinking |
Toggle live thought/reasoning token streaming | /thinking on |
/diff |
Inspect staged file diffs proposed by agent | /diff |
/apply |
Apply pending unified diffs to files | /apply |
/tasks |
List, inspect, or kill background tasks | /tasks list / /tasks logs <id> |
/git |
Execute git status, diff, or commit directly | /git status |
/scratch |
Access or update persistent scratchpad memo | /scratch set <notes> |
/tree |
Print directory tree of current workspace | /tree |
/index |
Build or query workspace keyword index | /index build |
/copy |
Copy last response or code block to clipboard | /copy |
/undo |
Roll back latest file edit from backups | /undo |
/clear |
Clear viewport history (or Ctrl+L) |
/clear |
/help |
Show command reference table | /help |
/exit |
Save session state and exit (or Ctrl+Q) |
/exit |
⌨️ Keybindings
Tab: Auto-complete slash command / accept ghost suggestion.Right Arrow: Accept ghost suggestion at line end.Up / Down: Navigate history or smooth-scroll conversation viewport.Ctrl+T: Cycle color themes dynamically.Ctrl+P: Cycle configured AI providers.Ctrl+O: Toggle block collapse (compact vs expanded summary).Ctrl+L: Clear current viewport.Ctrl+C: Interrupt running generation / exit.Ctrl+Q: Save session and quit.
📚 Documentation & Wiki
Detailed guides and specifications are organized in docs/wiki/:
- 🏠 Home & Overview: Product overview and architecture.
- 🚀 Getting Started & Installation: Step-by-step setup across Termux, Linux, macOS, and Windows.
- ⚙️ Configuration & Providers: API keys, model parameters, custom endpoints, and auto-failover.
- 🛠️ Tools & Workflows: Deep dive into diff generation, sandbox execution, web search, and tasks.
- 🎨 Theming & UI Customization: Theme reference and customizing styles.
- 🔌 Extensibility & Architecture: Harness internals, compaction, streaming protocols, and lifecycle.
🏗️ Architecture
flowchart TD
User([User Terminal / Touch]) --> UI[XDHApp TUI Container]
UI --> Layout[3-Segment Layout: Header, Viewport, Composer]
UI --> Engine[XDHarness Core Engine]
Engine --> ProviderRouter[Provider Router & Failover]
ProviderRouter --> LLM[Streaming API / Ollama / OpenAI / OpenRouter]
Engine --> ToolManager[Autonomous Tool Execution Engine]
ToolManager --> Filesystem[(Filesystem & Atomic Backups)]
ToolManager --> Shell[Subprocess Shell & BG Tasks]
ToolManager --> Web[DuckDuckGo / Web Fetcher]
🤝 Contributing & Community
Contributions are welcome! Please review our community guidelines before getting started:
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xdharness-1.0.2.tar.gz.
File metadata
- Download URL: xdharness-1.0.2.tar.gz
- Upload date:
- Size: 47.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22b7776d19fe9fc2c0308d1ef4b514121157f393e0c60e23c0a3b9804ce4ca01
|
|
| MD5 |
d061434427459f5223a5a7ecb4bd9d90
|
|
| BLAKE2b-256 |
1c3c2b691a64c13bfad78c35ae762b10c98fbac098b008ae7cfd19954b63a7b9
|
Provenance
The following attestation bundles were made for xdharness-1.0.2.tar.gz:
Publisher:
publish.yml on PwnedBytes0x1/xdh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xdharness-1.0.2.tar.gz -
Subject digest:
22b7776d19fe9fc2c0308d1ef4b514121157f393e0c60e23c0a3b9804ce4ca01 - Sigstore transparency entry: 2750860443
- Sigstore integration time:
-
Permalink:
PwnedBytes0x1/xdh@e7ec84531d43fdffdd9b69cb899f064c4c75bb7a -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/PwnedBytes0x1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7ec84531d43fdffdd9b69cb899f064c4c75bb7a -
Trigger Event:
release
-
Statement type:
File details
Details for the file xdharness-1.0.2-py3-none-any.whl.
File metadata
- Download URL: xdharness-1.0.2-py3-none-any.whl
- Upload date:
- Size: 44.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a04c79d4699662fa0dfb709a9d3ace349a5346935d86d5f944a5fc8f0f159642
|
|
| MD5 |
f3091afdd63bf2a888837ff72997eb9a
|
|
| BLAKE2b-256 |
c01d893edf7e254262e92bf9f81f9b8aaf31bf93598887c4850391e5e7f3b2f7
|
Provenance
The following attestation bundles were made for xdharness-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on PwnedBytes0x1/xdh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xdharness-1.0.2-py3-none-any.whl -
Subject digest:
a04c79d4699662fa0dfb709a9d3ace349a5346935d86d5f944a5fc8f0f159642 - Sigstore transparency entry: 2750860494
- Sigstore integration time:
-
Permalink:
PwnedBytes0x1/xdh@e7ec84531d43fdffdd9b69cb899f064c4c75bb7a -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/PwnedBytes0x1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7ec84531d43fdffdd9b69cb899f064c4c75bb7a -
Trigger Event:
release
-
Statement type: