Add prompt inspection command

This commit is contained in:
2026-08-29 14:29:14 +00:00
parent 157209f097
commit 36c7c5a358
9 changed files with 280 additions and 13 deletions

View File

@@ -23,6 +23,7 @@ go run ./cmd/scriptorium render \
generated artifact.
- `scriptorium render`: prepare a prompt and write prepared-run output.
- `scriptorium serve`: start the HTTP server.
- `scriptorium inspect prompt`: inspect one prompt definition without model execution.
All commands accept `--config <path>` and reject positional arguments. An
effective `prompt_dir` is required for every command. Supply it through the
@@ -137,6 +138,19 @@ Optional flags:
`serve` accepts no runtime model override flags. HTTP request fields, response
schemas, and error codes are defined in the [HTTP API reference](api.md).
## `scriptorium inspect prompt`
```text
scriptorium inspect prompt --prompt ID [--prompt-version VERSION]
[--config PATH] [--prompt-dir DIR] [--format text|json] [--out PATH]
```
`--prompt` is required. Inspection uses normal configuration discovery and a
`--prompt-dir` override, defaults to text regardless of `defaults.render_format`,
and writes to stdout unless `--out` is supplied. It loads and normalizes the
selected definition but does not resolve a profile, load a schema, render a
template, reserve backend capacity, or call a model.
## Input And Variable Syntax
`--input name=path` maps an input name to a local file; `--var name=value`

View File

@@ -34,6 +34,11 @@ and profile selection, optional file inputs, variables, and presence-aware
execution overrides. Omitted framework settings remain zero values so Promptkit
resolves its own defaults and definition-required inputs.
`inspect prompt` maps the selected ID and optional version to
`promptkit.Engine.InspectPrompt`, then formats Scriptorium-owned inspection
data. It constructs the same configuration-aware engine but does not perform
preparation or generation.
`serve` constructs Scriptorium's restricted HTTP artifact reader, injects it
with `promptkit.WithArtifactReader`, passes the engine through the HTTP
adapter's consumer-owned `Runner` interface, and starts the server.

View File

@@ -338,6 +338,8 @@ backend capacity across concurrent requests.
## Stage 6: Add Stable Prompt Inspection Output And CLI
**Completion: Complete.**
Introduce reusable application-owned inspection presentation, then expose
prompt inspection without model execution.