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
9 changes: 9 additions & 0 deletions cmd/gh-aw/command_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ func TestCommandGroupAssignments(t *testing.T) {
{name: "init command in setup group", commandName: "init", expectedGroup: "setup", shouldHaveGroup: true},
{name: "new command in setup group", commandName: "new", expectedGroup: "setup", shouldHaveGroup: true},
{name: "add command in setup group", commandName: "add", expectedGroup: "setup", shouldHaveGroup: true},
{name: "add-wizard command in setup group", commandName: "add-wizard", expectedGroup: "setup", shouldHaveGroup: true},
{name: "remove command in setup group", commandName: "remove", expectedGroup: "setup", shouldHaveGroup: true},
{name: "update command in setup group", commandName: "update", expectedGroup: "setup", shouldHaveGroup: true},
{name: "upgrade command in setup group", commandName: "upgrade", expectedGroup: "setup", shouldHaveGroup: true},
{name: "secrets command in setup group", commandName: "secrets", expectedGroup: "setup", shouldHaveGroup: true},

// Development Commands
{name: "compile command in development group", commandName: "compile", expectedGroup: "development", shouldHaveGroup: true},
{name: "validate command in development group", commandName: "validate", expectedGroup: "development", shouldHaveGroup: true},
{name: "mcp command in development group", commandName: "mcp", expectedGroup: "development", shouldHaveGroup: true},
{name: "fix command in development group", commandName: "fix", expectedGroup: "development", shouldHaveGroup: true},
{name: "domains command in development group", commandName: "domains", expectedGroup: "development", shouldHaveGroup: true},

// Execution Commands
{name: "run command in execution group", commandName: "run", expectedGroup: "execution", shouldHaveGroup: true},
Expand All @@ -40,10 +44,15 @@ func TestCommandGroupAssignments(t *testing.T) {
{name: "audit command in analysis group", commandName: "audit", expectedGroup: "analysis", shouldHaveGroup: true},
{name: "status command in analysis group", commandName: "status", expectedGroup: "analysis", shouldHaveGroup: true},
{name: "list command in analysis group", commandName: "list", expectedGroup: "analysis", shouldHaveGroup: true},
{name: "health command in analysis group", commandName: "health", expectedGroup: "analysis", shouldHaveGroup: true},
{name: "checks command in analysis group", commandName: "checks", expectedGroup: "analysis", shouldHaveGroup: true},

// Utilities
{name: "mcp-server command in utilities group", commandName: "mcp-server", expectedGroup: "utilities", shouldHaveGroup: true},
{name: "pr command in utilities group", commandName: "pr", expectedGroup: "utilities", shouldHaveGroup: true},
{name: "completion command in utilities group", commandName: "completion", expectedGroup: "utilities", shouldHaveGroup: true},
{name: "hash-frontmatter command in utilities group", commandName: "hash-frontmatter", expectedGroup: "utilities", shouldHaveGroup: true},
{name: "project command in utilities group", commandName: "project", expectedGroup: "utilities", shouldHaveGroup: true},

// Commands without groups (intentionally)
{name: "version command without group", commandName: "version", expectedGroup: "", shouldHaveGroup: false},
Expand Down
15 changes: 12 additions & 3 deletions cmd/gh-aw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,27 +529,36 @@ func init() {
}
if cmd.HasAvailableSubCommands() {
cmds := cmd.Commands()
// Compute column width dynamically so long command names (e.g. hash-frontmatter)
// are aligned properly instead of overflowing a hard-coded width.
colWidth := 0
for _, sub := range cmds {
if (sub.IsAvailableCommand() || sub.Name() == "help") && len(sub.Name()) > colWidth {
colWidth = len(sub.Name())
}
}
colFmt := fmt.Sprintf("\n %%-%ds %%s", colWidth)
if len(cmd.Groups()) == 0 {
fmt.Fprint(out, "\n\nAvailable Commands:")
for _, sub := range cmds {
if sub.IsAvailableCommand() || sub.Name() == "help" {
fmt.Fprintf(out, "\n %-11s %s", sub.Name(), sub.Short)
fmt.Fprintf(out, colFmt, sub.Name(), sub.Short)
}
}
} else {
for _, group := range cmd.Groups() {
fmt.Fprintf(out, "\n\n%s", group.Title)
for _, sub := range cmds {
if sub.GroupID == group.ID && (sub.IsAvailableCommand() || sub.Name() == "help") {
fmt.Fprintf(out, "\n %-11s %s", sub.Name(), sub.Short)
fmt.Fprintf(out, colFmt, sub.Name(), sub.Short)
}
}
}
if !cmd.AllChildCommandsHaveGroup() {
fmt.Fprint(out, "\n\nAdditional Commands:")
for _, sub := range cmds {
if sub.GroupID == "" && (sub.IsAvailableCommand() || sub.Name() == "help") {
fmt.Fprintf(out, "\n %-11s %s", sub.Name(), sub.Short)
fmt.Fprintf(out, colFmt, sub.Name(), sub.Short)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/logs_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Examples:
logsCmd.Flags().Bool("filtered-integrity", false, "Filter to runs with DIFC (data integrity flow control) integrity-filtered items in the gateway logs")
logsCmd.Flags().Bool("parse", false, "Run JavaScript parsers on agent logs and firewall logs, writing Markdown to log.md and firewall.md")
addJSONFlag(logsCmd)
logsCmd.Flags().Int("timeout", 0, "Download timeout in seconds (0 = no timeout; note: trial uses minutes for its timeout)")
logsCmd.Flags().Int("timeout", 0, "Download timeout in seconds (0 = no timeout)")
logsCmd.Flags().String("summary-file", "summary.json", "Path to write the summary JSON file relative to output directory (use empty string to disable)")
logsCmd.MarkFlagsMutuallyExclusive("firewall", "no-firewall")

Expand Down
1 change: 1 addition & 0 deletions pkg/cli/mcp_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ This command searches the MCP registry for the specified server, adds it to the
and automatically compiles the workflow. If the tool already exists, the command will fail.

When called with no arguments, it will show a list of available MCP servers from the registry.
When called with only a workflow argument, it will show an error asking for a server name.

The workflow-id-or-file can be:
- A workflow ID (basename without .md extension, e.g., "weekly-research")
Expand Down
Loading