create-terminatui
v0.7.0
Published
Create template for TerminaTUI CLI/TUI applications
Readme
create-terminatui
Create template for TerminaTUI CLI/TUI applications.
Note: This package is part of the terminatui monorepo.
Usage
bun create terminatui my-app
cd my-app
bun install
bun run startWhat's Included
The template creates a TerminaTUI application with:
- TuiApplication - An app that supports both CLI and TUI modes
- Sample command - A
greetcommand demonstrating options, TUI metadata, and result rendering - TypeScript - Strict TypeScript configuration
- Dev container - Ready for containerized development
Running Your App
# TUI mode (default)
bun run start
# CLI mode
bun run start --mode cli greet --name World
# Show help
bun run start helpAdding Commands
- Create a new file in
src/commands/ - Define options with
OptionSchema - Create a class extending
Command<typeof options> - Add the command to your app in
src/index.ts
See src/commands/greet.ts for a complete example.
Documentation
Development (Contributing to this template)
This section is for developing the create-terminatui package itself.
Setup
From the monorepo root:
bun installAvailable Scripts
Run from the packages/create-terminatui directory:
| Script | Description |
|--------|-------------|
| bun run build | Build the create script |
| bun run test | Run full test (create + build + run) |
| bun run test:create | Create a test app in /tmp/terminatui-test-app |
| bun run test:template | Build and run the test app in CLI mode |
| bun run test:template:tui | Run the test app in TUI mode |
| bun run cleanup | Remove the test app directory |
Development Workflow
Test the full create flow
bun run cleanup # Clean up any previous test
bun run test # Create, build, and run test app
bun run test:template:tui # Optionally test TUI mode
bun run cleanup # Clean up when donePublishing
Both @pablozaiden/terminatui and create-terminatui are published together when a GitHub release is created:
- Create a GitHub release with a tag like
v1.0.0 - The workflow automatically:
- Sets both packages to version
1.0.0 - Updates the template's terminatui dependency to
^1.0.0 - Publishes both packages to npm
- Sets both packages to version
Key Files
src/create-terminatui.ts- The create script that copies template filestemplate/- All files in this directory are copied to the user's projecttemplate/src/commands/greet.ts- Sample command demonstrating all features
License
MIT
