~/talk

Writing command-line interfaces (CLIs) with React. Wait, what? Yeah!

Talkat ReactNext 2023 · on Tuesday, 2023-06-27· [react, nodejs]
slides:none on file

Claim: React components render to the terminal using Ink and the new framework Pastel, so familiar React state/hooks drive interactive CLIs. Demo builds a JSON-backed to‑do app (add/list/complete/remove) that runs live and prints colored, styled output. Tooling uses Node (ESM import.meta), simple filesystem JSON storage, and tests run with Node’s built‑in test runner as component tests. The approach proves practical: commands, help, and verbose output work with almost no imperative cursor logic.

AI-written summary · about

  1. 0:00CLIs with React
  2. 2:51Traditional CLIs limitations
  3. 4:17Guidelines for great CLIs
  4. 5:20Simple CLI with Node.js
  5. 8:56Low-level terminal challenges
  6. 9:41Ink for terminal React
  7. 12:27Ink components demo
  8. 14:57Styling CLIs with Ink CSS
  9. 16:23React for CLIs advantages
  10. 17:06Tools using Ink and React
  11. 17:27Pastel framework
  12. 18:51Pastel to-do app demo
  13. 19:56Pastel app code structure
  14. 22:04Pastel commands and options
  15. 24:13Pastel list command
  16. 25:19Testing CLIs like web apps
  17. 26:01Testing a Pastel CLI
  18. 27:50Conclusion try Pastel
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.