artisanal-helper
Guidance for building polished CLIs and TUIs with the Artisanal Dart package. Use when users ask for terminal UIs, live dashboards, log viewers, interactive input, or CLI tools with subcommands using Artisanal.
When & Why to Use This Skill
The Artisanal Helper is a specialized Claude skill designed to accelerate the development of professional Command Line Interfaces (CLIs) and Terminal User Interfaces (TUIs) using the Dart Artisanal package. It provides comprehensive guidance on implementing Elm-style architectures (Model/Update/View), managing interactive widgets, and creating high-performance terminal renderings. By offering structured playbooks for dashboards, log viewers, and complex CLI tools, this skill helps developers build polished terminal-based applications with ease.
Use Cases
- Building interactive TUI dashboards with real-time data updates and periodic refreshes using the Elm-style architecture.
- Creating robust CLI applications with complex subcommand structures and rich, styled console output for enhanced developer experience.
- Developing terminal-based user input forms and interactive lists using pre-built widgets like TextInput, SelectModel, and Viewports.
- Implementing high-performance custom terminal visualizations and layouts using low-level UV primitives and immediate-mode drawing techniques.
- Designing log viewers with auto-scroll capabilities and live data filtering for system monitoring.
| name | artisanal-helper |
|---|---|
| description | Guidance for building polished CLIs and TUIs with the Artisanal Dart package. Use when users ask for terminal UIs, live dashboards, log viewers, interactive input, or CLI tools with subcommands using Artisanal. |
Artisanal Helper
Artisanal is a Dart terminal toolkit. Use package:artisanal/... imports.
Quick triage
- CLI with subcommands or rich console output: use
package:artisanal/args.dartandpackage:artisanal/artisanal.dart. - Interactive TUI (Elm-style Model/Update/View): use
package:artisanal/tui.dartand bubbles widgets. - High-performance rendering or custom terminal behaviors: use
package:artisanal/uv.dartand UV primitives.
See references/exports.md for entrypoints, references/examples.md for example map, and references/api_reference.md for API notes.
Workflow
- Pick the closest example and adapt it; start from TUI examples for dashboards/input.
- Keep the Model immutable and small; put derived view data in helpers.
- Use
Cmd.tickorevery(...)for live dashboards and periodic refresh. - Prefer bubbles widgets for input, lists, tables, and viewports before custom drawing.
- For CLI tools, wire
CommandRunnerwith subcommands and useConsolefor styled output.
Task playbooks
Create a nice log dashboard
- Start from
packages/artisanal/example/log_viewer_demo.dart. - Reuse viewport + list or table components; keep log lines as model data.
- Use
every(...)to append new entries; gate auto-scroll with a "live" flag.
Create a live dashboard
- Start from
packages/artisanal/example/tui/examples/realtime/main.dart. - Track data in model, render with tables or gauges; use
every(...)for refresh. - Optionally add
DebugOverlayModelto show render metrics.
Create a TUI to handle user input
- Start from
packages/artisanal/example/tui/examples/textinput/main.dartortextarea/. - Use bubbles widgets (
TextInputModel,TextareaModel,SelectModel,ListModel). - Forward input
Msgto the active widget, then compose view strings.
TUI patterns to follow
- Compose multiple widgets with layout helpers; see
packages/artisanal/example/tui/examples/composable-views/main.dart. - Use
ViewportModelfor log panes or long text; seepackages/artisanal/example/tui/examples/pipe/main.dart. - Add help overlays with
HelpModel; seepackages/artisanal/example/tui/examples/help/main.dart. - Prefer
ProgramOptionsfor renderer/input toggles over manual terminal calls.
UV (low-level) patterns to follow
- Start from
packages/artisanal/example/uv/helloworld.dartorpackages/artisanal/example/uv_demo.dart. - Use
Terminal+Screen+Bufferfor drawing; calldraw()to flush. - Use
Canvasfor immediate-mode shapes; seepackages/artisanal/example/uv/draw.dart. - Use layout helpers (
splitHorizontal,splitVertical) inpackages/artisanal/example/uv/layout.dart.
Create a CLI with subcommands
- Use
package:artisanal/args.dartandCommandRunner. - Keep each subcommand in its own class; return non-zero exit codes on failure.
import 'package:artisanal/args.dart';
class HelloCommand extends Command {
@override
String get name => 'hello';
@override
String get description => 'Print a greeting.';
@override
void run() {
print('Hello, world!');
}
}
void main(List<String> args) {
final runner = CommandRunner('my-cli', 'A great CLI');
runner.addCommand(HelloCommand());
runner.run(args);
}
Resources
scripts/example.py: list or search Artisanal examples by keyword.assets/example_asset.txt: TUI skeleton template (copy into a new Dart file).