dsh-web-search-ddg
aooyoo
Zero-token DuckDuckGo search provider for the DeepSeek Harness (DSH) web seam — local headless browser, no API key, no m…
PROJECT TOPICS
PROJECT README
Terrain prepares the ground so agents don't have to guess where to stand.
Engineering environment management for human developers and AI coding assistants — knowledge as the map, tools as the roads, conventions as the trail markers.
Terrain is a standardized, AI-friendly engineering environment built for the age of AI-assisted development. Point it at a Git repository and it delivers three things:
AGENTS.md, CLIs) so every coding agent reads the project the same way instead of blind-grepping the live repo.Terrain provides both GUI and CLI modes. Through the CLI, you can conveniently integrate engineering knowledge generation and Deepwiki's Q&A functionality into PR and CI/CD pipelines. Human developers use the Tauri desktop app or CLI. For specific usage of the CLI, see Terrain CLI Guides.
| Project overview | Engineering knowledge | DeepWiki Q&A | Agent environment |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
From left to right: project list with freshness scores, auto-generated C4 docs, knowledge-grounded Q&A, and one-command agent tooling setup.

| Pillar | Metaphor | What you get |
|---|---|---|
| Engineering knowledge assets | Map | Dual-track docs in .terrain/ — produced from code, consumed by humans and agents |
| Standardized AI environment | Roads | Skills, CLIs, and AGENTS.md that route agents to the right knowledge and tools |
| Agent enhancement tools | Gear | One-command deployment of CodeGraph, RTK, and preset Skills |
| Audience | Path | Format |
|---|---|---|
| Humans | .terrain/human/ |
Narrative C4 docs with Mermaid diagrams |
| AI agents | .terrain/agent/context.md |
Structured architecture overview (≤ 14 KiB) |
| Source index | .terrain/agent/repomix.md |
Repomix pack — grep/read on demand, not preloaded |
| Domain terms | .terrain/knowledge/ |
Business glossary and internal conventions |
Onboarding to a new codebase usually means days of reading source and stale wiki pages. Terrain compresses that to minutes: register a repo, run initialization, and get a full C4 doc set plus an agent-ready context pack.
| Without Terrain | With Terrain |
|---|---|
| Architecture knowledge scattered across wikis, Slack, and senior engineers | Engineering knowledge assets generated from the actual codebase |
| AI assistants grep the live repo blindly | Agents read context.md first, then targeted repomix slices |
| Docs drift from code on every refactor | Incremental updates + freshness tracking; knowledge travels with Git branches |
| Every team reinvents "how to onboard an AI to our repo" | Env integration installs Skills, CodeGraph, RTK, and AGENTS.md snippets |
Built for:
terrain tools into Claude Code, Codex, OpenCode, or compatible agentsTerrain's knowledge engine is the direct successor of Litho, the AI documentation generator published as deepwiki-rs (1.7k★). Litho proved the core thesis at scale — generate architecture docs from code, keep them in sync, make them agent-ready. Terrain takes that successful practice and hardens it into a platform:
terrain tools instead of guessing.In short: if you liked Litho for docs, Terrain is Litho's knowledge core plus the environment, workflow, and agent bridge around it.
Terrain turns a codebase into a dual-track knowledge base that both people and agents use. Born from Litho (deepwiki-rs, 1.7k★), it keeps the proven doc-generation core and adds incremental, multi-language, agent-connected delivery.
agent/context.md and a grep-friendly repomix.md source pack.terrain tools.The same Litho success story, now incremental, multi-language, and wired to your agents.
A shared "knowledge contract" so every coding agent reads your repo the same way:
AGENTS.md — managed snippets that point agents to the knowledge layers first.One command wires up the toolchain your agents need — no per-repo setup:
bunx codegraph.terrain tools — scan, assets, and ACP access.terrain env apply installs Skills, CLIs, and AGENTS.md in the right dependency order (terrain-knowledge → repomix → codegraph → rtk).Four sequential phases, each producing a reviewable Markdown artifact:
| Phase | Output | Execution |
|---|---|---|
| 1. Requirements | 1.requirements.md |
Native LLM |
| 2. Technical design | 2.tech-design.md |
Native LLM |
| 3. Code generation | 3.implementation.md + repo changes |
ACP agent |
| 4. Code review | 4.code-review.md |
Native LLM |
Session outputs live under ~/.terrain/sdd/{project}/sessions/{id}/outputs/ (local, not versioned).
Git HEAD and dirty-state monitoring score knowledge assets. Agents should down-weight context when freshness_score < 50.
Terrain is an agent-first engineering environment platform. For each Git repository it delivers three coordinated solutions:
| Pillar | Metaphor | What agents get |
|---|---|---|
| Engineering knowledge assets | Map | Structured assets in .terrain/ — produced from code, consumed through layered access |
| Standardized AI environment | Roads | Skills, CLIs, and AGENTS.md that route agents to the right knowledge and tools |
| Development workflow (SDD) | Trail markers | A four-phase convention from requirements through code review |
Knowledge as the map, tools as the roads, conventions as the trail markers.
Humans use the desktop app or CLI; external coding agents (Claude Code, Codex, OpenCode, …) use the same contract via terrain tools (JSON stdout). Assets live in-repo (.terrain/ travels with branches); ~/.terrain/registry.json holds project pointers only.

Dual-track assets from one factory — narrative human/ for people, structured agent/ for machines:
.terrain/
├── agent/context.md macro overview
├── agent/repomix.md grep-friendly source pack
├── human/ engineering knowledge docs (from Litho)
├── knowledge/ domain glossary
└── .meta/freshness.json
Produce (scan/pack are offline; LLM/ACP where noted):
Git ──scan──► index.md
──pack──► repomix.md
──context (LLM)──► context.md
──docs (ACP)──► human/ + .litho-agent/ checkpoints
──track──► freshness.json
Consume — DeepWiki and terrain tools share the same three layers:
| Layer | Source | API |
|---|---|---|
| Macro | agent/context.md |
read-context |
| Meso | human/, knowledge/ |
search, read-doc |
| Micro | agent/repomix.md |
grep-pack → read-pack-file |
When sources conflict: repomix > CodeGraph > context.md > human/. Down-weight macro context when freshness_score < 50.
terrain env apply installs the navigation layer so agents don't improvise:
| Component | Purpose |
|---|---|
| Skills | Standard playbooks — terrain-knowledge → repomix → codegraph → rtk |
| Tools | ~/.terrain/bin/ — CodeGraph, RTK, terrain CLI (terrain tools for ACP) |
| AGENTS.md | Managed snippets — knowledge-first workflow, repomix for code, RTK for shell |
SDD defines a repeatable path; each phase produces a reviewable Markdown artifact:
| Phase | Output | Engine |
|---|---|---|
| Requirements | 1.requirements.md |
Native LLM |
| Tech design | 2.tech-design.md |
Native LLM |
| Codegen | 3.implementation.md + repo changes |
ACP agent |
| Code review | 4.code-review.md |
Native LLM |
The knowledge pipeline uses the same resumable pattern — research checkpoints under .terrain/.litho-agent/.
graph LR
Chan[Desktop · CLI] --> Intel[terrain-agent]
Chan --> Core[terrain-core]
Intel --> Core
Intel --> LLM[LLM]
Intel --> ACP[ACP]
Core --> FS[".terrain/ · Git · registry"]
Core handles scan, pack, search, freshness, and env without an LLM. Agent orchestrates DeepWiki, knowledge generation, SDD, and context generation — lightweight tasks via native LLM, heavy tool-using work via ACP subprocess.
.terrain/ directory (per project){your-repo}/.terrain/
├── index.md # Project index (from scan)
├── agent/
│ ├── context.md # Macro architecture context for agents
│ ├── repomix.md # Source pack (generated, often gitignored)
│ └── meta.json # Pack metadata
├── human/ # Engineering knowledge docs (1.概述.md, 2.架构.md, …)
├── knowledge/ # Domain glossary and conventions
├── .meta/
│ ├── sync.json # Scan sync state
│ └── freshness.json # Asset freshness scores
└── .litho-agent/ # Litho/knowledge research workspace (transient)
Project registration (slug ↔ repo path) is stored locally at ~/.terrain/registry.json — pointers only, not knowledge files.
Terrain composes with the tools your AI workflow already uses:
| Component | Role |
|---|---|
| Claude Code / Codex / OpenCode / ACP agents | Execute knowledge composition, SDD codegen, and tool calls in an isolated process |
| Repomix | Packs source into a grep-friendly index for agents |
| CodeGraph | Symbol callers/callees/impact queries via bunx codegraph |
| RTK | Compresses shell output to save tokens (@terrain-ai/rtk on npm, or ~/.terrain/bin/rtk) |
| Terrain CLI | Scan, assets, terrain tools for ACP (@terrain-ai/cli on npm, or ~/.terrain/bin/terrain) |
| Preset Skills | LLM workflow instructions in preset_skills/ (knowledge, SDD, Ask, Context) |
| DeepWiki / Litho Book | Knowledge-grounded Q&A and Markdown reader, integrated in the desktop UI |
Trust model for coding agents: when sources conflict, repomix source > codegraph > context.md > human docs.
Recommend downloading the pre-compiled software package from the Github Release, ready to use out of the box.
# Clone and install frontend dependencies
git clone https://github.com/sopaco/terrain.git
cd terrain
bun install
# Build Rust workspace (CLI + libraries)
cargo build --release
# CLI binary
./target/release/terrain --help
# Desktop app (development)
bun run dev:app
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。