Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기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 |