How do you organize TUI app code?

⚓ Rust    📅 2026-01-16    👤 surdeus    👁️ 1      

surdeus

I'm trying to make a CLI prompt app, and immediately have a huge question: how do I organize it?

It's a simple game, and I need

  • a starting prompt, where you choose to play a new one or load an old one.
  • turn making prompt, in which you choose the action.
  • a way to save the game from turn prompt (e.g. user types :s)
  • and later I'll need the initial setup prompt

I see, there's inquire crate. But that is just prompt itself.

The big question is how to organize transitions between all the prompts? Like if I were to write Javascript in a web page, and had to implement the main event loop myself.

Where do I start with?

Or maybe there's a TUI library with a framework for this? (Checking ratatui examples, I see the rendering part, not transitions.)

1 post - 1 participant

Read full topic

🏷️ Rust_feed