Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions pkg/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,16 @@ func listAgenticEngines(verbose bool) error {
return nil
}

fmt.Println(console.FormatListHeader("Available Agentic Engines"))
fmt.Println(console.FormatListHeader("========================"))

// Build table configuration
var headers []string
if verbose {
fmt.Printf("%-15s %-20s %-12s %-8s %-12s %s\n", "ID", "Display Name", "Status", "MCP", "HTTP Transport", "Description")
fmt.Printf("%-15s %-20s %-12s %-8s %-12s %s\n", "--", "------------", "------", "---", "-------------", "-----------")
headers = []string{"ID", "Display Name", "Status", "MCP", "HTTP Transport", "Description"}
} else {
fmt.Printf("%-15s %-20s %-12s %-8s %-12s\n", "ID", "Display Name", "Status", "MCP", "HTTP Transport")
fmt.Printf("%-15s %-20s %-12s %-8s %-12s\n", "--", "------------", "------", "---", "-------------")
headers = []string{"ID", "Display Name", "Status", "MCP", "HTTP Transport"}
}

var rows [][]string

for _, engineID := range engines {
engine, err := registry.GetEngine(engineID)
if err != nil {
Expand Down Expand Up @@ -191,24 +190,36 @@ func listAgenticEngines(verbose bool) error {
httpTransport = "Yes"
}

// Build row data
var row []string
if verbose {
fmt.Printf("%-15s %-20s %-12s %-8s %-12s %s\n",
row = []string{
engine.GetID(),
engine.GetDisplayName(),
status,
mcpSupport,
httpTransport,
engine.GetDescription())

engine.GetDescription(),
}
} else {
fmt.Printf("%-15s %-20s %-12s %-8s %-12s\n",
row = []string{
engine.GetID(),
engine.GetDisplayName(),
status,
mcpSupport,
httpTransport)
httpTransport,
}
}
rows = append(rows, row)
}

// Render the table
tableConfig := console.TableConfig{
Title: "Available Agentic Engines",
Headers: headers,
Rows: rows,
}
fmt.Print(console.RenderTable(tableConfig))

fmt.Println()
return nil
Expand Down Expand Up @@ -1097,10 +1108,9 @@ func StatusWorkflows(pattern string, verbose bool) error {
fmt.Printf("Successfully fetched %d GitHub workflows\n", len(githubWorkflows))
}

fmt.Println("Workflow Status:")
fmt.Println("================")
fmt.Printf("%-30s %-12s %-12s %-10s %-20s\n", "Name", "Installed", "Up-to-date", "Status", "Time Remaining")
fmt.Printf("%-30s %-12s %-12s %-10s %-20s\n", "----", "---------", "----------", "------", "--------------")
// Build table configuration
headers := []string{"Name", "Installed", "Up-to-date", "Status", "Time Remaining"}
var rows [][]string

for _, file := range mdFiles {
base := filepath.Base(file)
Expand Down Expand Up @@ -1145,8 +1155,18 @@ func StatusWorkflows(pattern string, verbose bool) error {
}
}

fmt.Printf("%-30s %-12s %-12s %-10s %-20s\n", name, compiled, upToDate, status, timeRemaining)
// Build row data
row := []string{name, compiled, upToDate, status, timeRemaining}
rows = append(rows, row)
}

// Render the table
tableConfig := console.TableConfig{
Title: "Workflow Status",
Headers: headers,
Rows: rows,
}
fmt.Print(console.RenderTable(tableConfig))

return nil
}
Expand Down
15 changes: 12 additions & 3 deletions pkg/cli/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ import (
// Test the CLI functions that are exported from this package

func TestListWorkflows(t *testing.T) {
// Test the ListWorkflows function
// Test the ListWorkflows function (which includes listAgenticEngines)
err := ListWorkflows(false)

// Since it's not implemented yet, it should return nil (no error)
// and print a message about not being implemented
// Should return nil (no error) and print table-formatted output
if err != nil {
t.Errorf("ListWorkflows should not return an error for valid input, got: %v", err)
}
}

func TestListWorkflowsVerbose(t *testing.T) {
// Test the ListWorkflows function in verbose mode
err := ListWorkflows(true)

// Should return nil (no error) and print table-formatted output with descriptions
if err != nil {
t.Errorf("ListWorkflows verbose mode should not return an error for valid input, got: %v", err)
}
}

func TestAddWorkflow(t *testing.T) {
// Clean up any existing .github/workflows for this test
defer func() {
Expand Down