Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Terminal UI library for Elixir, inspired by Ratatui. Build immediate-mode TUIs with OTP-friendly widgets, layouts, input, charts, and examples.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Elui is a terminal user interface library for Elixir, inspired by Ratatui.
Website: elui.sh
It gives Elixir projects an immediate-mode TUI toolkit: rebuild the UI from your current state on every frame, render widgets into a buffer, and let the terminal backend write only the changed cells.
┌Elui──────────────────────────────────────────┐
│ │
│ Hello, world! │
│ │
│ Immediate-mode terminal UIs │
│ for Elixir and OTP │
│ │
└──────────────────────────────────────────────┘
Elui is early-stage and intentionally small. The core API is already useful for demos, prototypes, dashboards, CLIs, and experiments, but public API changes can still happen before a stable release.
Elui.Terminal and Elui.FrameElui.App runner for keyboard, mouse, tick, resize, and process
message eventsexamples/apps/~> 1.20Until the first Hex release, install directly from GitHub:
def deps do
[
{:elui, github: "douglascorrea/elui"}
]
end
After Elui is published to Hex, use the package dependency:
def deps do
[
{:elui, "~> 0.1.0"}
]
end
The easiest way to build an app is the Elui.App behaviour. It wires up a
terminal, raw-mode input, resize detection, app messages, and a render loop.
defmodule Counter do
@behaviour Elui.App
alias Elui.Frame
alias Elui.Widgets.{Block, Paragraph}
@impl true
def init(_opts), do: 0
@impl true
def update(_count, {:key, {:char, "q"}, _mods}), do: :quit
def update(count, {:key, :up, _mods}), do: {:ok, count + 1}
def update(count, {:key, :down, _mods}), do: {:ok, count - 1}
def update(count, _event), do: {:ok, count}
@impl true
def view(count, frame) do
Frame.render_widget(
frame,
Paragraph.new("Count: #{count}\n\n↑/↓ to change, q to quit",
alignment: :center,
block: Block.bordered(title: "Counter")
),
Frame.area(frame)
)
end
end
Elui.App.run(Counter)
If you want full control over the loop, drive the terminal manually:
terminal = Elui.Terminal.new()
{terminal, _result} =
Elui.Terminal.draw(terminal, fn frame ->
Elui.Frame.render_widget(
frame,
Elui.Widgets.Paragraph.new("Hello from Elui!"),
Elui.Frame.area(frame)
)
end)
Elui.Terminal.restore(terminal)
Run examples from the repository root:
mix deps.get
mix run examples/demo.exs
Useful starting points:
| Example | Command | Shows |
|---|---|---|
| Demo | mix run examples/demo.exs | A tour of most widgets |
| Hello world | mix run examples/hello_world.exs | Minimal app structure |
| Flex | mix run examples/flex.exs | Constraint and flex alignment behavior |
| Mouse drawing | mix run examples/mouse_drawing.exs | Mouse input and continuous drawing |
| Async GitHub | mix run examples/async_github.exs | Async fetch of Elixir commits |
| Calendar explorer | mix run examples/calendar_explorer.exs | Interactive calendar styles and navigation |
| Canvas | mix run examples/canvas.exs | Braille canvas shapes and animation |
| Charts | mix run examples/chart.exs | Datasets, axes, legends, and plotting |
| Beam Lab | mix run examples/beam_lab.exs | Supervisors, GenServers, BEAM nodes, and streamed GitHub events |
| Markdown | mix run examples/markdown.exs [FILE] | A scrolling Markdown viewer |
| Mermaid | mix run examples/mermaid.exs [FILE...] | Flowcharts and sequence diagrams as text |
Elui also includes Elixir ports of every Ratatui app under
ratatui/examples/apps/:
| Ratatui app | Elui example |
|---|---|
advanced-widget-impl | examples/advanced_widget_impl.exs |
async-github | examples/async_github.exs |
calendar-explorer | examples/calendar_explorer.exs |
canvas | examples/canvas.exs |
chart | examples/chart.exs |
color-explorer | examples/color_explorer.exs |
colors-rgb | examples/colors_rgb.exs |
constraint-explorer | examples/constraint_explorer.exs |
constraints | examples/constraints.exs |
custom-widget | examples/custom_widget.exs |
demo | examples/demo.exs |
demo2 | examples/demo2.exs |
flex | examples/flex.exs |
gauge | examples/gauge.exs |
hello-world | examples/hello_world.exs |
hyperlink | examples/hyperlink.exs |
inline | examples/inline.exs |
input-form | examples/input_form.exs |
minimal | examples/minimal.exs |
modifiers | examples/modifiers.exs |
mouse-drawing | examples/mouse_drawing.exs |
panic | examples/panic.exs |
popup |
| Ratatui | Elui |
|---|---|
Terminal / Frame | Elui.Terminal / Elui.Frame |
Backend | Elui.Backend, Elui.Backend.Ansi, Elui.Backend.Test |
Buffer / Cell | Elui.Buffer / Elui.Buffer.Cell |
Rect, Layout, Constraint, Flex | Elui.Layout.Rect, Elui.Layout, Elui.Layout.Constraint, :flex |
Style, Color, Modifier | Elui.Style, Elui.Style.Color |
Span, Line, Text | Elui.Text.Span, Elui.Text.Line, Elui.Text |
Widget / StatefulWidget traits | Elui.Widget / Elui.StatefulWidget protocols |
| crossterm input events | Elui.Input key and SGR mouse events (CSI modifiers, kitty CSI u) |
| app event loop | Elui.App behaviour |
Use Elui.Backend.Test to render frames into memory and assert on plain text:
terminal =
Elui.Terminal.new(
backend: Elui.Backend.Test,
backend_opts: [width: 20, height: 3]
)
{terminal, _} =
Elui.Terminal.draw(terminal, fn frame ->
Elui.Frame.render_widget(
frame,
Elui.Widgets.Paragraph.new("Hello"),
Elui.Frame.area(frame)
)
end)
Elui.Backend.Test.to_lines(Elui.Terminal.backend_state(terminal))
#=> ["Hello ", " ", " "]
mix deps.get
mix format --check-formatted
mix test
mix hex.audit
mix hex.build --unpack
The formatter currently covers mix.exs, .formatter.exs, lib/, and
test/. Example scripts are tested for loadability so they keep compiling as
the library evolves.
Elui renders to terminals. Terminals interpret ANSI, CSI, and OSC control sequences, so treat untrusted strings with the same care you would use for any output sink with control syntax.
Contributions are welcome. Start with CONTRIBUTING.md, open an issue for larger changes, and keep pull requests focused.
The project follows the Code of Conduct.
Elui is released under the MIT License.
examples/popup.exsrelease-header | examples/release_header.exs |
scrollbar | examples/scrollbar.exs |
table | examples/table.exs |
todo-list | examples/todo_list.exs |
tracing | examples/tracing.exs |
user-input | examples/user_input.exs |
volatility-surface | examples/volatility_surface.exs |
weather | examples/weather.exs |
widget-ref-container | examples/widget_ref_container.exs |