{"id":38240205,"url":"https://github.com/tinywasm/devtui","last_synced_at":"2026-01-17T01:12:36.480Z","repository":{"id":281918532,"uuid":"946720751","full_name":"tinywasm/devtui","owner":"tinywasm","description":"Reusable terminal user interface abstraction for Go development tools. Built on top of bubbletea, DevTUI provides a pre-configured, minimalist interface where you can inject different handlers to display organized messages and interactions.","archived":false,"fork":false,"pushed_at":"2026-01-14T17:29:37.000Z","size":5946,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T21:53:41.422Z","etag":null,"topics":["bubbletea","golang","golang-application","golang-library","tui","tui-app"],"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/tinywasm.png","metadata":{"files":{"readme":"README.md","changelog":"changefunc_control_test.go","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":"2025-03-11T15:17:29.000Z","updated_at":"2026-01-14T17:29:39.000Z","dependencies_parsed_at":"2025-04-06T01:21:09.567Z","dependency_job_id":"32153f5d-15a9-47fb-b4a7-5185e8006835","html_url":"https://github.com/tinywasm/devtui","commit_stats":null,"previous_names":["cdvelop/devtui","tinywasm/devtui"],"tags_count":241,"template":false,"template_full_name":null,"purl":"pkg:github/tinywasm/devtui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinywasm%2Fdevtui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinywasm%2Fdevtui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinywasm%2Fdevtui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinywasm%2Fdevtui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinywasm","download_url":"https://codeload.github.com/tinywasm/devtui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinywasm%2Fdevtui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","golang","golang-application","golang-library","tui","tui-app"],"created_at":"2026-01-17T01:12:35.936Z","updated_at":"2026-01-17T01:12:36.453Z","avatar_url":"https://github.com/tinywasm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevTUI\n\u003c!-- START_SECTION:BADGES_SECTION --\u003e\n\u003ca href=\"docs/img/badges.svg\"\u003e\u003cimg src=\"docs/img/badges.svg\" alt=\"Project Badges\" title=\"Generated by devflow from github.com/tinywasm/devflow\"\u003e\u003c/a\u003e\n\u003c!-- END_SECTION:BADGES_SECTION --\u003e\n\nDevTUI is a **pure display layer** built on Bubbletea that organizes messages from business logic into a clean terminal interface.\n\n## 🎯 Design Philosophy (Consumer-Driven)\n\nDevTUI follows **consumer-driven interface design**: your application defines the UI interface, and DevTUI implements it. This ensures:\n- **Zero Coupling**: Business logic never imports `devtui`.\n- **High Testability**: Easily mock UI dependencies.\n- **Pluggability**: Swap UI implementations without changing core logic.\n\n### Integration Interface\nDefine this in your application to use DevTUI:\n```go\ntype TuiInterface interface {\n    NewTabSection(title, description string) any\n    AddHandler(handler any, timeout time.Duration, color string, tabSection any)\n    RemoveTabSection(section any) // Dynamic removal\n    Start(args ...any)            // Optional *sync.WaitGroup support\n    RefreshUI()\n    ReturnFocus() error\n}\n```\n\n## 🚀 Quick Start\n\n```go\nfunc main() {\n    tui := devtui.NewTUI(\u0026devtui.TuiConfig{AppName: \"Demo\", ExitChan: make(chan bool)})\n\n    // 1. Create a section\n    ops := tui.NewTabSection(\"Operations\", \"System Tasks\")\n    \n    // 2. Add handlers (DevTUI detects implemented interfaces automatically)\n    tui.AddHandler(\u0026MyHandler{}, 5*time.Second, \"#10b981\", ops)\n\n    // 3. Optional: Remove section dynamically\n    // tui.RemoveTabSection(ops)\n\n    tui.Start()\n}\n```\n\n## 🧩 Handler Interfaces\n\nDevTUI detects 5 specialized interfaces to determine how to display and interact with your handlers:\n\n| Interface | Purpose | Key Methods |\n|-----------|---------|-------------|\n| **Display** | Read-only info | `Name()`, `Content()` |\n| **Edit** | Interactive input | `Label()`, `Value()`, `Change(newVal)` |\n| **Execution** | Action buttons | `Label()`, `Execute()` |\n| **Interactive** | Rich interaction | `WaitingForUser()`, `Value()`, `Change()` |\n| **Loggable** | Auto-logging | `SetLog(func(...any))` |\n\n### 💡 Clean Terminal Policy\nHandlers implementing `Loggable` receive a logger. DevTUI only displays the **most recent message** per handler to keep the view focused. Full history is preserved for debugging.\n\n#### 🔄 Animated Progress Logs\nFor long-running operations, you can use the `LogOpen` and `LogClose` prefixes as the **first argument** to the logger. This triggers an auto-animated spinner and groups messages under the same line.\n\n```go\n// Start animation (use \"[...\" literal or devtui.LogOpen)\nhandler.log(\"[...\", \"Deploying to production\")\n\n// ... long operation ...\n\n// Stop animation and show final result (use \"...]\" literal or devtui.LogClose)\nhandler.log(\"...]\", \"Deployment complete\")\n```\n\n## ⌨️ Navigation \u0026 Shortcuts\n\n- **Tab / Shift+Tab**: Switch tabs\n- **Arrows**: Navigate fields / Scroll view\n- **Enter / Esc**: Execute (Edit) / Cancel\n- **Global Shortcuts**: Handlers can implement `Shortcuts() []map[string]string` to register keys (e.g., 't' for test) that work from any tab.\n\n## 📚 Further Reading\n\n- [→ Why DevTUI? (Full Purpose)](docs/DESCRIPTION.md)\n- [→ Complete Demo Example](example/demo/main.go)\n- [→ Implementation Examples](example/)\n\n---\n[Contributing](https://github.com/tinywasm/cdvelop/blob/main/CONTRIBUTING.md) | Built with [Bubbletea](https://github.com/charmbracelet/bubbletea)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinywasm%2Fdevtui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinywasm%2Fdevtui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinywasm%2Fdevtui/lists"}