rivo/tview

GitHub: rivo/tview

一个基于 Go 的终端 UI 组件库,提供丰富的交互式 Widget,用于快速构建命令行图形界面应用。

Stars: 14007 | Forks: 682

# 用于终端 UI 的丰富交互式组件 [![PkgGoDev](https://pkg.go.dev/badge/github.com/rivo/tview)](https://pkg.go.dev/github.com/rivo/tview) [![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/tview) 这个 Go 包提供了基于终端的用户界面常用组件。 ![截图](https://static.pigsec.cn/wp-content/uploads/repos/cas/d2/d2876a5411084647ba57551a58b5bb4212cc0d24dd00237e40965f0a838cdb79.gif) 这些组件包括: - __输入表单__(包括 __文本输入__、__选择框__、__复选框__ 和 __按钮__) - 可导航的多色 __文本视图__ - 可编辑的多行 __文本区域__ - 精致的可导航 __表格视图__ - 灵活的 __树状视图__ - 可选择的 __列表__ - __图片__ - __网格__、__弹性布局__ 和 __页面布局__ - 模态 __消息窗口__ - 一个 __应用__ 包装器 它们带有许多自定义选项,并且可以轻松扩展以满足您的需求。 ## 用法 要将此包添加到您的项目中: ``` go get github.com/rivo/tview@master ``` ## Hello World 这个基本示例创建了一个标题为“Hello, World!”的框,并将其显示在您的终端中: ``` package main import ( "github.com/rivo/tview" ) func main() { box := tview.NewBox().SetBorder(true).SetTitle("Hello, world!") if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil { panic(err) } } ``` 查看 [GitHub Wiki](https://github.com/rivo/tview/wiki) 以获取更多示例和截图。或者尝试“demos”子目录中的示例。 如需查看重点介绍此包的演示,请编译并运行“demos/presentation”子目录中的程序。 ## 使用 `tview` 的项目 - [K9s - Kubernetes CLI](https://github.com/derailed/k9s) - [IRCCloud 终端客户端](https://github.com/termoose/irccloud) - [`tview` 的窗口管理器](https://github.com/epiclabs-io/winman) - [CLI 书签管理器](https://github.com/Endi1/drawer) - [用 Go 编写的洞穴数据库界面](https://github.com/IdlePhysicist/cave-logger) - [交互式文件浏览与执行任意命令。](https://github.com/bannzai/itree) - [完整的 LDAP TUI](https://github.com/Macmod/godap) - [一个简单的 CRM](https://github.com/broadcastle/crm) - [todist 的终端 UI](https://github.com/cyberdummy/todoista) - [图形化 kubectl 包装器](https://github.com/dcaiafa/kpick) - [Decred 去中心化交易所 ](https://github.com/decred/dcrdex) - [适用于 Raspberry PI 的 CLI 文件浏览器](https://github.com/destinmoulton/pixi) - [一个用于管理项目的工具。](https://github.com/divramod/dp) - [一个用于 BMI 监测的简单应用](https://github.com/erleene/go-bmi) - [从命令行播放 TIDAL 流媒体](https://github.com/godsic/vibe) - [完全去中心化密码管理的安全解决方案](https://github.com/guillaumemichel/passtor/) - [不断增长的便捷小工具合集,用于处理 systemd 服务](https://github.com/muesli/service-tools/) - [用 Go 编写的基于终端的 Redis 浏览器](https://github.com/nitishm/redis-terminal) - [计算机网络课程的第一个项目。](https://github.com/pablogadhi/XMPPClient) - [在终端中测试你的打字速度!](https://github.com/shilangyu/typer-go) - [Docker 的 TUI 客户端](https://github.com/skanehira/docui) - [使用由 HashiCorp Vault 签名的证书的 SSH 客户端](https://github.com/stephane-martin/vssh) - [VMware vCenter Text UI](https://github.com/thebsdbox/vctui) - [终端上的书签](https://github.com/tryffel/bookmarker) - [一个 UDP 测试工具](https://github.com/vaelen/udp-tester) - [一个适用于您终端的简单看板](https://github.com/witchard/toukan) - [适用于您终端的个人信息仪表板。 ](https://github.com/wtfutil/wtf) - [MySQL 数据库转 Golang 结构体](https://github.com/xxjwxc/gormt) - [Discord、TUI 和 SIXEL。](https://gitlab.com/diamondburned/6cord) - [一个 CLI 音频播放器](https://www.github.com/dhulihan/grump) - [GLab,一个 GitLab CLI 工具](https://gitlab.com/profclems/glab) - [在终端中浏览您的 AWS ECS 集群](https://github.com/swartzrock/ecsview) - [面向极客的 CLI 任务管理器](https://github.com/ajaxray/geek-life) - [使用 Go 编写的快速磁盘使用率分析器](https://github.com/dundee/gdu) - [终端上的多人国际象棋](https://github.com/qnkhuat/gochess) - [可编写脚本的 TUI 音乐播放器](https://github.com/issadarkthing/gomu) - [MangaDesk:用于将漫画下载到您电脑的 TUI 客户端](https://github.com/darylhjd/mangadesk) - [Go How Much?从终端追踪加密货币价格](https://github.com/ledongthuc/gohowmuch) - [dbui:通用数据库连接 CLI](https://github.com/KenanBek/dbui) - [ssmbrowse:简单优雅的 AWS SSM 参数 CLI 浏览器](https://github.com/bnaydenov/ssmbrowse) - [gobit:binance 情报终端](https://github.com/infl00p/gobit) - [viddy:一个现代的 watch 命令](https://github.com/sachaos/viddy) - [s3surfer:用于交互式浏览 S3 存储桶并下载对象的 CLI 工具](https://github.com/hirose31/s3surfer) - [libgen-tui:用于从 Library Genesis 下载书籍的终端 UI](https://github.com/audstanley/libgen-tui) - [kubectl-lazy:方便查看 pod 的 kubectl 插件](https://github.com/togettoyou/kubectl-lazy) - [podman-tui:podman 用户界面](https://github.com/containers/podman-tui) - [tvxwidgets:tview 额外组件](https://github.com/navidys/tvxwidgets) - [终端上的多米诺骨牌游戏](https://github.com/gusti-andika/card-domino.git) - [goaround:查询 stackoverflow API 并在终端获取结果](https://github.com/glendsoza/goaround) - [resto:一个能通过 TUI 发送漂亮 HTTP & API 请求的 CLI 应用](https://github.com/abdfnx/resto) - [twad:终端上的 WAD 启动器](https://github.com/zmnpl/twad) - [pacseek:用于搜索和安装 Arch Linux 软件包的 TUI](https://github.com/moson-mo/pacseek) - [7GUIs 演示](https://github.com/letientai299/7guis/tree/master/tui) - [tuihub:个人使用的实用工具中心/仪表板](https://github.com/ashis0013/tuihub) - [l'oggo:用于结构化日志流(GCP stack driver、k8s、本地流)的终端应用](https://github.com/aurc/loggo) - [reminder:以最小努力组织任务的基于终端的交互式应用。](https://github.com/goyalmunish/reminder) - [tufw:ufw 的终端 UI。](https://github.com/peltho/tufw) - [gh:GitHub CLI](https://github.com/cli/cli) - [piptui:管理 pip 包的终端 UI](https://github.com/glendsoza/piptui/) - [cross-clipboard:跨平台剪贴板共享](https://github.com/ntsd/cross-clipboard) - [tui-deck:nextcloud deck 前端](https://github.com/mebitek/tui-deck) - [ktop:适用于您 Kubernetes 集群的类似 top 的工具](https://github.com/vladimirvivien/ktop) - [blimp:用于天气、网络延迟、应用状态等的 UI](https://github.com/merlinfuchs/blimp) - [Curly - 利用 curl 测试 endpoint 的简单 TUI](https://github.com/migcaraballo/curly) - [amtui:Alertmanager TUI](https://github.com/pehlicd/amtui) - [一个 TUI CLI 管理器](https://github.com/costa86/cli-manager) - [PrivateBTC](https://github.com/adrianbrad/privatebtc) - [play:一个用于试验您喜爱程序(如 grep、sed、awk、jq 和 yq)的 TUI 环境](https://github.com/paololazzari/play) - [gorest:在您的终端中享受发送 HTTP 请求,就像您在 Insomnia 中做的那样。](https://github.com/NathanFirmo/gorest) - [用于收听全球广播电台的终端应用!](https://github.com/vergonha/garden-tui) - [ntui:管理 Hashicorp Nomad 集群的 TUI](https://github.com/SHAPPY0/ntui) - [lazysql:用 Go 编写的跨平台 TUI 数据库管理工具](https://github.com/jorgerojas26/lazysql) - [redis-tui:CLI 中的 Redis 文本 UI 客户端](https://github.com/mylxsw/redis-tui) - [fen:文件管理器](https://github.com/kivattt/fen) - [sqltui:操作 sql 和 nosql 数据库的终端 UI](https://github.com/LinPr/sqltui) - [DBee:简单的数据库浏览器](https://github.com/murat-cileli/dbee) - [oddshub:体育博彩赔率的 TUI](https://github.com/dos-2/oddshub) - [envolve:用于管理环境变量的基于终端的交互式应用](https://github.com/erdemkosk/envolve) - [zfs-file-history:用于检查和恢复 ZFS 快照上文件历史的终端 UI](https://github.com/markusressel/zfs-file-history) - [fan2go-tui:fan2go 的终端 UI](https://github.com/markusressel/fan2go-tui) - [NatsDash:NATS Jetstream 的终端 UI](https://nats-dash-gui.returnzero.win/) - [tuissh:管理 SSH 连接的终端 UI](https://github.com/linuxexam/tuissh) - [chiko:终极美观的 TUI gRPC 客户端](https://github.com/felangga/chiko) - [kmip-explorer:从终端浏览和管理您的 KMIP 对象](https://github.com/phsym/kmip-explorer) - [stui:用于管理 HPC 集群的 Slurm TUI](https://github.com/antvirf/stui) - [nerdlog:带有时间线直方图的快速、远程优先、多主机日志查看器](https://github.com/dimonomid/nerdlog) - [lxz:强大的 DevOps 图形化命令行界面工具](https://github.com/liangzhaoliang95/lxz) - [vaulty:Azure Keyvault 的终端 UI](https://github.com/declan-whiting/vaulty) - [pago:命令行密码管理器](https://github.com/dbohdan/pago) ## 文档 有关此包的文档,请参阅 https://pkg.go.dev/github.com/rivo/tview。也请查看 [Wiki](https://github.com/rivo/tview/wiki)。 ## 依赖 此包基于 [github.com/gdamore/tcell](https://github.com/gdamore/tcell)(及其依赖项)以及 [github.com/rivo/uniseg](https://github.com/rivo/uniseg) 构建。 ## 向后兼容性 我非常努力地保持这个项目的向后兼容性。当您升级 `tview` 时,您的软件应该不会崩溃。但这也意味着,初始版本中存在的一些缺陷将继续保留。话虽如此,在以下情况下,向后兼容性仍然可能会被打破: - 导入包的新版本(最可能是 [`tcell`](https://github.com/gdamore/tcell))发生更改,迫使我也必须对 `tview` 进行更改, - 我修复了认为是 bug 的内容,而不是功能,或者是没有按最初预期工作的内容, - 我更改了诸如 [`Primitive`](https://pkg.go.dev/github.com/rivo/tview#Primitive) 之类的“内部”接口。除非您正在为 `tview` 编写自己的 primitive,否则您不应该需要这些接口。(是的,我意识到这些是公开的接口。这有优点也有缺点。目前情况就是如此。) ## 您的反馈 请在 GitHub 上添加您的 issue。如果您有任何问题,请随时联系。 ## 行为准则 我们遵循 Golang 的行为准则,您可以在[这里](https://golang.org/conduct)找到。
标签:EVTX分析, Golang, SOC Prime, TUI, 安全编程, 开发工具, 日志审计, 组件库, 终端UI