@@ -339,7 +339,8 @@ Examples:
339339 ` + constants .CLIExtensionPrefix + ` logs --tool-graph # Generate Mermaid tool sequence graph
340340 ` + constants .CLIExtensionPrefix + ` logs --parse # Parse logs and generate markdown reports
341341 ` + constants .CLIExtensionPrefix + ` logs --json # Output metrics in JSON format
342- ` + constants .CLIExtensionPrefix + ` logs --parse --json # Generate both markdown and JSON` ,
342+ ` + constants .CLIExtensionPrefix + ` logs --parse --json # Generate both markdown and JSON
343+ ` + constants .CLIExtensionPrefix + ` logs weekly-research --repo owner/repo # Download logs from specific repository` ,
343344 Run : func (cmd * cobra.Command , args []string ) {
344345 var workflowName string
345346 if len (args ) > 0 && args [0 ] != "" {
@@ -387,6 +388,7 @@ Examples:
387388 parse , _ := cmd .Flags ().GetBool ("parse" )
388389 jsonOutput , _ := cmd .Flags ().GetBool ("json" )
389390 timeout , _ := cmd .Flags ().GetInt ("timeout" )
391+ repoOverride , _ := cmd .Flags ().GetString ("repo" )
390392
391393 // Resolve relative dates to absolute dates for GitHub CLI
392394 now := time .Now ()
@@ -435,7 +437,7 @@ Examples:
435437 os .Exit (1 )
436438 }
437439
438- if err := DownloadWorkflowLogs (workflowName , count , startDate , endDate , outputDir , engine , branch , beforeRunID , afterRunID , verbose , toolGraph , noStaged , firewallOnly , noFirewall , parse , jsonOutput , timeout ); err != nil {
440+ if err := DownloadWorkflowLogs (workflowName , count , startDate , endDate , outputDir , engine , branch , beforeRunID , afterRunID , repoOverride , verbose , toolGraph , noStaged , firewallOnly , noFirewall , parse , jsonOutput , timeout ); err != nil {
439441 fmt .Fprintln (os .Stderr , console .FormatError (console.CompilerError {
440442 Type : "error" ,
441443 Message : err .Error (),
@@ -454,6 +456,7 @@ Examples:
454456 logsCmd .Flags ().String ("branch" , "" , "Filter runs by branch name (e.g., main, feature-branch)" )
455457 logsCmd .Flags ().Int64 ("before-run-id" , 0 , "Filter runs with database ID before this value (exclusive)" )
456458 logsCmd .Flags ().Int64 ("after-run-id" , 0 , "Filter runs with database ID after this value (exclusive)" )
459+ logsCmd .Flags ().StringP ("repo" , "r" , "" , "Repository to download logs from (owner/repo format)" )
457460 logsCmd .Flags ().Bool ("tool-graph" , false , "Generate Mermaid tool sequence graph from agent logs" )
458461 logsCmd .Flags ().Bool ("no-staged" , false , "Filter out staged workflow runs (exclude runs with staged: true in aw_info.json)" )
459462 logsCmd .Flags ().Bool ("firewall" , false , "Filter to only runs with firewall enabled" )
@@ -466,7 +469,7 @@ Examples:
466469}
467470
468471// DownloadWorkflowLogs downloads and analyzes workflow logs with metrics
469- func DownloadWorkflowLogs (workflowName string , count int , startDate , endDate , outputDir , engine , branch string , beforeRunID , afterRunID int64 , verbose bool , toolGraph bool , noStaged bool , firewallOnly bool , noFirewall bool , parse bool , jsonOutput bool , timeout int ) error {
472+ func DownloadWorkflowLogs (workflowName string , count int , startDate , endDate , outputDir , engine , branch string , beforeRunID , afterRunID int64 , repoOverride string , verbose bool , toolGraph bool , noStaged bool , firewallOnly bool , noFirewall bool , parse bool , jsonOutput bool , timeout int ) error {
470473 logsLog .Printf ("Starting workflow log download: workflow=%s, count=%d, startDate=%s, endDate=%s, outputDir=%s" , workflowName , count , startDate , endDate , outputDir )
471474 if verbose {
472475 fmt .Fprintln (os .Stderr , console .FormatInfoMessage ("Fetching workflow runs from GitHub Actions..." ))
@@ -543,7 +546,7 @@ func DownloadWorkflowLogs(workflowName string, count int, startDate, endDate, ou
543546 }
544547 }
545548
546- runs , totalFetched , err := listWorkflowRunsWithPagination (workflowName , batchSize , startDate , endDate , beforeDate , branch , beforeRunID , afterRunID , len (processedRuns ), count , verbose )
549+ runs , totalFetched , err := listWorkflowRunsWithPagination (workflowName , batchSize , startDate , endDate , beforeDate , branch , beforeRunID , afterRunID , repoOverride , len (processedRuns ), count , verbose )
547550 if err != nil {
548551 return err
549552 }
@@ -1032,7 +1035,7 @@ func downloadRunArtifactsConcurrent(runs []WorkflowRun, outputDir string, verbos
10321035// not the total number of matching runs the user wants to find.
10331036//
10341037// The processedCount and targetCount parameters are used to display progress in the spinner message.
1035- func listWorkflowRunsWithPagination (workflowName string , limit int , startDate , endDate , beforeDate , branch string , beforeRunID , afterRunID int64 , processedCount , targetCount int , verbose bool ) ([]WorkflowRun , int , error ) {
1038+ func listWorkflowRunsWithPagination (workflowName string , limit int , startDate , endDate , beforeDate , branch string , beforeRunID , afterRunID int64 , repoOverride string , processedCount , targetCount int , verbose bool ) ([]WorkflowRun , int , error ) {
10361039 args := []string {"run" , "list" , "--json" , "databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle" }
10371040
10381041 // Add filters
@@ -1056,6 +1059,10 @@ func listWorkflowRunsWithPagination(workflowName string, limit int, startDate, e
10561059 if branch != "" {
10571060 args = append (args , "--branch" , branch )
10581061 }
1062+ // Add repo filter
1063+ if repoOverride != "" {
1064+ args = append (args , "--repo" , repoOverride )
1065+ }
10591066
10601067 if verbose {
10611068 fmt .Println (console .FormatInfoMessage (fmt .Sprintf ("Executing: gh %s" , strings .Join (args , " " ))))
0 commit comments