Skip to main content

Generate Bash harness scripts from workflow YAML files.

Project description

flowsh-cli

flowsh-cli turns workflow YAML into executable Bash harnesses for OpenCode.

Use it when you want a small, reproducible way to encode a workflow once and rerun it locally or in CI.

Quick Start

uvx flowsh-cli path/to/workflows.yml

That reads the workflow YAML at the path you provide and writes harness scripts to the current working directory.

In this repository, the example workflow file lives at .made/workflows.yml.

Useful flags:

uvx flowsh-cli path/to/workflows.yml --dry-run
uvx flowsh-cli path/to/workflows.yml --workflow wf_example
uvx flowsh-cli path/to/workflows.yml --force
uvx flowsh-cli path/to/workflows.yml --schema
uvx flowsh-cli --examples
uvx flowsh-cli --example simple

You can also run it locally with uv run flowsh-cli.

Workflow Shape

The input file is a single mapping with a workflows list:

workflows:
  - id: wf_example
    name: Example
    params:
      - name: ISSUE_NUMBER
        description: Issue to inspect
        required: true
    steps:
      - type: vars
        values:
          TODAY: date -u +%F
      - type: bash
        run: printf 'today=%s\n' "$TODAY"
      - type: agent
        agent: general
        model: openai/gpt-5
        command: review
        expandPrompt: true
        prompt: |
          Review issue ${ISSUE_NUMBER} and summarize the repository state.
      - type: parallel
        steps:
          - type: bash
            run: echo "worker A"
          - type: bash
            run: echo "worker B"
      - type: for
        in: ITEMS
        item: ITEM
        steps:
          - type: bash
            run: echo "$ITEM"

Harness paths are derived from workflow ids. wf_example becomes example.sh in the current working directory.

Step Types

Type Purpose Notes
vars Capture command output into exported shell variables Variable names must be uppercase shell identifiers.
bash Run shell commands Runs with bash -euo pipefail.
agent Call OpenCode Supports agent, model, command, expandPrompt, and dangerouslySkipPermissions.
for Iterate over newline-delimited input Flat iteration only; nested for steps are not supported.
parallel Run child steps concurrently Children run as separate branches and the parent waits for all of them.

Agent Behavior

agent prompts are literal by default. Use expandPrompt: true only when you want $VAR or ${VAR} tokens from earlier vars steps substituted at runtime.

expandPrompt: true does plain text replacement only. It does not evaluate shell expressions like $(...), backticks, or globs.

Set dangerouslySkipPermissions: true only when you want the generated harness to pass --dangerously-skip-permissions to OpenCode. The YAML alias dangerously-skip-permissions is also accepted.

Validation And Safety

The parser is strict:

  • workflow YAML must be UTF-8, non-empty, and under 1 MiB
  • the root must be a mapping with a workflows key
  • duplicate mapping keys and YAML aliases are rejected
  • workflow ids must match wf_[A-Za-z0-9_-]+
  • workflow and step names must be non-empty single-line labels
  • unsafe control characters are rejected in executable fields
  • agent names may contain only letters, digits, _, and -

Generated harnesses are non-interactive, owner-executable, and refuse to overwrite existing outputs unless --force is set.

Logs go to .flowsh/logs by default. Set FLOWSH_LOG_DIR to use another relative log directory.

Development

uv sync
make install
make qa
make clean

make qa runs linting, tests, and a local build.

Release

make bump-patch

That bumps the patch version, runs QA, and publishes the package.

Limits

This repository intentionally stays focused on the Python CLI blueprint. It does not include the old TypeScript implementation, workflow templates, DSL explorer, plugin registry, or extra workflow node types.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowsh_cli-0.8.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flowsh_cli-0.8.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file flowsh_cli-0.8.0.tar.gz.

File metadata

  • Download URL: flowsh_cli-0.8.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flowsh_cli-0.8.0.tar.gz
Algorithm Hash digest
SHA256 a1161c622294a6e8daad0b1714e72c80a3ad34ac4fd7cff85e97a797fa693e52
MD5 0b0e4958946141df32045a09509593c6
BLAKE2b-256 6d4198318e809239b5ee46d4ea4fe403ea8570f2db62f2d661cdc9590296992b

See more details on using hashes here.

File details

Details for the file flowsh_cli-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: flowsh_cli-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flowsh_cli-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bd153aafe85447954e34f230fa1bfa440625ef5c819ea2e224c8d441b42765b
MD5 bd625ce0dc2939f816a9897a58bc0fcf
BLAKE2b-256 d5186e007a215cdcaf474730fb401286582a867ea523be0c999e02b95ea642f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page