THcoder
THcoder
Install, use, and fully uninstall THcoder — the Token Harbor coding agent for your terminal.
THcoder
THcoder is the Token Harbor coding agent for your terminal. It runs only against the Token Harbor gateway and the Token Harbor model lineup — your thk_live_ key is the only credential it uses, and all usage is billed to your Token Harbor wallet.
Install
One command, no dependencies (no Node, no Python). It downloads the prebuilt binary for your machine and adds it to your PATH.
macOS / Linux
curl -fsSL https://tokenharbor.ai/install | bash
Windows (PowerShell)
irm https://tokenharbor.ai/install | iex
The binary installs to ~/.thcoder/bin/thcoder (Windows: %USERPROFILE%\.thcoder\bin\thcoder.exe). Open a new terminal so the PATH change takes effect, then run:
thcoder
On first run, paste your thk_live_ key. Get one at API keys.
Usage
Run thcoder inside your project directory. A few things to know:
- The default model is
th-orchestra. You don't pick a model — Orchestra runs plan → build → review automatically: a planner designs the task, one strong executor builds it, then the planner reviews. Images are routed to a vision-capable model. Just describe what you want. - Modes — cycle with the mode selector:
- Build (default) — applies changes; shell and network actions ask first.
- Plan — read-only, makes no edits. Good for "what would you do".
- Yolo — full autonomy: every tool allowed, no confirmation prompts.
- Keys —
tabcycles agents/modes,ctrl+popens the command palette.
Commands
CLI
Run these from your shell:
| Command | What it does |
|---|---|
thcoder | Start the TUI in the current project |
thcoder run "message" | One-shot run with a prompt (non-interactive) |
thcoder models | List available models |
thcoder stats | Show token usage and cost |
thcoder export [sessionID] | Export a session as JSON |
thcoder serve | Start a headless server |
thcoder web | Start the server and open the web interface |
thcoder mcp | Manage MCP (Model Context Protocol) servers |
thcoder agent | Manage agents |
thcoder upgrade | Update to the latest version |
thcoder uninstall | Remove THcoder (see full steps below) |
thcoder debug | Troubleshooting tools |
thcoder --version | Print the version |
thcoder --help | List all commands |
Slash commands (inside the TUI)
Type / to see all of them. The Token Harbor ones:
| Command | What it does |
|---|---|
/login | Sign in (paste your thk_live_ key) |
/logout | Sign out on this machine |
/review | Review the current changes for bugs, edge cases, and security |
/test | Run the project's tests and fix any failures at the root cause |
/commit | Stage changes and write a Conventional Commits message |
/optimize | Find and apply the highest-impact optimization |
/explain | Explain how some code works, for a new contributor |
/plan | Produce a step-by-step implementation plan (no edits) |
/orchestra | Show how routing mapped each role to a model |
/topup | Add balance to your wallet |
/docs | Open this documentation |
Uninstall
THcoder ships a built-in command:
thcoder uninstall
If you want to remove everything by hand — the binary, the PATH entries, and all config/cache/auth (including your stored key and session history) — follow the full steps for your OS.
macOS / Linux
# 1. Remove the binary
rm -rf ~/.thcoder
# 2. Remove config, data, state, cache (settings, auth.json with your
# key, session history, the local database)
rm -rf ~/.config/opencode ~/.local/share/opencode \
~/.local/state/opencode ~/.cache/opencode
# 3. Remove the PATH line the installer added. Open each of these that
# exists and delete the two-line "# THcoder" block
# (export PATH="$HOME/.thcoder/bin:$PATH"):
# ~/.zshrc ~/.bashrc ~/.profile
# For the fish shell, remove the fish_add_path line from:
# ~/.config/fish/config.fish
Then restart your terminal. To confirm it's gone:
command -v thcoder # should print nothing
Windows (PowerShell)
# 1. Remove the binary
Remove-Item -Recurse -Force "$env:USERPROFILE\.thcoder"
# 2. Remove config + data (settings, auth.json with your key, history)
Remove-Item -Recurse -Force "$env:USERPROFILE\.config\opencode" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:USERPROFILE\.local\share\opencode" -ErrorAction SilentlyContinue
# 3. Remove the install dir from your user PATH
$dir = "$env:USERPROFILE\.thcoder\bin"
$p = [Environment]::GetEnvironmentVariable('Path','User')
$new = ($p -split ';' | Where-Object { $_ -ne $dir }) -join ';'
[Environment]::SetEnvironmentVariable('Path', $new, 'User')
Open a new terminal afterward so the PATH change applies.