Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

The status command lacked the --repo flag present in enable and disable commands, preventing users from checking workflow status in other repositories.

Changes

  • Command definition: Added --repo/-r flag to status command with help text example
  • Function signatures: Updated StatusWorkflows() and fetchLatestRunsByRef() to accept repoOverride parameter
  • GitHub API calls: Passed repoOverride to fetchGitHubWorkflows() and workflow run listing operations
  • Tests: Updated all test calls to match new signatures

Usage

gh aw status --repo owner/other-repo
gh aw status -r owner/other-repo ci-  # Filter with pattern

The flag follows the same pattern as enable/disable commands for consistency.

Original prompt

This section details on the original issue you should resolve

<issue_title>[cli-consistency] Status command lacks --repo flag unlike enable/disable commands</issue_title>
<issue_description>## Issue Description

Command: gh aw status
Type: Missing flag for consistency
Priority: Medium

Current Output (from pkg/cli/status.go, lines 24-44)

The status command shows the status of workflows but does not accept a --repo flag to check workflows in a different repository.

cmd.Flags().String("ref", "", "Filter runs by branch or tag name (e.g., main, v1.0.0)")
cmd.Flags().String("label", "", "Filter workflows by label")

Issue

The enable and disable commands (cmd/gh-aw/main.go, lines 493-494) both support a --repo flag:

enableCmd.Flags().StringP("repo", "r", "", "Target repository (owner/repo format). Defaults to current repository")
disableCmd.Flags().StringP("repo", "r", "", "Target repository (owner/repo format). Defaults to current repository")

This creates an inconsistent user experience where users can enable/disable workflows in other repositories but cannot check their status.

Suggested Fix

Add a --repo flag to the status command for consistency:

cmd.Flags().StringP("repo", "r", "", "Target repository (owner/repo format). Defaults to current repository")

Update the help text to include an example:

Examples:
  gh aw status                          # Show all workflow status
  gh aw status ci-                      # Show workflows with 'ci-' in name
  gh aw status --repo owner/other-repo  # Check status in different repository

This would make the workflow management commands (status, enable, disable) consistent in their ability to operate across repositories.

AI generated by CLI Consistency Checker

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 24, 2025
Copilot AI and others added 3 commits December 24, 2025 13:14
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add --repo flag to status command for consistency Add --repo flag to status command for cross-repository workflow inspection Dec 24, 2025
Copilot AI requested a review from mnkiefer December 24, 2025 13:24
@pelikhan pelikhan marked this pull request as ready for review December 24, 2025 15:08
@pelikhan pelikhan merged commit b455683 into main Dec 24, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-repo-flag-to-status branch December 24, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cli-consistency] Status command lacks --repo flag unlike enable/disable commands

3 participants