Skip to content

Commit b7b5b77

Browse files
author
Tom Brandenburg
committed
chore: release flowsh-cli 0.2.2
1 parent dc07439 commit b7b5b77

9 files changed

Lines changed: 99 additions & 46 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AGENTS.md
22

3-
This repository has been intentionally reduced to `scripts/workflow_to_harness.py`.
3+
This repository has been intentionally reduced to the Python CLI blueprint.
44

55
## Scope
66

@@ -14,3 +14,8 @@ This repository has been intentionally reduced to `scripts/workflow_to_harness.p
1414
- Use `make qa` after code changes.
1515
- Keep tests focused on the current blueprint behavior.
1616
- Prefer deletion over compatibility layers when reducing legacy project remnants.
17+
18+
## Publishing
19+
20+
- Published on PyPI as `flowsh-cli`. Run with `uvx flowsh-cli` (no install needed).
21+
- Bump: `make bump-patch` (or `bump-minor`/`bump-major`) — runs qa then publishes.

Makefile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
1-
.PHONY: help install publish lint test build qa clean hygiene
1+
.PHONY: help install publish lint test build qa clean hygiene bump-patch bump-minor bump-major
22

33
help:
44
@printf '%s\n' \
5-
'flowsh - minimal workflow-to-harness generator' \
5+
'flowsh-cli - minimal workflow-to-harness generator' \
66
'' \
77
'Commands:' \
8-
' make install Install flowsh into the user PATH with uv tool' \
9-
' make lint Run Ruff and compile-check Python files' \
10-
' make test Run tests' \
11-
' make build Build source and wheel distributions' \
12-
' make publish Build and publish to PyPI' \
13-
' make qa Run lint, tests, and package build' \
14-
' make clean Remove local test/build artifacts' \
15-
' make hygiene Show tracked, untracked, and ignored files'
8+
' make install Install flowsh-cli into the user PATH with uv tool' \
9+
' make lint Run Ruff and compile-check Python files' \
10+
' make test Run tests' \
11+
' make build Build source and wheel distributions' \
12+
' make publish Build and publish to PyPI' \
13+
' make qa Run lint, tests, and package build' \
14+
' make clean Remove local test/build artifacts' \
15+
' make hygiene Show tracked, untracked, and ignored files' \
16+
' make bump-patch|minor|major Bump version in pyproject.toml, build, publish'
1617

1718
install:
1819
uv tool install --force .
1920

2021
publish:
22+
rm -rf dist
2123
uv build && uv publish
2224

25+
bump-patch bump-minor bump-major:
26+
$(eval PART := $(@:bump-%=%))
27+
python3 scripts/bump_version.py $(PART)
28+
uv lock
29+
$(MAKE) qa
30+
$(MAKE) publish
31+
2332
lint:
2433
uv run --locked ruff check .
2534
uv run --locked ruff format --check .
26-
uv run --locked python -m py_compile src/flowsh_cli/*.py scripts/workflow_to_harness.py tests/test_workflow_to_harness.py
35+
uv run --locked python -m py_compile src/flowsh_cli/*.py scripts/*.py tests/test_workflow_to_harness.py
2736

2837
test:
2938
uv run --locked pytest
@@ -38,4 +47,4 @@ hygiene:
3847
git status --short --ignored
3948

4049
clean:
41-
rm -rf .pytest_cache .ruff_cache .harness .flowsh src/flowsh/__pycache__ scripts/__pycache__ tests/__pycache__ dist build
50+
rm -rf .pytest_cache .ruff_cache .harness .flowsh src/flowsh_cli/__pycache__ scripts/__pycache__ tests/__pycache__ dist build

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
# flowsh
1+
# flowsh-cli
22

3-
`flowsh` is a small `uv` Python CLI deliberately reduced to one tool:
4-
5-
```bash
6-
uv run flowsh .made/workflows.yml
7-
```
8-
9-
It reads MADE workflow YAML and writes executable Bash harness scripts for OpenCode.
3+
`flowsh-cli` is a small `uv` Python CLI that reads workflow YAML and writes executable Bash harness scripts for OpenCode.
104

115
## Supported YAML
126

@@ -42,29 +36,31 @@ Harness paths are derived from workflow ids. `wf_example` writes `.harness/examp
4236

4337
```bash
4438
# Generate every workflow harness
45-
uv run flowsh .made/workflows.yml
39+
uvx flowsh-cli .made/workflows.yml
4640
4741
# Generate one workflow by id
48-
uv run flowsh .made/workflows.yml --workflow wf_example
42+
uvx flowsh-cli .made/workflows.yml --workflow wf_example
4943
5044
# Show planned outputs without writing files
51-
uv run flowsh .made/workflows.yml --dry-run
45+
uvx flowsh-cli .made/workflows.yml --dry-run
5246
5347
# Overwrite existing harness files
54-
uv run flowsh .made/workflows.yml --force
48+
uvx flowsh-cli .made/workflows.yml --force
5549
5650
# Show version
57-
uv run flowsh --version
51+
uvx flowsh-cli --version
5852
```
5953

54+
You can also run it via `uv run flowsh-cli` if installed locally.
55+
6056
## CLI Contract
6157

62-
`flowsh` is non-interactive. It never prompts for missing information.
58+
`flowsh-cli` is non-interactive. It never prompts for missing information.
6359

6460
Current help output is plain text and deterministic across repeated runs:
6561

6662
```text
67-
Usage: flowsh [OPTIONS] WORKFLOW_YAML
63+
Usage: flowsh-cli [OPTIONS] WORKFLOW_YAML
6864
6965
Generate reproducible OpenCode Bash harness scripts from MADE workflow YAML.
7066
@@ -75,7 +71,7 @@ Options:
7571
--workflow TEXT Optional workflow id to generate. Defaults to all workflows.
7672
--dry-run Print planned output paths without writing scripts.
7773
--force Overwrite existing files. Without this, existing files cause a failure.
78-
--version Show the flowsh version and exit.
74+
--version Show the flowsh-cli version and exit.
7975
--help Show this message and exit.
8076
```
8177

@@ -87,7 +83,7 @@ Exit codes:
8783
| Case | Exit | stdout | stderr |
8884
|---|---:|---|---|
8985
| `--help` | `0` | Help text | Empty |
90-
| `--version` | `0` | `flowsh <version>` | Empty |
86+
| `--version` | `0` | `flowsh-cli <version>` | Empty |
9187
| Valid generation | `0` | One `Wrote <path>` line per harness | Empty |
9288
| Valid `--dry-run` | `0` | One `DRY-RUN would write <path>` line per selected workflow | Empty |
9389
| Missing required CLI argument | `2` | Empty | Typer usage error |
@@ -113,11 +109,11 @@ make hygiene
113109
make clean
114110
```
115111

116-
`make install` installs `flowsh` into the user PATH with `uv tool install --force .`.
112+
`make install` installs `flowsh-cli` into the user PATH with `uv tool install --force .`.
117113
`make build` creates reproducible source and wheel distributions under ignored `dist/`.
118114

119115
`make qa` runs Ruff, Python compile checks, and pytest with locked dependencies, then builds packages locally and in CI.
120-
The pytest suite also verifies `python -m flowsh`, `uv run flowsh`, and the direct
116+
The pytest suite also verifies `python -m flowsh_cli`, `uvx flowsh-cli`, and the direct
121117
`scripts/workflow_to_harness.py` entrypoint against the same help contract.
122118
`make hygiene` prints tracked, untracked, and ignored files with
123119
`git status --short --ignored`; review it before release to confirm only intended

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "uv_build"
44

55
[project]
66
name = "flowsh-cli"
7-
version = "0.1.0"
8-
description = "Generate Bash harness scripts from MADE workflow YAML files."
7+
version = "0.2.2"
8+
description = "Generate Bash harness scripts from workflow YAML files."
99
readme = "README.md"
1010
requires-python = ">=3.11"
1111
license = "MIT"
@@ -25,7 +25,7 @@ Homepage = "https://github.com/tbrandenburg/flowsh"
2525
Source = "https://github.com/tbrandenburg/flowsh"
2626

2727
[project.scripts]
28-
flowsh = "flowsh_cli.cli:main"
28+
flowsh-cli = "flowsh_cli.cli:main"
2929

3030
[dependency-groups]
3131
dev = [

scripts/bump_version.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
import re
3+
import sys
4+
from pathlib import Path
5+
6+
USAGE = "usage: bump_version.py patch|minor|major"
7+
PYPROJECT = Path("pyproject.toml")
8+
INIT = Path("src/flowsh_cli/__init__.py")
9+
10+
11+
def main() -> int:
12+
if len(sys.argv) != 2 or sys.argv[1] not in {"patch", "minor", "major"}:
13+
sys.exit(USAGE)
14+
15+
pyproject = PYPROJECT.read_text(encoding="utf-8")
16+
match = re.search(r'^version = "(.+?)"', pyproject, re.M)
17+
if match is None:
18+
sys.exit("version not found in pyproject.toml")
19+
20+
parts = [int(part) for part in match.group(1).split(".")]
21+
index = {"major": 0, "minor": 1, "patch": 2}[sys.argv[1]]
22+
parts[index] += 1
23+
for reset_index in range(index + 1, 3):
24+
parts[reset_index] = 0
25+
version = ".".join(str(part) for part in parts)
26+
27+
PYPROJECT.write_text(
28+
re.sub(r'^version = ".*?"', f'version = "{version}"', pyproject, count=1, flags=re.M),
29+
encoding="utf-8",
30+
)
31+
32+
init = INIT.read_text(encoding="utf-8")
33+
INIT.write_text(
34+
re.sub(r'^__version__ = ".*?"', f'__version__ = "{version}"', init, count=1, flags=re.M),
35+
encoding="utf-8",
36+
)
37+
38+
print(f"Bumped to {version}")
39+
return 0
40+
41+
42+
if __name__ == "__main__":
43+
raise SystemExit(main())

src/flowsh_cli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
"""flowsh: generate OpenCode Bash harness scripts from workflow YAML."""
1+
"""flowsh-cli: generate OpenCode Bash harness scripts from workflow YAML."""
22

33
from flowsh_cli.models import Workflow, WorkflowParseError, parse_workflows
44
from flowsh_cli.render import harness_path, render_harness
55

6-
__version__ = "0.1.0"
6+
__version__ = "0.2.2"
77

88
__all__ = [
99
"Workflow",

src/flowsh_cli/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
def main(argv: Sequence[str] | None = None) -> int:
2727
try:
28-
app(args=list(argv) if argv is not None else None, prog_name="flowsh")
28+
app(args=list(argv) if argv is not None else None, prog_name="flowsh-cli")
2929
except SystemExit as error:
3030
return error.code if isinstance(error.code, int) else 1
3131

@@ -58,7 +58,7 @@ def generate(
5858
typer.Option(
5959
"--version",
6060
callback=lambda value: print_version(value),
61-
help="Show the flowsh version and exit.",
61+
help="Show the flowsh-cli version and exit.",
6262
is_eager=True,
6363
),
6464
] = False,
@@ -95,7 +95,7 @@ def print_version(value: bool) -> None:
9595
if not value:
9696
return
9797

98-
print(f"flowsh {__version__}")
98+
print(f"flowsh-cli {__version__}")
9999
raise typer.Exit
100100

101101

tests/test_workflow_to_harness.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
runner = CliRunner()
1414

15-
EXPECTED_HELP = """Usage: flowsh [OPTIONS] WORKFLOW_YAML
15+
EXPECTED_HELP = """Usage: flowsh-cli [OPTIONS] WORKFLOW_YAML
1616
1717
Generate reproducible OpenCode Bash harness scripts from MADE workflow YAML.
1818
@@ -23,7 +23,7 @@
2323
--workflow TEXT Optional workflow id to generate. Defaults to all workflows.
2424
--dry-run Print planned output paths without writing scripts.
2525
--force Overwrite existing files. Without this, existing files cause a failure.
26-
--version Show the flowsh version and exit.
26+
--version Show the flowsh-cli version and exit.
2727
--help Show this message and exit.
2828
"""
2929

@@ -393,7 +393,7 @@ def test_cli_exposes_version_without_workflow_argument() -> None:
393393
result = runner.invoke(app, ["--version"])
394394

395395
assert result.exit_code == 0, result.output
396-
assert result.output.strip().startswith("flowsh ")
396+
assert result.output.strip().startswith("flowsh-cli ")
397397

398398

399399
def test_cli_reports_missing_required_workflow_argument() -> None:
@@ -848,15 +848,15 @@ def test_cli_help_is_deterministic_across_repeated_runs() -> None:
848848

849849
def test_uv_console_entrypoint_help_matches_contract() -> None:
850850
result = subprocess.run(
851-
["uv", "run", "flowsh", "--help"],
851+
["uv", "run", "flowsh-cli", "--help"],
852852
check=False,
853853
capture_output=True,
854854
text=True,
855855
env={**os.environ, "COLUMNS": "200"},
856856
)
857857

858858
assert result.returncode == 0, result.stderr
859-
assert "Usage: flowsh [OPTIONS] WORKFLOW_YAML" in result.stdout
859+
assert "Usage: flowsh-cli [OPTIONS] WORKFLOW_YAML" in result.stdout
860860
assert "Path to .made/workflows.yml" in result.stdout
861861
assert "--dry-run" in result.stdout
862862
assert "--force" in result.stdout

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)