Initial commit: Azure DevOps TUI client
A terminal-based user interface for browsing and managing Azure DevOps work items. Features include: - Browse work items with filtering by area, iteration, state, and type - View work item details with markdown rendering - Open work items in browser - Create git branches from work items - Update work item state - Keyboard-driven navigation 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/samuelenocsson/devops-tui/internal/api"
|
||||
"github.com/samuelenocsson/devops-tui/internal/config"
|
||||
"github.com/samuelenocsson/devops-tui/internal/ui"
|
||||
)
|
||||
|
||||
// Execute runs the application
|
||||
func Execute() error {
|
||||
// Load configuration
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
// If config not found, try to create default
|
||||
if err := config.CreateDefaultConfig(); err == nil {
|
||||
fmt.Println("Created default config file at ~/.config/devops-tui/config.yaml")
|
||||
fmt.Println("Please edit the config file with your Azure DevOps settings.")
|
||||
os.Exit(0)
|
||||
}
|
||||
return fmt.Errorf("configuration error: %w", err)
|
||||
}
|
||||
|
||||
// Create API client
|
||||
client := api.NewClient(cfg)
|
||||
|
||||
// Create and run the TUI
|
||||
app := ui.NewApp(client)
|
||||
|
||||
p := tea.NewProgram(
|
||||
app,
|
||||
tea.WithAltScreen(),
|
||||
tea.WithMouseCellMotion(),
|
||||
)
|
||||
|
||||
if _, err := p.Run(); err != nil {
|
||||
return fmt.Errorf("error running application: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user