# Ito: 用Lua构建终端界面

Original title: Show HN: Ito – Build Terminal UIs in Lua

> Hacker News story 50096300 · language: zh · submitted 2026-10-14
> Web version: https://zeli.app/zh/story/50096300
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 74 · by [cat-whisperer](<https://news.ycombinator.com/user?id=cat-whisperer>) · 💬 15
[original](<https://uji.sh/ito/>) · [HN discussion](<https://news.ycombinator.com/item?id=50096300>)

## Summary

Ito是一个让开发者能用Lua轻松构建终端用户界面（TUI）的库。通过简洁的声明式语法，你可以快速定义状态、列表、文本框等交互组件，并实现流畅的界面切换。无论是打造命令行工具还是交互式脚本，Ito都能让终端体验焕然一新。代码示例展示了如何通过状态管理实现“选择-编辑”流程，让开发过程既高效又充满乐趣。

## Key quote

> 用几行Lua代码，就能让终端界面拥有现代交互体验。

## HN discussion (15 comments)

### [Yannik_Sc](<https://news.ycombinator.com/item?id=50101035>)

> 虽然我一向挺喜欢 Lua，但这代码看起来……不太像 Lua 味儿。它确实是 Lua，但要是能利用像“无括号调用”这样的语言特性，看起来会好得多：
>
> ui.Button "Button Text" {
>
> on_click = function()
>
> print("Hello world")
>
> end,
>
> disabled = true
>
> }
>
> 或者
>
> ui.VStack {
>
> padding = 31, -- 命名键 => 选项
>
> wrap = true,
>
> ui.Button "..." {}, -- 按数字索引 => 子元素
>
> }
>
> 在我看来，这样感觉更像 Lua，而且稍微清爽一点。

### [hollowturtle](<https://news.ycombinator.com/item?id=50100813>)

> 干得漂亮！这个声明式 API 看起来太酷了！我打算试试。有时候我会想，如果宇宙真的是无限的，那么某个宇宙里，浏览器原生支持 luajit 脚本而不是 javascript（而在另一个宇宙里，除了这个，数组索引还是从 0 开始的 ;)）

### [buffer_overlord](<https://news.ycombinator.com/item?id=50102200>)

> Hqtui

---

## Cite

- Page: https://zeli.app/zh/story/50096300
- Date: 2026-10-14
- Source: uji.sh (https://uji.sh/ito/)
- Hacker News: https://news.ycombinator.com/item?id=50096300

## Other languages

- en: https://zeli.app/story/50096300 · markdown: https://zeli.app/story/50096300.md
- ja: https://zeli.app/ja/story/50096300 · markdown: https://zeli.app/ja/story/50096300.md
- ko: https://zeli.app/ko/story/50096300 · markdown: https://zeli.app/ko/story/50096300.md
- de: https://zeli.app/de/story/50096300 · markdown: https://zeli.app/de/story/50096300.md
- es: https://zeli.app/es/story/50096300 · markdown: https://zeli.app/es/story/50096300.md
- ru: https://zeli.app/ru/story/50096300 · markdown: https://zeli.app/ru/story/50096300.md
