Skip to content

feat: add wfctl pipeline run/list commands#161

Merged
intel352 merged 1 commit intomainfrom
feat/wfctl-pipeline-run
Feb 25, 2026
Merged

feat: add wfctl pipeline run/list commands#161
intel352 merged 1 commit intomainfrom
feat/wfctl-pipeline-run

Conversation

@intel352
Copy link
Contributor

Summary

  • Adds wfctl pipeline list -c <config.yaml> to enumerate all pipelines defined in a workflow config, showing step counts
  • Adds wfctl pipeline run -c <config.yaml> -p <name> to execute a named pipeline locally without starting the HTTP server or any triggers
  • Adds GetPipeline(name string) (*module.Pipeline, bool) to StdEngine so CLI tools can access compiled pipelines from the engine's registry

How it works

wfctl pipeline run builds a minimal engine (only the pipeline-steps plugin — no HTTP modules, no schedulers, no databases) from the YAML config, calls BuildFromConfig (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:

Pipeline: greet
Steps: 2

Step 1/2: say-hello ... OK (1ms)
Step 2/2: set-result ... OK (0s)

Pipeline completed successfully in 2ms

Flags:

  • -c <path> — config YAML (required)
  • -p <name> — pipeline name (required for run)
  • --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 values

Test plan

  • TestRunPipelineMissingSubcommand — missing subcommand returns error
  • TestRunPipelineUnknownSubcommand — unknown subcommand returns error
  • TestRunPipelineListMissingConfig-c required
  • TestRunPipelineListNoPipelines — graceful empty output
  • TestRunPipelineListWithPipelines — shows names and step counts
  • TestRunPipelineRunMissingConfig-c required
  • TestRunPipelineRunMissingPipelineName-p required
  • TestRunPipelineRunUnknownPipeline — clear error with pipeline name
  • TestRunPipelineRunUnknownPipelineShowsAvailable — lists available pipelines in error
  • TestRunPipelineRunNoPipelinesInConfig — clear error
  • TestRunPipelineRunSuccess — single-step pipeline runs successfully
  • TestRunPipelineRunWithVars--var injects into trigger data
  • TestRunPipelineRunWithInputJSON--input JSON merged into trigger data
  • TestRunPipelineRunWithInvalidInputJSON — clear JSON parse error
  • TestRunPipelineRunWithInvalidVar — clear key=value format error
  • TestRunPipelineRunVerbose — verbose mode runs without error
  • TestRunPipelineRunMultiStep — multi-step pipeline runs all steps
  • TestRunPipelineRunEchoPipeline — template expressions work with --var
  • All existing ./cmd/wfctl/ tests still pass

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings February 25, 2026 04:02
@intel352 intel352 merged commit d122fad into main Feb 25, 2026
15 checks passed
@intel352 intel352 deleted the feat/wfctl-pipeline-run branch February 25, 2026 04:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 list command to enumerate all pipelines in a configuration file
  • Added wfctl pipeline run command 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

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