Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
リポジトリ情報はまだ収集していません。
No updates detected yet. GitHub releases will appear here.
Elm-style terminal UI framework for Dart (Bubble Tea port)
翻訳待ち
Loading the full README.
Read the full README ↗Elm-style terminal UI framework for Dart, inspired by Bubble Tea.
Build rich, interactive CLI applications with a clean Model–Update–View architecture, a full component library, and Lipgloss-quality styling — all in pure Dart.
📖 Documentation & component gallery — browse every component, block and guide with live previews.
Cmd) for timers, HTTP, subprocesses, and any async workpromptSelect / promptConfirm / promptInput, plus gum-style filter, spin, and pagerctrl+a/e/b/f/w, alt-word motion, ctrl+w)FileLog writes diagnostics to a file without corrupting the rendered UIgetWidth(), getHeight(), truncate(), truncateLeft(), per-side border flags, tabWidth, marginBackgroundStyle.inherit(parent) fills unset fields; CompleteColor for per-profile color downgradewithCellRenderer()) writes only changed cellsCSI ?2026) for terminals that support themBackgroundColorMsgProgramOption functions — withAltScreen(), withHideCursor(), withTickInterval(), withMouseCellMotion(), withMouseAllMotion(), withReportFocus(), withWindowSize(), withLogFile()# pubspec.yaml
dependencies:
dart_tui: ^3.0.0
dart pub get
Migrating from 2.x? Version 3.0 delivers Ctrl+C and Ctrl+Z to
updateas keys instead of quitting or suspending for you, sends one key event per Unicode scalar, validates timers and forms at construction, and removesView.setContent(assignview.content). See the 3.0.0 changelog for the complete migration notes.Migrating from 1.x? Version 2.0 removes the
TeaModel,LegacyKeyMsg,TuiStyle, andProgramOptionscompatibility APIs. UseModel,KeyPressMsg/KeyMsg, immutableStyle, and a singleProgram(options: <ProgramOption>[...])configuration path. See the 2.0.0 changelog for the complete migration notes.
import 'package:dart_tui/dart_tui.dart';
void main() async {
await Program(
options: [withAltScreen()],
).run(CounterModel());
}
final class CounterModel extends Model {
CounterModel({this.count = 0});
final int count;
@override
Cmd? init() => tick(const Duration(seconds: 1), (_) => _TickMsg());
@override
(Model, Cmd?) update(Msg msg) {
if (msg is _TickMsg) {
if (count >= 5) return (this, () => quit());
return (CounterModel(count: count + 1),
tick(const Duration(seconds: 1), (_) => _TickMsg()));
}
if (msg is KeyMsg && (msg.key == 'q' || msg.key == 'ctrl+c')) {
return (this, () => quit());
}
return (this, null);
}
@override
View view() => newView('Count: $count\n\nPress q to quit.');
}
final class _TickMsg extends Msg {}
┌──────────────┐ Msg ┌──────────────┐
│ Model │ ──────▶ │ update │
│ (your state)│ │ (pure fn) │
└──────────────┘ └──────┬───────┘
▲ │ (Model, Cmd?)
│ ▼
│ ┌──────────────┐
└──── render ─── │ view │
│ (pure fn) │
└──────────────┘
| Concept | Description |
|---|---|
Model | Immutable state. Implement init(), update(Msg), view(). |
Msg | Tagged event: key press, window resize, tick, custom data. |
Cmd | FutureOr<Msg?> Function() — async side-effect that delivers one message back. |
View | Declared output string plus optional cursor position, mouse mode, window title. |
Program | Owns the event loop, terminal raw mode, renderer, and signal handling. |
abstract class OutcomeModel<T> implements Model {
T? get outcome; // non-null → program exits and returns this value
}
final String? result = await Program().runForResult<String>(MyPromptModel());
This is the beginning of the README. Read the rest at the original. Read the full README ↗