Skip to content

Add llm and prologue command groups - #43

Merged
einari merged 11 commits into
mainfrom
feature/llm-and-prologue
Jul 23, 2026
Merged

Add llm and prologue command groups#43
einari merged 11 commits into
mainfrom
feature/llm-and-prologue

Conversation

@einari

@einari einari commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Added

  • cratis llm group — configure the language model used by Cratis tools: use <anthropic|openai|local> (interactive prompts, secret API-key input), show (masked key), and clear
  • cratis prologue start — interactive wizard producing a cratis-prologue.json capture definition (SQL Server/PostgreSQL sources, API reverse-proxy capture, OpenTelemetry, JSON or Receiver API output)
  • cratis prologue interpret [PATH] — interprets captured data into a Screenplay .play file, streaming interpreter status and asking the interpreter's questions one at a time with multiple choice plus a free-text "Other" option; output path optional, defaulting to the derived system name

🤖 Generated with Claude Code

einari and others added 11 commits July 23, 2026 10:58
Introduce LlmConfiguration (kind, endpoint, apiKey, model) and an
optional Llm property on CliConfiguration so Cratis tools like
Prologue can resolve a shared language model configuration from
~/.cratis/config.json. The section is omitted from the file when
not configured.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add 'cratis llm use <KIND>' (anthropic | openai | local) with
--api-key/--endpoint/--model options and interactive prompts for
missing values (secret prompt for the API key, endpoint required
for local, per-kind default model hints), 'cratis llm show' with
a masked API key, and 'cratis llm clear' honoring the --yes
confirmation convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the llm section persisting and clearing through
CliConfiguration, API key masking (partial for long keys, full for
short ones), and provider kind validation including casing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cratis.Prologue.{Configuration,Contracts,Interpretation,Interpreter.Contracts,Screenplay}
1.1.0 and Cratis.Screenplay 1.3.0, plus Microsoft.Extensions.Logging.Abstractions
for hosting the interpreter session in the CLI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
An interactive wizard that walks through the capture sources (SQL Server,
PostgreSQL, API through a reverse proxy, OpenTelemetry) and output (rolling
JSON capture files or the Prologue Receiver API), assembles a
PrologueConfiguration through a testable builder, and writes it as
cratis-prologue.json. Non-interactive terminals fail with a clear
validation error since the wizard needs prompts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reads capture (.jsonl) files, resolves the language model from the
cratis-prologue.json Llm section or the CLI's own llm configuration
(heuristics only when neither is set), and drives the interpreter
session with console callbacks — status transitions as progress lines
and the model's questions one at a time with a selection prompt that
always offers a free-text "Other" answer. On completion the extracted
model is generated into a Screenplay and written to --file or
<SystemName>.play, reporting the module/feature/slice counts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers the wizard-to-configuration assembly (sources, output, reverse
proxy), llm options resolution across the Prologue and CLI
configurations, capture folder resolution, and the configuration and
Screenplay output path derivations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Picks up command descriptions on the extraction contract and the
multi-line description support in the Screenplay language.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@einari einari added the minor New features, non-breaking additions label Jul 23, 2026
@einari
einari merged commit bda0731 into main Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features, non-breaking additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant