{"id":14530685,"url":"https://github.com/termkit/skeleton","last_synced_at":"2025-10-20T02:44:32.957Z","repository":{"id":254814775,"uuid":"820599589","full_name":"termkit/skeleton","owner":"termkit","description":"The Multi-tab framework of Bubbletea programs!","archived":false,"fork":false,"pushed_at":"2025-05-25T06:44:50.000Z","size":2342,"stargazers_count":52,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-03T18:49:46.665Z","etag":null,"topics":["bubbletea","cli","framework","go","golang","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/termkit.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}},"created_at":"2024-06-26T19:53:44.000Z","updated_at":"2025-05-28T01:21:59.000Z","dependencies_parsed_at":"2024-08-26T10:33:42.437Z","dependency_job_id":"42177d93-60e4-495e-8dbb-7238d020b686","html_url":"https://github.com/termkit/skeleton","commit_stats":null,"previous_names":["termkit/skeleton"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/termkit/skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termkit%2Fskeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termkit%2Fskeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termkit%2Fskeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termkit%2Fskeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/termkit","download_url":"https://codeload.github.com/termkit/skeleton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termkit%2Fskeleton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273219893,"owners_count":25066257,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"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":["bubbletea","cli","framework","go","golang","tui"],"created_at":"2024-09-05T00:01:09.117Z","updated_at":"2025-10-20T02:44:32.908Z","avatar_url":"https://github.com/termkit.png","language":"Go","readme":"# Skeleton\n\n**Skeleton** is a Go library built on top of the [Bubble Tea](https://github.com/charmbracelet/bubbletea) framework designed to simplify the development of multi-tab terminal user interface (TUI) applications.\n\n\u003ca href=\"https://github.com/termkit/skeleton\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/go-mod/go-version/termkit/skeleton?style=for-the-badge\u0026logo=go\" alt=\"Skeleton Go Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/termkit/skeleton\" target=\"_blank\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/termkit/skeleton?style=for-the-badge\u0026logo=go\" alt=\"Skeleton Go Report Card\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/termkit/skeleton\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/license/termkit/skeleton?style=for-the-badge\" alt=\"Skeleton Licence\" /\u003e\u003c/a\u003e\n\n![Skeleton](main.gif)\n\n## Features\n\n- **Multi-tab Support**: Easily create and manage multiple tabs in your terminal application, similar to browser tabs.\n- **Dynamic Widgets**: Add and update widgets on the screen, such as battery status, time, or any other information.\n- **Simple Integration**: Build complex TUI applications with a straightforward and modular approach.\n- **Customizable**: You can customize every aspect of the tabs and widgets, including key bindings and appearance. \n- **Realtime Updates**: Updates itself instantly every time the terminal is resized, appearance changes, widgets changes, content changes, etc.\n- **Responsive Design**: Automatically adjusts the layout based on the terminal size.\n\n## Tutorial\n\nSkeleton leverages Bubble Tea's architecture to provide a framework for multi-tab TUI applications. This tutorial assumes you have a working knowledge of Go and Bubble Tea.\n\nFor a complete example code, you can refer to the [source code on GitHub](https://github.com/termkit/skeleton/tree/main/examples).\n\n### Getting Started\n\nFirst, you'll need to install Skeleton. Use the following command to get it:\n\n````bash\ngo get github.com/termkit/skeleton\n````\n\n### Example Usage\n\nLet's walk through an example of how to use Skeleton to create a basic multi-tab application.\n\n#### 1. Define the Models\n\nWe'll start by defining a simple model for our tabs. Each tab will be represented by a `tinyModel` struct:\n\n````go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/termkit/skeleton\"\n\t\"github.com/charmbracelet/bubbles/key\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n)\n\n// -----------------------------------------------------------------------------\n// Tiny Model\n// The Tiny Model is a sub-model for the tabs. It's a simple model that just shows the title of the tab.\n\n// tinyModel is a sub-model for the tabs\ntype tinyModel struct {\n\tskeleton *skeleton.Skeleton\n\ttitle    string\n}\n\n// newTinyModel returns a new tinyModel\nfunc newTinyModel(skeleton *skeleton.Skeleton, title string) *tinyModel {\n\treturn \u0026tinyModel{\n\t\tskeleton: skeleton,\n\t\ttitle:    title,\n\t}\n}\n\nfunc (m tinyModel) Init() tea.Cmd {\n\treturn nil\n}\nfunc (m tinyModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\treturn m, nil\n}\nfunc (m tinyModel) View() string {\n\tverticalCenter := m.skeleton.GetTerminalHeight()/2 - 3\n\trequiredNewLines := strings.Repeat(\"\\n\", verticalCenter)\n\treturn fmt.Sprintf(\"%s%s | %d x %d\", requiredNewLines, m.title, m.skeleton.GetTerminalWidth(), m.skeleton.GetTerminalHeight())\n}\n````\n\n#### 2. Set Up the Application\n\nInitialize Skeleton, add pages, and configure widgets:\n\n````go\n// -----------------------------------------------------------------------------\n// Main Program\nfunc main() {\n\ts := skeleton.NewSkeleton()\n\n\t// Add tabs (pages)\n\ts.AddPage(\"first\", \"First Tab\", newTinyModel(s, \"First\"))\n\ts.AddPage(\"second\", \"Second Tab\", newTinyModel(s, \"Second\"))\n\ts.AddPage(\"third\", \"Third Tab\", newTinyModel(s, \"Third\"))\n\n\t// Set up key bindings ( Optional | Defaults: ctrl+left, ctrl+right )\n\t//To switch next page\n\ts.KeyMap.SwitchTabRight = key.NewBinding(\n\t\tkey.WithKeys(\"shift+right\"))\n\n\t// To switch previous page\n\ts.KeyMap.SwitchTabLeft = key.NewBinding(\n\t\tkey.WithKeys(\"shift+left\"))\n\n\t// Add a widget to entire screen\n\ts.AddWidget(\"battery\", \"Battery %92\")\n\ts.AddWidget(\"time\", time.Now().Format(\"15:04:05\"))\n\n\t// Update the time widget every second\n\tgo func() {\n\t\ttime.Sleep(time.Second)\n\t\tfor {\n\t\t\ts.UpdateWidgetValue(\"time\", time.Now().Format(\"15:04:05\"))\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}()\n\n\tp := tea.NewProgram(s)\n\tif err := p.Start(); err != nil {\n\t\tpanic(err)\n\t}\n}\n````\n\n### Understanding the Code\n\n1. **Model Definition**: `tinyModel` represents the content of each tab. It uses the Skeleton instance to query terminal dimensions and display information.\n\n2. **Application Setup**: The `main` function initializes Skeleton, adds pages, and sets up widgets. The time widget updates every second to reflect the current time.\n\n## Examples\n\nThe `examples` directory contains several demonstration applications. See [examples](examples) for more details.\n\n## Skeleton in the Wild\nSome programs that use Skeleton in production:\n\n- [gama](https://github.com/termkit/gama) - Manage your GitHub Actions from Terminal with great UI 🧪\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n## License\n\nDistributed under the GNU GENERAL PUBLIC LICENSE Version 3 or later. See [LICENSE](LICENSE) for more information.\n\n## Contact \u0026 Author\n\n[Engin Açıkgöz](https://github.com/canack)\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/termkit/skeleton.svg?variant=adaptive)](https://starchart.cc/termkit/skeleton)","funding_links":[],"categories":["Applications"],"sub_categories":["Development Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermkit%2Fskeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftermkit%2Fskeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermkit%2Fskeleton/lists"}