Add PowerShell (Pwsh 7+) as a supported output language

Merged
SU
1mo ago
+572-16
  • Adds PowerShell as a first-class output language
  • Generates .psm1 module + Example.ps1 (no .psd1 manifest, matching Go's "only if needed" pattern)
  • Follows approved-verb / CmdletBinding / explicit Export-ModuleMember conventions
  • Full test coverage added, existing suite unaffected

Summary by cubic

Adds PowerShell (pwsh 7+) as a supported output language, generating an api_client.psm1 module and Example.ps1 runner. PowerShell clients run through the companion script, and script arguments now fail with guidance instead of being ignored.

  • Registers PowerShell across configuration, discovery, settings, prompts, docs, and generation, with approved verbs, typed parameters, explicit exports, native HTTP/JSON handling, and no .psd1 manifest.
  • Resolves and shell-quotes runner paths; rejects unrelated modules, missing examples, and unsupported script arguments; runtime tests cover success and failure.
  • CI verifies PowerShell 7+ and CLI startup on all supported OSes; an opt-in live_windows workflow runs real generation with preinstalled Chrome and the free opencode/big-pickle model for PowerShell and Python.
  • Adds an opt-in local browser-to-client acceptance harness that uses isolated configuration and verifies fresh API data after generation, retaining logs, the HAR, and generated client sources (decoded across Windows text encodings) in its report.

Greptile Summary

This change adds PowerShell as a selectable generated-client language, including .psm1 modules and an Example.ps1 companion runner.

PowerShell run arguments are passed to Example.ps1, but the generated-wrapper instructions do not require parameters or forwarding into the exported module function. Users invoking a generated client with arguments therefore cannot rely on those values reaching the API call.

T-Rex validation blocked

  • Missing tool: pwsh (PowerShell 7+) is not installed. The command-construction path was exercised and confirmed to append caller values after Example.ps1, but actual PowerShell parameter binding and forwarding could not be executed. The focused existing test selection was also unavailable because the Python environment lacked the click package.

Confidence Score: 4/5