EluciusFTW.SpectreTuff.Elmish 0.14.14

dotnet add package EluciusFTW.SpectreTuff.Elmish --version 0.14.14
                    
NuGet\Install-Package EluciusFTW.SpectreTuff.Elmish -Version 0.14.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EluciusFTW.SpectreTuff.Elmish" Version="0.14.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EluciusFTW.SpectreTuff.Elmish" Version="0.14.14" />
                    
Directory.Packages.props
<PackageReference Include="EluciusFTW.SpectreTuff.Elmish" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EluciusFTW.SpectreTuff.Elmish --version 0.14.14
                    
#r "nuget: EluciusFTW.SpectreTuff.Elmish, 0.14.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EluciusFTW.SpectreTuff.Elmish@0.14.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EluciusFTW.SpectreTuff.Elmish&version=0.14.14
                    
Install as a Cake Addin
#tool nuget:?package=EluciusFTW.SpectreTuff.Elmish&version=0.14.14
                    
Install as a Cake Tool

SpectreTuff

Spectre Tui for F# - A thin, opinionated wrapper around Spectre.Tui

This library, as well as Spectre.Tui is currently under construction and may change at any time.

Key bindings

SpectreTuff.Keymap lets one list of bindings drive both input handling and the help bar, so a key and its description can't drift apart:

open SpectreTuff.Keymap

let bindings = [
  KeyBinding.createSpecial ConsoleKey.UpArrow "up" MoveUp |> KeyBinding.orKey (CharKey 'k')
  KeyBinding.dynamic (CharKey 's') (fun model -> {
    Description = "save"
    Message = if model.Dirty then Some Save else None // None: disabled and hidden from help
  })
]

KeyBinding.handleKey bindings key model // ConsoleKeyInfo -> 'Msg option
KeyBinding.toKeyMap bindings model      // IKeyMap for the help widget

Elmish

The EluciusFTW.SpectreTuff.Elmish package runs an Elmish program on SpectreTuff. It sets up the terminal, serializes rendering and handles exiting. A minimal app that shows the last key pressed:

open System
open Elmish
open SpectreTuff.Widgets
open SpectreTuff.Elmish

type Model = { LastKey: string }

type Msg = KeyPressed of ConsoleKeyInfo

let init () = { LastKey = "none" }, Cmd.none

let update msg model =
  match msg with
  | KeyPressed key when key.KeyChar = 'q' -> model, TuiCmd.exit
  | KeyPressed key -> { LastKey = string key.Key }, Cmd.none

let view model _dispatch =
  textBox $"Last key: {model.LastKey} (press q to quit)"

Program.mkProgram init update view
|> Program.withSubscription (fun _ -> Subscriptions.keys KeyPressed)
|> Tui.run // blocks until TuiCmd.exit

For periodic updates, add Subscriptions.tick (TimeSpan.FromSeconds 1.0) Tick to the subscriptions. To forward a child component's subscriptions to its parent, use Elmish's Sub.map "child" ChildMsg childSubs.

Versioning

We are using NerdBank.GitVersioning and follow the version scheme: <major>.<minor>.<git-depth> for out releases.

Since this package is a wrapper around Spectre.Tui, we will synchronize our major and minor versions with the ones of the Spectre dependency we are wrapping.

<b>Note</b>: In particular, the third number in the version does not have the same meaning as the patches in SemVer. Increments in that number may contain breaking changes, in contrast to patch versions in SemVer.

License

Copyright © Guy Buss, Daniel Muckelbauer

SpectreTuff is provided as-is under the MIT license. See the LICENSE.md file included in the repository.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on EluciusFTW.SpectreTuff.Elmish:

Package Downloads
EluciusFTW.Tui48

A 2048-style sliding tile game as an Elmish component: host it in any SpectreTuff.Elmish program, e.g. as a pop-up game, with pluggable highscore storage.

EluciusFTW.Tuisweeper

Minesweeper as an Elmish component: host it in any SpectreTuff.Elmish program, e.g. as a pop-up game, with pluggable highscore storage.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.14.14 178 10/17/2026

Initial release