Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5431097
remove old package functionality
dsyme Feb 17, 2026
8a5f0a4
remove old package functionality
dsyme Feb 17, 2026
0f2811f
remove old package functionality
dsyme Feb 17, 2026
f6c3821
Merge branch 'main' of https://github.com/github/gh-aw into simp2
dsyme Feb 17, 2026
dcab232
fix test
dsyme Feb 17, 2026
2075df6
fix test
dsyme Feb 17, 2026
6e9e849
Merge branch 'main' of https://github.com/github/gh-aw into simp2
dsyme Feb 17, 2026
9222d18
fix test
dsyme Feb 17, 2026
9f13691
fix test
dsyme Feb 17, 2026
aa50ce2
fix test
dsyme Feb 17, 2026
df9c47b
fix test
dsyme Feb 17, 2026
f3db3c2
Update pkg/cli/spec.go
dsyme Feb 17, 2026
6b75d79
fix test
dsyme Feb 17, 2026
2e79da5
fix test
dsyme Feb 17, 2026
df195e9
Update pkg/cli/spec.go
dsyme Feb 17, 2026
c3ed6dd
Merge branch 'simp2' of https://github.com/github/gh-aw into simp2
dsyme Feb 17, 2026
d9b76a4
fix test
dsyme Feb 17, 2026
b638aba
fix test
dsyme Feb 17, 2026
fd6dc7d
adjust engine if override
dsyme Feb 17, 2026
66505c8
adjust engine if override
dsyme Feb 17, 2026
1bf0d97
Update pkg/cli/add_workflow_resolution.go
dsyme Feb 17, 2026
4a0389b
adjust for code review
dsyme Feb 17, 2026
e79302a
Merge branch 'simp2' of https://github.com/github/gh-aw into simp2
dsyme Feb 17, 2026
3c45eda
Merge branch 'main' of https://github.com/github/gh-aw into simp2
dsyme Feb 17, 2026
76333ca
adjust for code review
dsyme Feb 17, 2026
95c4a88
adjust for code review
dsyme Feb 17, 2026
21abf42
adjust for code review
dsyme Feb 17, 2026
adb956f
fix tests, remove --number option
dsyme Feb 17, 2026
e40fecf
fix tests, remove --number option
dsyme Feb 17, 2026
b3efb04
fix tests, remove --number option
dsyme Feb 17, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/daily-cli-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This will execute `make bench-performance` which runs targeted performance bench
The targeted benchmarks include:
- **Workflow compilation**: CompileSimpleWorkflow, CompileComplexWorkflow, CompileMCPWorkflow, CompileMemoryUsage
- **Workflow phases**: ParseWorkflow, Validation, YAMLGeneration
- **CLI helpers**: ExtractWorkflowNameFromFile, UpdateWorkflowTitle, FindIncludesInContent
- **CLI helpers**: ExtractWorkflowNameFromFile, FindIncludesInContent

**Step 3**: Copy results to our tracking directory

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bench-performance:
-benchmem -benchtime=3x -run=^$$ ./pkg/workflow | tee bench_performance.txt
@echo ""
@echo "Also running CLI helper benchmarks..."
@go test -bench='Benchmark(ExtractWorkflowNameFromFile|UpdateWorkflowTitle|FindIncludesInContent)$$' \
@go test -bench='Benchmark(ExtractWorkflowNameFromFile|FindIncludesInContent)$$' \
-benchmem -benchtime=3x -run=^$$ ./pkg/cli >> bench_performance.txt
@echo ""
@echo "Performance benchmark results saved to bench_performance.txt"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/packaging-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gh aw add githubnext/agentics/ci-doctor@v1.0.0 # with version
gh aw add githubnext/agentics/workflows/ci-doctor.md # explicit path
```

Use `--name`, `--pr`, `--force`, `--number`, `--engine`, or `--verbose` flags to customize installation. The `source` field is automatically added to workflow frontmatter for tracking origin and enabling updates.
Use `--name`, `--pr`, `--force`, `--engine`, or `--verbose` flags to customize installation. The `source` field is automatically added to workflow frontmatter for tracking origin and enabling updates.

## Updating Workflows

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/setup/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ Add workflows from The Agentics collection or other repositories to `.github/wor
```bash wrap
gh aw add githubnext/agentics/ci-doctor # Add single workflow
gh aw add "githubnext/agentics/ci-*" # Add multiple with wildcards
gh aw add ci-doctor --dir shared --number 3 # Organize in subdirectories with copies
gh aw add ci-doctor --dir shared # Organize in subdirectory
gh aw add ci-doctor --create-pull-request # Create PR instead of commit
```

**Options:** `--dir`, `--number`, `--create-pull-request` (or `--pr`), `--no-gitattributes`
**Options:** `--dir`, `--create-pull-request` (or `--pr`), `--no-gitattributes`

#### `new`

Expand Down
380 changes: 167 additions & 213 deletions pkg/cli/add_command.go

Large diffs are not rendered by default.

213 changes: 0 additions & 213 deletions pkg/cli/add_command_table_test.go

This file was deleted.

45 changes: 8 additions & 37 deletions pkg/cli/add_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ func TestNewAddCommand(t *testing.T) {
// Verify flags are registered
flags := cmd.Flags()

// Check number flag
numberFlag := flags.Lookup("number")
assert.NotNil(t, numberFlag, "Should have 'number' flag")
assert.Empty(t, numberFlag.Shorthand, "Number flag should not have shorthand (conflicts with logs -c)")

// Check name flag
nameFlag := flags.Lookup("name")
assert.NotNil(t, nameFlag, "Should have 'name' flag")
Expand Down Expand Up @@ -88,30 +83,26 @@ func TestAddWorkflows(t *testing.T) {
tests := []struct {
name string
workflows []string
number int
expectError bool
errorContains string
}{
{
name: "empty workflows list",
workflows: []string{},
number: 1,
expectError: true,
errorContains: "at least one workflow",
},
{
name: "repo-only spec (should list workflows)",
workflows: []string{"owner/repo"},
number: 1,
expectError: true, // Will error on workflow listing, but tests repo-only detection
name: "repo-only spec (requires workflow path)",
workflows: []string{"owner/repo"},
expectError: true,
errorContains: "workflow specification must be in format",
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
opts := AddOptions{
Number: tt.number,
}
opts := AddOptions{}
_, err := AddWorkflows(tt.workflows, opts)

if tt.expectError {
Expand All @@ -126,34 +117,17 @@ func TestAddWorkflows(t *testing.T) {
}
}

// TestUpdateWorkflowTitle is tested in commands_utils_test.go
// Removed duplicate test to avoid redeclaration

// TestAddCommandStructure removed - redundant with TestNewAddCommand

func TestAddResolvedWorkflows(t *testing.T) {
tests := []struct {
name string
number int
expectError bool
errorContains string
}{
{
name: "invalid number - zero",
number: 0,
expectError: true,
errorContains: "number of copies must be a positive integer",
},
{
name: "invalid number - negative",
number: -1,
expectError: true,
errorContains: "number of copies must be a positive integer",
},
{
name: "valid number - one",
number: 1,
expectError: true, // Will still error due to missing workflow, but validates number check
name: "valid workflow",
expectError: true, // Will still error due to missing git repo, but validates basic flow
},
}

Expand All @@ -174,9 +148,7 @@ func TestAddResolvedWorkflows(t *testing.T) {
},
}

opts := AddOptions{
Number: tt.number,
}
opts := AddOptions{}
_, err := AddResolvedWorkflows(
[]string{"test/repo/test-workflow"},
resolved,
Expand Down Expand Up @@ -320,7 +292,6 @@ func TestAddCommandFlagDefaults(t *testing.T) {
flagName string
defaultValue string
}{
{"number", "1"},
{"name", ""},
{"engine", ""},
{"repo", ""},
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/add_current_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestAddWorkflowsFromCurrentRepository(t *testing.T) {
// Clear cache before each test
ClearCurrentRepoSlugCache()

opts := AddOptions{Number: 1}
opts := AddOptions{}
_, err := AddWorkflows(tt.workflowSpecs, opts)

if tt.expectError {
Expand Down Expand Up @@ -152,7 +152,7 @@ func TestAddWorkflowsFromCurrentRepositoryMultiple(t *testing.T) {
// Clear cache before each test
ClearCurrentRepoSlugCache()

opts := AddOptions{Number: 1}
opts := AddOptions{}
_, err := AddWorkflows(tt.workflowSpecs, opts)

if tt.expectError {
Expand Down Expand Up @@ -194,7 +194,7 @@ func TestAddWorkflowsFromCurrentRepositoryNotInGitRepo(t *testing.T) {

// When not in a git repo, the check should be skipped (can't determine current repo)
// The function should proceed and fail for other reasons (e.g., workflow not found)
opts := AddOptions{Number: 1}
opts := AddOptions{}
_, err = AddWorkflows([]string{"some-owner/some-repo/workflow"}, opts)

// Should NOT get the "cannot add workflows from the current repository" error
Expand Down
Loading
Loading