shadowzzh / tui-starter
A starter template for building Node.js CLI tools with both CLI and TUI modes.
README
TUI Starter
A starter template for building Node.js CLI tools with both CLI and TUI modes.
Features
- CLI + TUI dual mode - Commander for CLI, Ink for TUI
- TypeScript - Full type safety
- Biome - Fast formatting and linting
- Zero-config build - tsup for bundling
Quick Start
```bash
Use this template
git clone cd tui-starter pnpm install
Run TUI
pnpm dev
Run CLI
pnpm build node dist/cli.js hello ```
Usage
```bash
CLI mode
tui-starter hello --name World
TUI mode
tui-starter ```
Project Structure
``` src/ ├── cli.ts # CLI entry (commander) ├── index.ts # TUI entry (ink) ├── commands/ # Command definitions ├── components/ # TUI components ├── hooks/ # React hooks ├── lib/ # Business logic ├── utils/ # Utilities └── types.ts # Type definitions ```
Development
```bash pnpm dev # Start TUI in development pnpm build # Build for production pnpm lint # Check code pnpm lint:fix # Fix issues pnpm typecheck # Check types ```
Customize
- Rename `tui-starter` in `package.json` and `src/cli.ts`
- Update description in `README.md`
- Add your commands in `src/commands/`
- Build your TUI in `src/components/`
License
MIT