Initial vcom TUI prototype

This commit is contained in:
vrubelroman 2026-04-22 22:10:50 +03:00
commit 059f925e00
16 changed files with 3227 additions and 0 deletions

35
cmd/vcom/main.go Normal file
View file

@ -0,0 +1,35 @@
package main
import (
"flag"
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"vcom/internal/config"
"vcom/internal/ui"
)
func main() {
configPath := flag.String("config", "", "path to vcom TOML config")
flag.Parse()
cfg, resolvedPath, err := config.Load(*configPath)
if err != nil {
fmt.Fprintf(os.Stderr, "config error: %v\n", err)
os.Exit(1)
}
model, err := ui.NewModel(cfg, resolvedPath)
if err != nil {
fmt.Fprintf(os.Stderr, "startup error: %v\n", err)
os.Exit(1)
}
program := tea.NewProgram(model, tea.WithAltScreen())
if _, err := program.Run(); err != nil {
fmt.Fprintf(os.Stderr, "runtime error: %v\n", err)
os.Exit(1)
}
}