CLI Reference
Complete reference for the Tkeron command-line interface.
Installation
Requirements: Bun runtime
curl -fsSL https://bun.sh/install | bash
bun install -g tkeron
This installs the tk command globally.
Commands
tk (no arguments)
Display the Tkeron banner with version information.
tk build
Build your project by processing source files into static output.
Aliases: b
tk build
Convention:
- Source directory:
websrc/(relative to current directory) - Output directory:
web/(sibling ofwebsrc/)
Examples:
tk build
tk b
Build Process:
- Copies source to temp directory
- Runs
.pre.tsfiles (pre-rendering) - Iterative component processing (up to 10 iterations):
- Processes
.com.tscomponents (highest priority) - Processes
.com.htmlcomponents - Processes
.com.mdcomponents (lowest priority) - Repeats until no changes are detected
- Compiles TypeScript to JavaScript
- Copies result to target directory
- Cleans up temporary directory
Excluded from output: *.com.html, *.com.ts, *.com.md, *.pre.ts
tk develop
Start a development server with hot reload.
Aliases: dev, d
tk dev [port] [host]
| Argument | Default | Description |
|---|---|---|
port | 3000 | Server port |
host | localhost | Server host |
Examples:
tk dev
tk dev 8080
tk dev 8080 0.0.0.0
tk d
Features:
- Hot Reload — Auto-refreshes on file changes
- Clean URLs —
/aboutservesabout.html - Directory Index —
/blog/servesblog/index.html
| URL | Serves |
|---|---|
/about | about.html |
/docs/guide | docs/guide.html |
/blog/ | blog/index.html |
tk init
Initialize a new Tkeron project.
Aliases: i
tk init <projectName> [--force]
| Argument | Required | Description |
|---|---|---|
projectName | Yes | Project directory name, or . for current |
Options: --force — Overwrite existing files without prompting
What It Creates:
project-name/
├── websrc/
│ ├── index.html
│ ├── index.ts
│ ├── index.pre.ts
│ ├── hero-section.com.html
│ ├── user-badge.com.ts
│ └── ...
├── tkeron.d.ts
└── tsconfig.json
tk init also generates a tsconfig.json with the correct include paths for IDE/TypeScript language server support. If a tsconfig.json already exists, tkeron merges only the required entries without overwriting your settings.
Command Aliases
| Full Command | Aliases |
|---|---|
tk build | tk b |
tk develop | tk dev, tk d |
tk init | tk i |
Environment Variables
| Variable | Description |
|---|---|
TKERON_VERSION | Current Tkeron version. Available inside .pre.ts files only (set automatically by tkeron) |
NODE_ENV | Standard environment variable. Not set by tkeron — use it in .pre.ts to control build behavior |
NODE_ENV=production tk build
Configuration
Tkeron uses convention over configuration. No config files needed.
Defaults:
- Source:
websrc/ - Output:
web/ - Components:
*.com.html,*.com.ts,*.com.md - Pre-render:
*.pre.ts
Directories are not configurable via CLI — always websrc/ → web/.
TypeScript Configuration
Optional tsconfig.json for editor support (generated by tk init):
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ESNext", "DOM"],
"strict": true,
"skipLibCheck": true
},
"include": ["websrc/**/*", "tkeron.d.ts"]
}
Integration
npm Scripts
{
"scripts": {
"dev": "tk dev",
"build": "tk build",
"build:prod": "NODE_ENV=production tk build"
}
}
CI/CD (GitHub Actions)
name: Build and Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- run: bun install -g tkeron
- run: tk build
env:
NODE_ENV: production
Quick Reference
tk init my-site && cd my-site # Create project
tk dev # Start development
NODE_ENV=production tk build # Build for production
tk dev 8080 # Dev on port 8080
tk init . --force # Init in current dir
Next Steps
- Getting Started — First project walkthrough
- HTML Components — Reusable markup
- TypeScript Components — Dynamic components
- Pre-rendering — Build-time transformations