Skip to content

Add after-scripts that receive prompt output as input #9

@Neokil

Description

@Neokil

Problem

Workflow states can only run a prompt and optionally transition to another state. There's no mechanism to pipe the LLM's output into a follow-up shell script. This rules out useful patterns like using a prompt to generate a commit message and automatically passing the result to git commit, or using a prompt to produce a changelog entry and appending it to a file.

Solution

  1. Add an optional after_script field to the workflow state config, accepting a shell command or script path.
  2. After the prompt completes successfully, execute the after-script with the prompt output available (e.g. via stdin or a $AUTOPR_OUTPUT env variable).
  3. The after-script's exit code determines whether the state is marked as succeeded or failed.
  4. Add an example to workflow.example.yaml showing the commit-message use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions