hn.today

Show HN: HyperCMD, write CLI applications using plain HTML

github.com7 points1 comments
Screenshot of Show HN: HyperCMD, write CLI applications using plain HTML

HyperCMD is a terminal renderer for fusor that lets you build reactive CLI applications by writing views in plain HTML and keeping state and logic in Rust. HTML templates can contain Rust expressions that the fusor compiler lowers and rustc type-checks; state is exposed as signals in Rust so bindings automatically re-run and only the affected nodes are updated. A constrained CSS profile provides flexbox layout, ch and percentage sizing, padding, gaps, colors and scrollable overflow so layouts behave predictably in terminal cells. Keyboard-first features - Tab/arrow focus, multiline grapheme-aware editing, bracketed paste, mouse scrolling - and ownership-based cleanup of listeners and background tasks are built in. One component can be compiled for both terminal and browser renderers.

Installation uses a small CLI installer or cargo, and a workflow of hypercmd new, edit ui/app.html and src/main.rs, then hypercmd run. Examples include a file browser and a job inspector; reusable components and background workers are supported. The project is experimental v0.1 (APIs will change before 1.0), supports macOS and Linux natively (Windows and some hosts unimplemented), and documents specific unsupported features (margins, grids, media/SVG, certain async view patterns, East Asian ambiguous-width handling). It differs from immediate-mode libraries like Ratatui by retaining a scene and signal-driven updates, and from Ink/Textual by using compiled Rust-backed HTML templates; licensed MIT.

Read on github.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Worth Building

Worth Building

Building tools without the need to monetize allows for more personal, enjoyable, and quick development of useful applications. This shift enables more people to create small, polished tools for their own needs or ideas, regardless of broader market appeal. (armstr.ng)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.