Project Structure

The app/ directory, text.config.ts and the text CLI.

Folders in app/ define routes, and special files define the UI for each route.

Folders

FolderPurpose
appRoutes, layouts and route handlers
libShared modules, not routed
publicStatic assets

Routing files

FilePurpose
layout.tsxShared UI for a segment
page.tsxA routable screen
loading.tsxSuspense fallback
error.tsxError boundary
not-found.tsxUnmatched URLs
route.tsAPI endpoint
app/├── layout.tsx            → shared shell├── page.tsx              → /├── sessions/│   ├── page.tsx          → /sessions│   └── [id]/page.tsx     → /sessions/:id└── api/health/route.ts   → GET /api/health

Dynamic routes

FolderURLparams
[id]/sessions/42{ id: "42" }
[...slug]/docs/a/b{ slug: ["a", "b"] }

text.config.ts

text.config.tsts
import { defineConfig } from "@textjs/next";export default defineConfig({  title: "Acme",  viewport: { width: 120, height: 36, theme: "geistDark" },  hints: [{ keys: "↑ ↓", label: "count" }],});
OptionDefaultDescription
title""Page and FocusPad title
viewportfit console, else 120×36responsive (default true), fallback width × height, theme
hints[]Two or three keys shown on the page's FocusPad
actionpress <first hint>What to do once focused, e.g. "type a prompt"
devIndicatorstrueIn-console [▼] pill
rewrites[]Rewrites and proxies

CLI

CommandDescription
text devDev server with Fast Refresh
text buildProduction build
text startServe the build and route handlers