Skip to main content

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.

thcode is a Thai-first terminal coding agent that explores how Thai language models can support practical, multi-step software engineering workflows. It goes beyond conversation — it can inspect a workspace, formulate a plan, and carry out guarded coding tasks under explicit developer approval. The initial provider integration is Typhoon, with the architecture designed to accommodate additional Thai reasoning services as they mature.

Agent Loop Architecture

thcode separates two concerns that other coding agents often blend together: local execution (reading files, applying patches, running tests) and remote reasoning (choosing what to do next). The local agent loop runs on your machine, manages permissions, enforces workspace boundaries, and coordinates tools. Remote reasoning is handled by the configured provider — Typhoon in the current release — over its OpenAI-compatible API endpoint. The provider registry includes placeholder adapters for Pathumma, OpenThaiGPT, and ThaLLE; those adapters do not yet have configured endpoints. A configured key alone does not mean a provider is ready: thcode performs explicit health checks on startup and fails closed when configuration, consent, or authority is missing.
The interactive terminal UI is built with React and Ink. The headless agent core — provider adapters, the agent loop, Work Mode enforcement, Permission Profiles, context construction, and session persistence — is kept entirely independent of Ink so future desktop, web, or IDE clients can reuse it.

Work Modes

Every session operates in exactly one work mode at a time.

Plan Mode

Read-only. thcode can inspect your workspace, search files, and describe proposed changes — but it cannot apply patches, run shell commands, or mutate state. Use Plan when you want to understand a codebase or draft an approach safely.

Build Mode

Mutating. thcode can apply file changes, execute shell commands, and run tests within the boundaries set by the active Permission Profile. New sessions always start in Build mode. Switch modes at any time with Shift+Tab, /plan, or /build.

Permission Profiles

Permission profiles determine how much autonomy thcode has when executing actions in Build mode. New sessions always start with the Manual profile.
ProfileBehavior
ManualEvery file write, shell command, and deletion requires explicit approval before execution.
AssistedLow-risk operations (reads, non-destructive writes within the workspace) proceed automatically; destructive or high-risk operations still require approval.
Full Accessthcode proceeds without per-effect prompts, within workspace containment rules. Use only in trusted, isolated environments.
Inspect or change the active profile at any time with the /permissions command inside an interactive session.

AI for Thai Catalog

thcode ships a discoverable catalog of specialist Thai-language AI services. The catalog makes these services inspectable — you can see what is available, its capability, and its status — before committing to any invocation. Specialist use requires a separately configured AI for Thai credential, an available health state, and explicit transfer consent.
ServiceCapabilityStatus
T-OCRRecognize Thai text in imagesCatalogued
Speech-to-TextTranscribe Thai audioCatalogued
Extract AddressParse Thai free-text addressesCatalogued
Named Entity RecognitionIdentify people, places, and organizationsCatalogued
“Catalogued” means a service is known and inspectable by thcode. It is not a guarantee that every service is configured, entitled, or ready for live invocation in your environment.

Project Layout

The repository contains three sub-projects at different stages of maturity.
.
├── cli/          # Supported TypeScript + Ink terminal application
│   ├── src/core/ # Headless agent, policy, provider, storage, and tool core
│   ├── src/ui/   # React/Ink terminal interface
│   ├── test/     # Offline Vitest suite
│   └── catalog-manifest.json
├── client/       # Early-stage Next.js web scaffold (not part of CLI release)
├── server/       # Early-stage Express/Prisma API scaffold (not part of CLI release)
└── docs/         # Architecture decisions and discovery material
cli/ is the only supported release path. client/ and server/ are separate early-stage web and API scaffolds that are not part of the CLI release and are not documented here.

Prototype Status and Scope

thcode is an active prototype. The supported product surface is the Windows-first CLI. The controlled agent loop, provider registry, permission policy engine, workspace protections, local inspection and mutation pathways, specialist-service architecture, session and context governance, and rollback foundations are all present — but some capabilities remain intentionally conditional on credentials and service availability. The interactive experience continues to evolve. The Windows-first scope is a deliberate decision (ADR 0008): building cross-platform credential stores, shell adapters, path handling, and terminal behavior in parallel would increase risk during the prototype phase. macOS and Linux are planned in that order after the Windows baseline is proven.

Where to Go Next

Quickstart

Build the CLI, pass the preflight check, configure your Typhoon key, and run your first Thai coding task.

Work Modes

Understand the difference between Plan and Build, when to use each, and how mode switching affects the agent’s capabilities.

Permission Profiles

Explore Manual, Assisted, and Full Access profiles and how per-effect authorization protects your workspace.

AI for Thai Overview

Browse the catalogued Thai specialist services — OCR, speech-to-text, address extraction, and NER.

Build docs developers (and LLMs) love