feat: add wfctl pipeline run/list commands#161
Merged
Conversation
Implements `wfctl pipeline list -c <config.yaml>` to enumerate pipelines and `wfctl pipeline run -c <config.yaml> -p <name>` to execute a pipeline locally without starting the HTTP server. - Adds `GetPipeline(name)` method to StdEngine to expose the compiled pipeline registry for CLI access - Builds a minimal engine (pipeline-steps plugin only, no HTTP triggers) from the config, then looks up the named pipeline and executes it - Supports `--var key=value` for injecting variables into trigger data - Supports `--input <json>` for passing structured input - Supports `--verbose` for detailed step output - Prints step-by-step progress (Step N/M: name ... OK (elapsed)) - Registers the `pipeline` top-level command in wfctl main dispatch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds CLI commands for listing and executing pipelines locally without starting the workflow engine's HTTP server or triggers. It introduces a new GetPipeline method to the engine API that allows external tools to access compiled pipelines from the engine's registry.
Changes:
- Added
StdEngine.GetPipeline(name)to expose the internal pipeline registry to CLI tools - Added
wfctl pipeline listcommand to enumerate all pipelines in a configuration file - Added
wfctl pipeline runcommand to execute pipelines locally with support for variable injection, JSON input, and verbose output
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| engine.go | Adds GetPipeline method to expose pipeline registry for CLI access |
| cmd/wfctl/pipeline.go | Implements pipeline list and run commands with progress reporting |
| cmd/wfctl/pipeline_test.go | Comprehensive test suite covering all command variants and edge cases |
| cmd/wfctl/main.go | Registers pipeline command in the CLI dispatcher and updates help text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wfctl pipeline list -c <config.yaml>to enumerate all pipelines defined in a workflow config, showing step countswfctl pipeline run -c <config.yaml> -p <name>to execute a named pipeline locally without starting the HTTP server or any triggersGetPipeline(name string) (*module.Pipeline, bool)toStdEngineso CLI tools can access compiled pipelines from the engine's registryHow it works
wfctl pipeline runbuilds a minimal engine (only thepipeline-stepsplugin — no HTTP modules, no schedulers, no databases) from the YAML config, callsBuildFromConfig(which compiles all pipeline steps and populates the registry), then looks up the named pipeline by name and executes it directly. The HTTP server is never started.Step progress is printed inline:
Flags:
-c <path>— config YAML (required)-p <name>— pipeline name (required forrun)--var key=value— inject variables into trigger data (repeatable)--input <json>— structured JSON input merged into trigger data--verbose— print engine debug logs and step output valuesTest plan
TestRunPipelineMissingSubcommand— missing subcommand returns errorTestRunPipelineUnknownSubcommand— unknown subcommand returns errorTestRunPipelineListMissingConfig—-crequiredTestRunPipelineListNoPipelines— graceful empty outputTestRunPipelineListWithPipelines— shows names and step countsTestRunPipelineRunMissingConfig—-crequiredTestRunPipelineRunMissingPipelineName—-prequiredTestRunPipelineRunUnknownPipeline— clear error with pipeline nameTestRunPipelineRunUnknownPipelineShowsAvailable— lists available pipelines in errorTestRunPipelineRunNoPipelinesInConfig— clear errorTestRunPipelineRunSuccess— single-step pipeline runs successfullyTestRunPipelineRunWithVars—--varinjects into trigger dataTestRunPipelineRunWithInputJSON—--inputJSON merged into trigger dataTestRunPipelineRunWithInvalidInputJSON— clear JSON parse errorTestRunPipelineRunWithInvalidVar— clear key=value format errorTestRunPipelineRunVerbose— verbose mode runs without errorTestRunPipelineRunMultiStep— multi-step pipeline runs all stepsTestRunPipelineRunEchoPipeline— template expressions work with --var./cmd/wfctl/tests still pass🤖 Generated with Claude Code