a4c8fb91f6
Builds on initial v1 with: compliance job scheduling and result tracking, structured run history with findings/log storage, host-level drift details view, git-backed playbook/inventory support, and comprehensive test coverage across all packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51 lines
1004 B
Go
51 lines
1004 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
|
|
"ansibletui/internal/config"
|
|
"ansibletui/internal/history"
|
|
"ansibletui/internal/inventory"
|
|
"ansibletui/internal/ui"
|
|
)
|
|
|
|
func main() {
|
|
cfg, err := config.Load()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "config: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if errs := cfg.SyncGitRepos(context.Background()); len(errs) > 0 {
|
|
for _, e := range errs {
|
|
fmt.Fprintf(os.Stderr, "git sync warning: %v\n", e)
|
|
}
|
|
}
|
|
|
|
invPath := cfg.EffectiveInventoryPath()
|
|
inv, err := inventory.Load(invPath)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "inventory: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
runsDir, err := config.RunsDir()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "runs dir: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
hist := history.New(runsDir)
|
|
|
|
app := ui.New(cfg, inv, hist)
|
|
p := tea.NewProgram(app, tea.WithAltScreen(), tea.WithMouseAllMotion())
|
|
if _, err := p.Run(); err != nil {
|
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|