{"id":15664759,"url":"https://github.com/liamg/gobless","last_synced_at":"2025-05-06T19:29:36.356Z","repository":{"id":57603870,"uuid":"124639062","full_name":"liamg/gobless","owner":"liamg","description":"Build beautiful terminal dashboards/GUIs in golang.","archived":false,"fork":false,"pushed_at":"2018-03-18T18:14:34.000Z","size":5840,"stargazers_count":17,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T02:11:54.718Z","etag":null,"topics":["css-grid","grid-layout","gui","terminal","terminal-graphics"],"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/liamg.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":"2018-03-10T09:00:37.000Z","updated_at":"2024-07-18T12:51:18.000Z","dependencies_parsed_at":"2022-09-26T20:00:53.336Z","dependency_job_id":null,"html_url":"https://github.com/liamg/gobless","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/liamg%2Fgobless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgobless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgobless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamg%2Fgobless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liamg","download_url":"https://codeload.github.com/liamg/gobless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752824,"owners_count":21798859,"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":["css-grid","grid-layout","gui","terminal","terminal-graphics"],"created_at":"2024-10-03T13:44:05.366Z","updated_at":"2025-05-06T19:29:36.329Z","avatar_url":"https://github.com/liamg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gobless\nBuild beautiful terminal dashboards and GUIs in Golang. \n\n![example](./_examples/gridlayout/example.png)\n\nThe name was intended to be pronounced _go-bless_ due to the inspiration from [blessed-contrib](https://github.com/yaronn/blessed-contrib), but _gob-less_ is kind of funnier, so we'll go with that instead.\n\nThanks to [tcell](https://github.com/gdamore/tcell), full cross-platform terminal support is expected.\n\n## Requirements\n\n- Go 1.10+\n- Terminal with:\n  - Unicode support\n  - 256 color support\n\n## Get Started\n\n```bash\ngo get github.com/liamg/gobless\n```\n\nYou can get started by experimenting with the various [examples](_examples/).\n\n## Components\n\n### Text Box\n\n![example](./_examples/textbox/example.png)\n\n```golang\ntextbox := gobless.NewTextBox()\ntextbox.SetWidth(64)\ntextbox.SetHeight(10)\nhelloTextbox.SetTextWrap(true)\nhelloTextbox.SetText(`Lorem ipsum...`)\n```\n\nFull example code is [here](_examples/textbox).\n\n### Bar Chart\n\n![example](./_examples/barchart/example.gif)\n\n```golang\nchart := gobless.NewBarChart()\nchart.SetTitle(\"Traffic\")\nchart.SetWidth(40)\nchart.SetHeight(15)\nchart.SetYScale(100)\nchart.SetBar(\"Europe\", 60)\nchart.SetBar(\"US\", 72)\nchart.SetBar(\"Asia\", 37)\n```\n\nFull example code is [here](_examples/barchart).\n\n### Progress Bar\n\n### Sparklines\n\n### Line Chart\n\n### Block Chart\n\n(kind of like blessed-contrib's stacked gauge)\n\n### Donut\n\n### Log\n\n### Table\n\n### Tree\n\n### Dot Matrix\n\nThe dot matrix component allows you set blocks of colour at double the resolution of the terminal characters, using the various partial quadrant unicode characters.\n\nIt includes utility methods for drawing lines, circles etc.\n\n![example](./_examples/dotmatrix/example.png)\n\nExample code is [here](_examples/dotmatrix).\n\n## Layout System\n\nGobless includes a built-in CSS style 12 column nestable grid layout system. This uses `Rows` and `Columns` (which are themselves components) to quickly build a UI with minimal effort. \n\n![example](./_examples/gridlayout/example.png)\n\n```golang\nrows := []gobless.Component{\n\tgobless.NewRow(\n\t\tgobless.GridSizeHalf,\n\t\tgobless.NewColumn(\n\t\t\tgobless.GridSizeTwoThirds,\n\t\t\thelloTextbox,\n\t\t),\n\t\tgobless.NewColumn(\n\t\t\tgobless.GridSizeOneThird,\n\t\t\tgobless.NewRow(\n\t\t\t\tgobless.GridSizeFull,\n\t\t\t\tgobless.NewColumn(\n\t\t\t\t\tgobless.GridSizeFull,\n\t\t\t\t\tchart,\n\t\t\t\t\tchart2,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t), \n\tgobless.NewRow(\n\t\tgobless.GridSizeHalf,\n\t\tgobless.NewColumn(\n\t\t\tgobless.GridSizeFull,\n\t\t\tquitTextbox,\n\t\t),\n\t),\n}\n\ngui.Render(rows...)\n```\n\nYou can also detect [resize events](#events) and automatically resize the layout of your components if you wish.\n\n```golang\ngui.HandleResize(func(event gobless.ResizeEvent) {\n\tgui.Render(rows...)\n})\n```\n\nA [full example](_examples/gridlayout) is also available.\n\nAlternatively, if you need to, you can position components absolutely using the `.SetX()`, `.SetY()`, `.SetWidth()` and `.SetHeight()` methods, omitting the presence of rows/columns entirely.\n\n## Events\n\nGobless can currently detect two types of events:\n\n### Key Press Events\n\nYou can add your own handlers for key presses, utilising the `gobless.Key*` constants.\n\nFor example, to stop rendering the GUI when the user presses `CTRL` + `Q`, you could do:\n\n```\ngui.HandleKeyPress(gobless.KeyCtrlQ, func(event gobless.KeyPressEvent){\n\t\tgui.Close()\n})\n```\n\n## Terminology\n\n- A *Cell* refers to an individual terminal cell, in which a single character can be drawn.\n- A *Tile* refers to a rectangular grouping of cells.\n- A *Component* is an entity which provides a tile - or tiles - to the GUI to render. A bar chart, for example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fgobless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliamg%2Fgobless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamg%2Fgobless/lists"}