diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-12 20:42:09 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-12 20:42:09 -0800 |
| commit | fa037e748bb2ba65f75ba104e18d460a8fbcd49b (patch) | |
| tree | 9a6c33024475ff6fd08013e39aee9717296cc638 /main.go | |
| parent | 27d14514ab3c3c11e822fc2c1220072298e85c02 (diff) | |
| download | neko-fa037e748bb2ba65f75ba104e18d460a8fbcd49b.tar.gz neko-fa037e748bb2ba65f75ba104e18d460a8fbcd49b.tar.bz2 neko-fa037e748bb2ba65f75ba104e18d460a8fbcd49b.zip | |
Implement Bubble Tea Terminal UI (TUI)
- Added Bubble Tea, Lipgloss, and Bubbles dependencies
- Implemented TUI package in tui/ for browsing feeds and items
- Added --tui flag to main command
- Verified build and existing tests
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -2,6 +2,7 @@ package main import ( "fmt" + "log" "time" "adammathes.com/neko/config" @@ -9,6 +10,7 @@ import ( "adammathes.com/neko/exporter" "adammathes.com/neko/models" "adammathes.com/neko/models/feed" + "adammathes.com/neko/tui" "adammathes.com/neko/vlog" "adammathes.com/neko/web" flag "github.com/ogier/pflag" @@ -17,7 +19,7 @@ import ( var Version, Build string func main() { - var help, update, verbose, proxyImages bool + var help, update, verbose, proxyImages, tuiMode bool var configFile, dbfile, newFeed, export, password string var port, minutes int @@ -35,6 +37,7 @@ func main() { flag.IntVarP(&port, "http", "s", 0, "HTTP port to serve on") flag.IntVarP(&minutes, "minutes", "m", 0, "minutes between crawling feeds") flag.BoolVarP(&proxyImages, "imageproxy", "i", false, "rewrite and proxy all image requests for privacy (experimental)") + flag.BoolVarP(&tuiMode, "tui", "t", false, "launch terminal UI") flag.BoolVarP(&verbose, "verbose", "v", false, "verbose output") // passwords on command line are bad, you should use the config file @@ -92,6 +95,13 @@ func main() { return } + if tuiMode { + if err := tui.Run(); err != nil { + log.Fatal(err) + } + return + } + go backgroundCrawl(config.Config.CrawlMinutes) vlog.Printf("starting web server at 127.0.0.1:%d\n", config.Config.Port) |
