{"id":50467858,"url":"https://github.com/darkliquid/charmingui","last_synced_at":"2026-06-01T08:30:52.485Z","repository":{"id":348577313,"uuid":"1198671493","full_name":"darkliquid/charmingui","owner":"darkliquid","description":"Render a bubbletea application to an image.Image","archived":false,"fork":false,"pushed_at":"2026-04-01T19:16:20.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T06:00:50.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkliquid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-01T16:39:12.000Z","updated_at":"2026-04-02T01:29:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/darkliquid/charmingui","commit_stats":null,"previous_names":["darkliquid/charmingui"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/darkliquid/charmingui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkliquid%2Fcharmingui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkliquid%2Fcharmingui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkliquid%2Fcharmingui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkliquid%2Fcharmingui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkliquid","download_url":"https://codeload.github.com/darkliquid/charmingui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkliquid%2Fcharmingui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33767434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-01T08:30:51.286Z","updated_at":"2026-06-01T08:30:52.476Z","avatar_url":"https://github.com/darkliquid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# charmingui\n\n`charmingui` is a Go library for rendering Bubble Tea views and ANSI terminal output onto `image.Image` surfaces.\n\nIt is useful when you want terminal-style UI in a non-terminal environment, such as:\n\n- embedding a Bubble Tea interface inside a game or graphical app\n- turning ANSI output into an image for previews, exports, or snapshots\n- reusing Bubble Tea models where you control drawing yourself\n\nThe package exposes a `Renderer` that rasterizes terminal cells into pixels, plus a `ModelAdapter` for driving a Bubble Tea model over repeated updates.\n\n## Minimal example\n\n```go\npackage main\n\nimport (\n\t\"image/png\"\n\t\"log\"\n\t\"os\"\n\n\t\"charm.land/bubbletea/v2\"\n\t\"github.com/darkliquid/charmingui\"\n)\n\ntype model struct{}\n\nfunc (m model) Init() tea.Cmd { return nil }\nfunc (m model) Update(tea.Msg) (tea.Model, tea.Cmd) { return m, nil }\nfunc (m model) View() tea.View {\n\treturn tea.NewView(\"Hello from CharmingUI!\\n\\x1b[32mRendered to an image.\\x1b[0m\")\n}\n\nfunc main() {\n\trenderer, err := charmingui.New(charmingui.Config{\n\t\tColumns: 40,\n\t\tRows:    4,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tresult, err := renderer.RenderModel(nil, model{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfile, err := os.Create(\"frame.png\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tif err := png.Encode(file, result.Image); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nThat creates a renderer, renders a Bubble Tea model, and writes the resulting frame to `frame.png`.\n\n## Main APIs\n\n- `charmingui.New(Config)` creates a renderer with a terminal grid size, font, and colors.\n- `(*Renderer).RenderModel` renders a Bubble Tea model to an image.\n- `(*Renderer).RenderView` renders a `tea.View` directly.\n- `(*Renderer).RenderFrame` renders a full ANSI frame.\n- `(*Renderer).RenderStream` applies ANSI output incrementally to the current virtual screen.\n- `NewModelAdapter` helps keep a Bubble Tea model updated and rendered in apps with their own event loop.\n- `UpdateResult.Dispatch` and `DispatchCmd` run commands and expand `tea.Batch(...)` results into individual child commands for custom runtimes.\n\nSee `cmd/ebiten-demo` for a full example that embeds Bubble Tea inside an Ebiten application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkliquid%2Fcharmingui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkliquid%2Fcharmingui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkliquid%2Fcharmingui/lists"}