प्रोजेक्ट की संरचना

app/ डायरेक्टरी, text.config.ts और text CLI।

app/ में फ़ोल्डर रूट तय करते हैं, और विशेष फ़ाइलें हर रूट का UI तय करती हैं।

फ़ोल्डर

फ़ोल्डरउद्देश्य
appरूट, लेआउट और रूट हैंडलर
libसाझा मॉड्यूल, जिनकी रूटिंग नहीं होती
publicस्टैटिक एसेट

रूटिंग फ़ाइलें

फ़ाइलउद्देश्य
layout.tsxसेगमेंट का साझा UI
page.tsxरूट की जा सकने वाली स्क्रीन
loading.tsxSuspense फ़ॉलबैक
error.tsxएरर बाउंड्री
not-found.tsxकिसी रूट से मेल न खाने वाले URL
route.tsAPI एंडपॉइंट
app/├── layout.tsx            → shared shell├── page.tsx              → /├── sessions/│   ├── page.tsx          → /sessions│   └── [id]/page.tsx     → /sessions/:id└── api/health/route.ts   → GET /api/health

डायनामिक रूट

फ़ोल्डरURLparams
[id]/sessions/42{ id: "42" }
[...slug]/docs/a/b{ slug: ["a", "b"] }

text.config.ts

text.config.tsts
import { defineConfig } from "@textjs/app";export default defineConfig({  title: "Acme",  viewport: { width: 120, height: 36, theme: "geistDark" },  hints: [{ keys: "↑ ↓", label: "count" }],});
विकल्पडिफ़ॉल्टविवरण
title""पेज और FocusPad का शीर्षक
viewportकंसोल में फ़िट, वरना 120×36responsive (डिफ़ॉल्ट true), फ़ॉलबैक width × height, theme
hints[]पेज के FocusPad पर दिखाई जाने वाली दो या तीन कुंजियां
actionpress <first hint>फ़ोकस मिलने पर क्या करें, जैसे "type a prompt"
devIndicatorstrueकंसोल में डेव ओवरले ([▼])
focusHinttrueपेज पर फ़ोकस न होने पर कंसोल की आख़िरी पंक्ति के ऊपर “कीबोर्ड इस्तेमाल करने के लिए पेज पर क्लिक करें”
rewrites[]रीराइट और प्रॉक्सी
ansi{ cols: 80, rows: 24 }curl और टर्मिनल क्लाइंट के लिए फ़्रेम का आकार, या उन्हें HTML सर्व करने के लिए false

CLI

कमांडविवरण
text devFast Refresh के साथ डेव सर्वर
text buildप्रोडक्शन बिल्ड
text startबिल्ड और रूट हैंडलर सर्व करें
text runऐप को टर्मिनल में रेंडर करें (टर्मिनल)
text mcpकोडिंग एजेंट को ऐप सर्व करें (MCP)
GitHub पर यह पेज एडिट करें