{"id":15393879,"url":"https://github.com/mitchellh/go-glint","last_synced_at":"2025-05-16T18:05:27.522Z","repository":{"id":48501450,"uuid":"291554532","full_name":"mitchellh/go-glint","owner":"mitchellh","description":"Component-based UI-framework for command-line tools. Easily create highly dynamic CLI interfaces using shared, easily testable components.","archived":false,"fork":false,"pushed_at":"2021-07-22T15:23:15.000Z","size":207,"stargazers_count":308,"open_issues_count":2,"forks_count":8,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-13T13:18:34.036Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":"","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/mitchellh.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}},"created_at":"2020-08-30T21:25:56.000Z","updated_at":"2025-05-05T15:43:11.000Z","dependencies_parsed_at":"2022-09-26T18:31:25.027Z","dependency_job_id":null,"html_url":"https://github.com/mitchellh/go-glint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-glint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-glint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-glint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-glint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/go-glint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582903,"owners_count":22095518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang"],"created_at":"2024-10-01T15:20:39.298Z","updated_at":"2025-05-16T18:05:27.480Z","avatar_url":"https://github.com/mitchellh.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-glint [![Godoc](https://godoc.org/github.com/mitchellh/go-glint?status.svg)](https://godoc.org/github.com/mitchellh/go-glint)\n\nGlint is a component-based UI framework specifically targeted towards\ncommand-line interfaces. This allows you to create highly dynamic CLI interfaces\nusing shared, easily testable components. Glint uses a Flexbox implementation\nto make it easy to lay out components in the CLI, including paddings, margins,\nand more.\n\n**API Status: Unstable.** We're still actively working on the API and\nmay change it in backwards incompatible ways. See the roadmap section in\nparticular for work that may impact the API. In particular, we have \nintegrated this library into [Waypoint](https://github.com/hashicorp/waypoint),\nand the experience of using this library in the real world will likely drive major\nchanges.\n\n## Example\n\nThe example below shows a simple dynamic counter:\n\n```go\nfunc main() {\n\tvar counter uint32\n\tgo func() {\n\t\tfor {\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t\tatomic.AddUint32(\u0026counter, 1)\n\t\t}\n\t}()\n\n\td := glint.New()\n\td.Append(\n\t\tglint.Style(\n\t\t\tglint.TextFunc(func(rows, cols uint) string {\n\t\t\t\treturn fmt.Sprintf(\"%d tests passed\", atomic.LoadUint32(\u0026counter))\n\t\t\t}),\n\t\t\tglint.Color(\"green\"),\n\t\t),\n\t)\n\td.Render(context.Background())\n}\n```\n\nOutput:\n\n![Example](https://user-images.githubusercontent.com/1299/92431533-9baf8000-f14c-11ea-94ad-8ff97ed26fec.gif)\n\n## Roadmap\n\nGlint is still an early stage project and there is a lot that we want to\nimprove on. This may introduce some backwards incompatibilities but we are\ntrying to stabilize the API as quickly as possible.\n\n* **Non-interactive interfaces.** We want to add support for rendering to\nnon-interactive interfaces and allowing components to provide custom behavior\nin these cases. For now, users of Glint should detect non-interactivity and\navoid using Glint.\n\n* **Windows PowerShell and Cmd.** Glint works fine in ANSI-compatible terminals\non Windows, but doesn't work with PowerShell and Cmd. We want to make this\nwork.\n\n* **Dirty tracking.** Glint currently rerenders the entire frame on each\ntick. I'd like components to be able to report if there are changes (if they\nare \"dirty\") and need to be rerendered. We could then more efficiently\nrecalculate layouts and rerender outputs.\n\n* **User Input.** Glint should be able to query for user input and render\nthis within its existing set of components.\n\n* **Expose styling to custom renderers.** Currently the `Style` component\nis a special-case for the terminal renderer to render colors. I'd like to expose\nthe styles in a way that other renderers could use it in some meaningful way.\n\n## Thanks\n\nThis library is heavily inspired by the [Ink project](https://github.com/vadimdemedes/ink).\nI saw this project and thought that having a central render loop along with\na full layout engine was a fantastic idea. Most of my projects are in Go\nso I wanted to be able to realize these benefits with Go. Thank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-glint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fgo-glint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-glint/lists"}