TUIkit: Terminal UI Framework for Swift

2 min read Original article ↗

TUIkit Logo

> Terminal UIs, the Swift way_

A declarative, SwiftUI-like framework for building Terminal User Interfaces. Pure Swift on macOS and Linux, with no ncurses or C dependencies.

Get started in seconds

Add TUIkit as a dependency to your Swift package. No ncurses, no C libraries, no complex setup. Just pure Swift that runs on macOS and Linux.

.package(url: "https://github.com/phranck/TUIkit.git", from: "0.5.2")

Project Creator CLI

The installer adds the tuikit command to your system. It detects your platform, installs to /usr/local/bin or ~/.local/bin, and on Linux offers to install Swift if needed.

curl -fsSL https://raw.githubusercontent.com/phranck/TUIkit/main/project-template/install.sh | bash

Then create projects with optional features:

  • tuikit init MyApp Basic app
  • tuikit init git MyApp With Git repository
  • tuikit init sqlite MyApp With SQLiteData
  • tuikit init testing MyApp With Swift Testing

Options can be combined: tuikit init git sqlite testing MyApp

Everything you need

Built from the ground up for the terminal, with APIs you already know from SwiftUI.

Declarative Syntax

Build UIs with VStack, HStack, Text, Button, and more. The same patterns you know from SwiftUI.

Theming System

Multiple built-in phosphor themes with full RGB color support. Cycle at runtime or create custom palettes.

Keyboard-Driven

Focus management, key event handlers, customizable status bar with shortcut display.

Rich Components

Panel, Card, Dialog, Alert, Menu, Button, and ForEach. Container and interactive views out of the box.

Zero Dependencies

Pure Swift. No ncurses, no C libraries. Just add the Swift package and go.

Cross-Platform

Runs on macOS and Linux. Same code, same API, same results.

Built right

Swift 6.0 + Strict Concurrency

Full Sendable compliance. No data races, no unsafe globals. Modern Swift from top to bottom.

5 Border Appearances

Line, rounded, double-line, heavy, and block style. Cycle with a single keystroke.

Extensively Tested

Comprehensive test coverage across views, modifiers, rendering, state management, i18n consistency, and localization.

13 DocC Articles

Architecture guides, API references, theming, focus system, keyboard shortcuts, and palette documentation.

Ready to build?

Get started with TUIkit in minutes. Add the package, write your first view, run it.

Made with ❤️ in Bregenz at Lake Constance Austria