Skip to content

Add --dir flag to fix command#8693

Merged
pelikhan merged 4 commits intomainfrom
copilot/add-dir-flag-to-fix-command
Jan 2, 2026
Merged

Add --dir flag to fix command#8693
pelikhan merged 4 commits intomainfrom
copilot/add-dir-flag-to-fix-command

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 2, 2026

The fix command lacked a --dir flag to specify custom workflow directories, while the compile command supported it.

Changes

  • Added --dir/-d flag to fix command with shell completion support
  • Created resolveWorkflowFileInDir() helper function accepting directory parameter; existing resolveWorkflowFile() wraps it for backward compatibility
  • Modified getMarkdownWorkflowFiles() to accept optional directory parameter; defaults to .github/workflows when empty
  • Updated all callers across codebase to pass empty string for default behavior
  • Integrated with compile command's --fix flag to respect directory configuration

Usage

# Fix all workflows in custom directory
gh aw fix --dir custom/workflows --write

# Fix specific workflow in custom directory
gh aw fix my-workflow --dir custom/workflows

# Works with compile command
gh aw compile --fix --dir custom/workflows

The implementation mirrors the compile command's behavior: relative paths only, defaults to .github/workflows, supports both batch and targeted fixes.

Original prompt

the "fix" command should support a --dir flag like the compile command


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 2, 2026 23:29
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add --dir flag support to fix command Add --dir flag to fix command Jan 2, 2026
Copilot AI requested a review from pelikhan January 2, 2026 23:32
@pelikhan pelikhan marked this pull request as ready for review January 2, 2026 23:33
@pelikhan pelikhan merged commit 8980941 into main Jan 2, 2026
49 checks passed
@pelikhan pelikhan deleted the copilot/add-dir-flag-to-fix-command branch January 2, 2026 23:36
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.

2 participants