Repolode
huiliyi37

huiliyi37/Tianshu-harness

A terminal and desktop coding agent runtime that keeps goals, evidence and verification outside the chat history, built around a cognitive execution layer called CVM.

Open-source alternative to:Claude Code

Stars
1,145
Forks
86
Open issues
19
Last commit
9 hours ago

What is it?

Tianshu Harness is a TypeScript coding agent runtime with a terminal TUI, a desktop app and a VS Code extension sharing one core. It places a layer called CVM (Cognitive Virtual Machine) between the model and the project, so task goals, state, evidence, permissions and stop conditions are tracked by the runtime rather than only by the conversation history.

The main workflow centers on a per-task contract and a delivery gate named deliver_task. A task is marked complete only when test results, diffs or verification commands serve as evidence; otherwise the delivery is blocked. Runtime hooks run across five stages of each turn to detect loops, idle tool calls and edit failures, and a status dashboard (/cockpit) shows verification, cost and cache metrics.

The project supports 25 built-in model provider presets plus any OpenAI-compatible endpoint, and includes sub-agent commands, a prefix-caching engine, plan mode, MCP and skills support, and a permission system with sandboxed writes and path-traversal protection.

Key features

  • 01Per-task contracts record goals, scope and success criteria outside the chat history.
  • 02A delivery gate marks work GREEN, YELLOW or RED based on tests, diffs and verification evidence.
  • 03Runtime hooks detect convergence problems, idle loops and edit failures across each turn.
  • 04Built-in support for 25 model provider presets and OpenAI-compatible endpoints.
  • 05Terminal TUI, desktop app and VS Code extension share one agent core.
  • 06Permission modes, sandboxed writes and protection for sensitive files and destructive commands.

Use cases

  • Running a multi-step coding task in a repository and requiring test evidence before accepting the result.
  • Using DeepSeek or other OpenAI-compatible models in a terminal-based coding workflow.
  • Running the agent headlessly from scripts or CI with NDJSON event output.
  • Tracking token cost and prefix cache hit rate on long coding sessions.

Quick start

  1. 1

    Install the terminal CLI globally with npm (Node.js 24+)

    npm install -g tianshu-harness
  2. 2

    Start the tianshu CLI and wait for the prompt; the first run opens the /connect setup wizard

    tianshu

Things to know

  • The desktop app is not notarized on macOS, so first launch may need an xattr workaround.
  • Linux desktop builds need glibc 2.35+ and WebKit2GTK, and Wayland is not verified.
  • Its cache-savings figures come only from DeepSeek sessions in a small 5-task pilot.

Topics

FAQ

What is Tianshu-harness?
A terminal and desktop coding agent runtime that keeps goals, evidence and verification outside the chat history, built around a cognitive execution layer called CVM. Tianshu Harness is a TypeScript coding agent runtime with a terminal TUI, a desktop app and a VS Code extension sharing one core. It places a layer called CVM (Cognitive Virtual Machine) between the model and the project, so task goals, state, evidence, permissions and stop conditions are tracked by the runtime rather than only by the conversation history.
Is Tianshu-harness free to use? What license does it have?
Tianshu-harness is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is Tianshu-harness still maintained?
Actively maintained. The last commit to Tianshu-harness was on Oct 22, 2026.
What can I use Tianshu-harness for?
Running a multi-step coding task in a repository and requiring test evidence before accepting the result. Using DeepSeek or other OpenAI-compatible models in a terminal-based coding workflow. Running the agent headlessly from scripts or CI with NDJSON event output. Tracking token cost and prefix cache hit rate on long coding sessions.
How do I install Tianshu-harness?
Install the terminal CLI globally with npm (Node.js 24+): npm install -g tianshu-harness Start the tianshu CLI and wait for the prompt; the first run opens the /connect setup wizard: tianshu
Where can I get Tianshu-harness?
The source code and installation instructions are on GitHub: https://github.com/huiliyi37/Tianshu-harness

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects