This guide takes you from a fresh clone to your first Thai coding request. By the end you will have built the CLI, passed the startup preflight gate, configured your Typhoon credential, and sent a task to the agent. Each step below maps to a concrete action you can verify in your terminal.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Temicide/thcode/llms.txt
Use this file to discover all available pages before exploring further.
Check prerequisites
Before building, confirm both prerequisites are in place. Open a PowerShell 7 (Expected output (versions may be newer):You need Node.js 22 or newer and PowerShell 7.4 or newer (
pwsh.exe) session in Windows Terminal and run:pwsh.exe). If either check fails, install the missing prerequisite before continuing:- Node.js: download from nodejs.org — Node.js 24 LTS is the recommended baseline.
- PowerShell 7: install via WinGet with
winget install Microsoft.PowerShell.
Build the CLI
Follow the Installation guide to build from source. In brief:When
npm test passes, the compiled entry point is at dist/index.js and the build is ready.Run thcode and pass the preflight gate
Start the interactive UI from inside the repository or project directory you want thcode to work on:Before Ink or React loads, a startup preflight gate runs synchronously. It executes five probes in order and exits with a typed result if any hard blocker is found:
A successful preflight leaves you at the interactive UI. You will see the status bar, an empty transcript area, and the prompt composer at the bottom of the screen.
What the preflight gate checks
What the preflight gate checks
The gate runs the following probes in sequence. The first hard failure short-circuits the rest.
If all probes pass and the output mode is If a hard blocker fires, the gate emits a typed diagnostic to Exit codes are deterministic:
| # | Probe | Hard blocker? |
|---|---|---|
| 1 | Platform + shell — win32/pwsh.exe or darwin/zsh; Git Bash, WSL, and cmd.exe are rejected | Yes |
| 2 | Node version — must be >=22 | Yes |
| 3 | Output mode — must be an interactive TTY (not redirected/headless) | Yes |
| 4 | Local store posture — SQLite state directory availability | Best-effort |
| 5 | Credential store posture — OS credential store reachability | Best-effort |
interactive, the gate emits a one-line safe summary and falls through to main():stderr and exits before importing Ink. For example, running under Node 20 produces:0 (SUCCESS), 20 (BLOCKED), 30 (probe FAILED).Configure your Typhoon credential
Typhoon is the primary reasoning provider. On first run (or whenever no key is stored), thcode will begin credential onboarding automatically.The onboarding flow:Once the health check passes, the status bar will show the provider as active. You can re-inspect credential and provider state at any time with
- Prompts for your Typhoon API key — input is masked; the key is never written to disk as plaintext.
- Stores the key in the Windows OS credential store — the DPAPI-backed local storage means the key is tied to your Windows user account and not accessible to other users on the machine.
- Runs a health check — thcode contacts the Typhoon endpoint and confirms it is reachable and the key is valid before proceeding.
Keep your Typhoon key out of source control. thcode is designed to obtain keys through its credential-store interface rather than from configuration files, environment variables written to
.env, logs, or session data./status.Send your first task
You are now in the interactive UI. New sessions open in Build mode with the Manual permission profile — the most conservative setting, where every mutating action requires your approval.Type a Thai or English coding request in the prompt composer and press Or in English:thcode will send the request to Typhoon, stream the reasoning back into the transcript, and — if it proposes any file changes — ask for your approval before applying them (in Manual mode).
Switch to Plan mode if you want thcode to inspect and describe without making any changes:
Commands are parsed through a fixed grammar. Shell expansion, command substitution, and arbitrary executable dispatch are intentionally refused.Check session status:The status output includes the active work mode, provider name and health, permission profile, and context state.Get help with the command grammar:Quit the session:Press
Enter to submit:Switching work modes
| Action | Effect |
|---|---|
Shift+Tab | Cycles between Plan and Build |
/plan | Switches to read-only Plan mode |
/build | Switches back to mutating Build mode |
Useful commands
Full interactive command reference
Full interactive command reference
| Command | Purpose |
|---|---|
/help | List the supported command grammar |
/status | Show current mode, provider, health, and context state |
/plan | Switch to read-only Plan work mode |
/build | Switch to mutating Build work mode |
/permissions | Inspect the active permission matrix |
/models | Inspect the selected model configuration |
/tools | Inspect catalog and diagnostic controls |
/context | Inspect active model context |
/usage | Show cumulative provider usage |
/rollback | Inspect rollback checkpoints |
/recover | Inspect interrupted operations |
Ctrl+C to exit cleanly.What to Explore Next
Work Modes
Understand the full difference between Plan and Build mode, and when each is the right choice.
Permission Profiles
Move beyond Manual to Assisted or Full Access once you are comfortable with how thcode handles approvals.
AI for Thai Overview
Discover the catalogued Thai specialist services available for OCR, speech-to-text, and more.
Introduction
Go back to the full architecture overview: agent loop, provider registry, and project layout.