Skip to content

Repository files navigation

CIPub VersionLicenseWebsiteDocumentation

Website | Docs | pub.dev | Quick Start

If you know Flutter, you know Nocterm. Build terminal UIs with the same patterns—StatefulComponent, setState(), Column, Row, and hot reload.

Nocterm Demo

Installation

dependencies:
nocterm: ^0.8.0

Quick Start

import'package:nocterm/nocterm.dart';
voidmain() {
runApp(constCounter());
}
classCounterextendsStatefulComponent {
constCounter({super.key});
@overrideState<Counter> createState() =>_CounterState();
}
class_CounterStateextendsState<Counter> {
int _count =0;
@overrideComponentbuild(BuildContext context) {
returnFocusable(
focused:true,
onKeyEvent: (event) {
if (event.logicalKey ==LogicalKey.space) {
setState(() => _count++);
returntrue;
}
returnfalse;
},
child:Center(
child:Text('Count: $_count'),
),
);
}
}

Run with hot reload:

dart --enable-vm-service your_app.dart

Testing

Test your TUI components just like Flutter widgets:

awaittestNocterm('counter test', (tester) async {
await tester.pumpComponent(Counter());
await tester.sendKey(LogicalKey.space);
expect(tester.terminalState, containsText('Count: 1'));
});

Documentation

See the full documentation for guides on components, state management, testing, and more.

Community

Packages

PackageDescription
nocterm_blocBloc state management for Nocterm
nocterm_lintsIDE assists — wrap with, swap, move, convert to stateful/stateless

Built with Nocterm

ProjectDescription
vide_cliMulti-agent coding IDE for the terminal
nocterm_3dExperimental 3D renderer for the terminal
cowLocal LLM chat client powered by llama.cpp
snakeClassic Snake for the command line
minesweeperClassic Minesweeper for the command line
simutilQuick launch iOS simulators / Android emulators and more

Built something with Nocterm? Open an issue to get it listed here!

Contributing

Git Hooks

We use hooksman to manage git hooks. To install the hooks, run:

dart run hooksman

License

MIT

About

A powerful, Flutter-inspired Terminal User Interface framework for building beautiful command-line applications in Dart.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages