Objective
Enhance shell completions to show workflow descriptions alongside workflow names when users press TAB, leveraging Cobra v1.9.0+ CompletionWithDesc functionality.
Context
Currently, shell completions only show workflow names. With completion descriptions, users will see:
my-workflow Daily CI workflow for testing
deploy-prod Production deployment workflow
This significantly improves discoverability and reduces need to check workflow files.
Implementation Approach
-
Locate completion function in pkg/cli/completions.go:
- Find
CompleteWorkflowNames() function
-
Create description extractor:
func getWorkflowDescription(filepath string) string {
// Read markdown file
// Parse frontmatter
// Extract 'description' or 'name' field
// Return truncated string (max 60 chars)
}
-
Update completion function to use tab-separated format:
for _, file := range mdFiles {
name := strings.TrimSuffix(filepath.Base(file), ".md")
desc := getWorkflowDescription(file)
completions = append(completions, fmt.Sprintf("%s\t%s", name, desc))
}
-
Test in multiple shells:
- Bash:
gh aw run (TAB)
- Zsh:
gh aw compile (TAB)
- Fish:
gh aw enable (TAB)
Files to Modify
Acceptance Criteria
References
AI generated by Plan Command for discussion #8545
Objective
Enhance shell completions to show workflow descriptions alongside workflow names when users press TAB, leveraging Cobra v1.9.0+
CompletionWithDescfunctionality.Context
Currently, shell completions only show workflow names. With completion descriptions, users will see:
This significantly improves discoverability and reduces need to check workflow files.
Implementation Approach
Locate completion function in
pkg/cli/completions.go:CompleteWorkflowNames()functionCreate description extractor:
Update completion function to use tab-separated format:
Test in multiple shells:
gh aw run (TAB)gh aw compile (TAB)gh aw enable (TAB)Files to Modify
Update:
pkg/cli/completions.goCompleteWorkflowNames()to include descriptionsgetWorkflowDescription()helper functionUpdate:
pkg/cli/completions_test.go(if exists, otherwise create)Acceptance Criteria
References
CompletionWithDeschelper"completion\tdescription"per shell completion standardsRelated to [plan] Enhance Cobra CLI implementation with completion descriptions and context support #8552