feat: add `specify workflow definition` for run-scoped definitions by markuswondrak · Pull Request #4912 · github/spec-kit · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion docs/reference/workflows.md
12 changes: 6 additions & 6 deletions src/specify_cli/_installed_list_json.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Private JSON output helpers for installed preset and extension lists.
"""Private strict-JSON output helpers for installed-resource commands.

This module intentionally serves only the two installed-list commands. Their
human-facing renderers retain the legacy manager records, while this adapter
defines the public machine-readable wire contract.
Installed preset and extension lists use the item helpers below. The shared
error renderer and Typer command class also keep `info` and workflow-definition
commands on the strict JSON contract.
"""
from __future__ import annotations

Expand All @@ -21,7 +21,7 @@


class InstalledListJSONCommand(TyperCommand):
"""Keep JSON list parse failures on the JSON error contract."""
"""Keep `--json` parse failures on the JSON error contract."""

def make_context(self, info_name, args, parent=None, **extra):
json_output = "--json" in args
Expand Down Expand Up @@ -78,7 +78,7 @@ def emit_json(value: Any) -> None:


def emit_json_error(error: Exception, exit_code: int = 1) -> NoReturn:
"""Write the list-command error contract and terminate unsuccessfully."""
"""Write the strict JSON error contract and terminate unsuccessfully."""
message = str(error).strip() or error.__class__.__name__
typer.echo(json.dumps({"error": message}, ensure_ascii=False), err=True)
raise typer.Exit(code=exit_code)
186 changes: 166 additions & 20 deletions src/specify_cli/workflows/_commands.py
Loading
Loading