diff --git a/cmd/gh-aw/main.go b/cmd/gh-aw/main.go index 0e3c4aa6e32..811ed7c1518 100644 --- a/cmd/gh-aw/main.go +++ b/cmd/gh-aw/main.go @@ -159,7 +159,7 @@ Examples: // Template mode with workflow name workflowName := args[0] - return cli.NewWorkflow(workflowName, verbose, forceFlag, engineOverride) + return cli.CreateWorkflowMarkdownFile(workflowName, verbose, forceFlag, engineOverride) }, } diff --git a/pkg/cli/README.md b/pkg/cli/README.md index e231916732f..4a4a87e692a 100644 --- a/pkg/cli/README.md +++ b/pkg/cli/README.md @@ -105,7 +105,7 @@ All diagnostic output MUST go to `stderr` using `console` formatting helpers. St | `RunFix` | `func(FixConfig) error` | Applies automatic codemods | | `GetAllCodemods` | `func() []Codemod` | Returns all available codemods | | `InitRepository` | `func(InitOptions) error` | Initializes a repo with the `gh-aw` setup | -| `NewWorkflow` | `func(string, bool, bool, string) error` | Creates a new workflow markdown file | +| `CreateWorkflowMarkdownFile` | `func(string, bool, bool, string) error` | Creates a new workflow markdown file | | `IsRunnable` | `func(string) (bool, error)` | Checks whether a workflow file is runnable | | `RunWorkflowInteractively` | `func(ctx, ...) error` | Interactive workflow selection and dispatch | | `AddMCPTool` | `func(string, string, ...) error` | Adds an MCP server to a workflow file | diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index 743368479fd..6f5c3c4c204 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -15,8 +15,8 @@ import ( var commandsLog = logger.New("cli:commands") -// NewWorkflow creates a new workflow markdown file with template content -func NewWorkflow(workflowName string, verbose bool, force bool, engine string) error { +// CreateWorkflowMarkdownFile creates a new workflow markdown file with template content +func CreateWorkflowMarkdownFile(workflowName string, verbose bool, force bool, engine string) error { commandsLog.Printf("Creating new workflow: name=%s, force=%v, engine=%s", workflowName, force, engine) // Normalize the workflow name by removing .md extension if present diff --git a/pkg/cli/commands_test.go b/pkg/cli/commands_test.go index 3e84f1c0656..aee4f586bb5 100644 --- a/pkg/cli/commands_test.go +++ b/pkg/cli/commands_test.go @@ -405,7 +405,7 @@ Test workflow for command existence.` } } -func TestNewWorkflow(t *testing.T) { +func TestCreateWorkflowMarkdownFile(t *testing.T) { // Create a temporary directory for testing tempDir, err := os.MkdirTemp("", "test-new-workflow-*") if err != nil { @@ -483,7 +483,7 @@ func TestNewWorkflow(t *testing.T) { } // Run the function - err := NewWorkflow(test.workflowName, false, test.force, "") + err := CreateWorkflowMarkdownFile(test.workflowName, false, test.force, "") // Check error expectation if test.expectedError && err == nil {