2026-05-29 16:52:02 +00:00
# Weatherreporter CLI
2026-08-02 06:10:15 +00:00
`weatherreporter` generates Markdown weather reports, runs report batches, and
compares explicitly selected Promptkit profiles against one prepared report. It
has no command for inspecting prior runs or application-owned state.
2026-05-29 16:52:02 +00:00
## Shortest Useful Command
```sh
2026-08-01 20:11:57 +00:00
weatherreporter generate today
2026-05-29 16:52:02 +00:00
```
2026-08-02 01:41:03 +00:00
The command uses the configured Weather API and atomically writes `today.md` .
With no configured output directory, it writes in the current directory. See
the [configuration reference ](config.md ) to supply the required Weather API
endpoint and choose an ordinary output directory.
2026-05-29 16:58:18 +00:00
2026-07-31 00:57:46 +00:00
## Commands And Usage
2026-05-29 16:52:02 +00:00
```text
2026-05-29 19:47:01 +00:00
weatherreporter --help
2026-07-31 19:13:45 +00:00
weatherreporter --version
2026-07-31 04:48:16 +00:00
weatherreporter generate daily --date YYYY-MM-DD [--config PATH] [--units VALUE] [--tz NAME] [--out PATH] [--llm-debug-dir PATH] [--quiet]
weatherreporter generate today [--config PATH] [--units VALUE] [--tz NAME] [--out PATH] [--date YYYY-MM-DD] [--llm-debug-dir PATH] [--quiet]
weatherreporter generate tomorrow [--config PATH] [--units VALUE] [--tz NAME] [--out PATH] [--llm-debug-dir PATH] [--quiet]
weatherreporter generate hourly [--config PATH] [--units VALUE] [--tz NAME] [--out PATH] [--llm-debug-dir PATH] [--quiet]
2026-07-31 05:03:02 +00:00
weatherreporter run morning [--config PATH] [--units VALUE] [--tz NAME] [--out-dir PATH] [--llm-debug-dir PATH] [--quiet]
weatherreporter run evening [--config PATH] [--units VALUE] [--tz NAME] [--out-dir PATH] [--llm-debug-dir PATH] [--quiet]
2026-08-02 06:10:15 +00:00
weatherreporter compare REPORT --profile PROFILE --profile PROFILE [--config PATH] [--units VALUE] [--tz NAME] [--date YYYY-MM-DD] [--out-dir PATH] [--replace] [--llm-debug-dir PATH] [--quiet]
2026-05-29 16:52:02 +00:00
```
2026-07-31 19:13:45 +00:00
`weatherreporter --version` prints the version embedded in the executable.
Tagged release binaries report their semantic version tag; ordinary local
builds report `development` .
2026-07-31 00:57:46 +00:00
| Command | Contract |
| --- | --- |
2026-08-01 20:11:57 +00:00
| `generate daily` | Requires `--date YYYY-MM-DD` ; the date is interpreted in the effective report timezone. Its default filename is `daily-YYYY-MM-DD.md` . |
| `generate today` | Accepts an optional `--date YYYY-MM-DD` ; without it, the current local date in the effective report timezone is used. Its default filename is `today.md` . |
| `generate tomorrow` | Uses the next local civil day and writes `tomorrow.md` by default. |
| `generate hourly` | Covers the next six hours in the effective report timezone and writes `hourly.md` by default. It does not accept `--date` , `--hours` , or `--duration` . |
2026-08-02 01:41:03 +00:00
| `run morning` and `run evening` | Run their defined report batches beneath the configured output directory, or the current directory when none is configured. `--out-dir` selects another directory. `--out` is not accepted. |
2026-08-02 06:10:15 +00:00
| `compare REPORT` | Accepts `daily` , `today` , `tomorrow` , or `hourly` . It requires at least two distinct, nonblank `--profile` values in their supplied order. Daily requires `--date` ; Today accepts it optionally; Tomorrow and Hourly do not accept it. |
2026-07-31 00:57:46 +00:00
2026-07-31 03:53:47 +00:00
`generate` accepts the four report command names shown above. `run` accepts
2026-08-02 06:10:15 +00:00
only `morning` and `evening` . `compare` always requires explicit profile
selection: `promptkit.profile` is not used as a comparison default. Batch
membership and notification ordering are described in the
[operations guide ](operations.md ).
2026-07-31 00:57:46 +00:00
## Output, Errors, And Quiet Mode
2026-08-02 01:41:03 +00:00
For `generate` , the report's default filename is placed beneath
`output.directory` when configured, otherwise the current directory. `--out
PATH` selects one complete output file instead. A relative path is resolved
from the current directory; an absolute path is used as given. For a batch,
the configured directory has the same role and `--out-dir PATH` selects its
2026-08-02 06:10:15 +00:00
output directory instead. For `compare` , `--out-dir PATH` selects one exact
bundle directory; otherwise the report-derived comparison directory is placed
beneath the configured directory or current directory. `--replace` is required
to replace an existing nonempty recognized comparison bundle. See the
[configuration reference ](config.md ) for the field's validation and path rules
and the [comparison bundle contract ](integrations/comparison-bundle.md ) for the
bundle format.
2026-08-01 20:11:57 +00:00
Outputs are written atomically. A generation, rendering, write, or cancellation
failure before publication leaves an existing destination unchanged. A
notification failure occurs after publication, so the newly written output
remains available.
2026-08-13 00:24:16 +00:00
`SIGINT` and `SIGTERM` cancel an active action. Weatherreporter lets that
cancellation reach the action before exiting; when the action has a result, it
2026-08-13 03:02:59 +00:00
emits the usual failed summary and exits nonzero. A canceled batch retains any
reports that were already published, marks interrupted and unstarted reports
as `canceled` , skips batch notification, and identifies cancellation separately
from report failures.
2026-08-13 00:24:16 +00:00
2026-08-02 06:10:15 +00:00
Action commands (`generate` , `run` , and `compare` ) write a JSON summary to
stdout unless `--quiet` is set. `run` also writes compact per-report and batch
status lines to stderr. A pre-run error, such as an invalid flag, missing
required argument, or configuration-load failure, produces no partial JSON
summary. When an action fails after it has produced a result, its summary has
`"status": "failed"` and an `error` field.
2026-07-31 00:57:46 +00:00
`--quiet` is supported by action commands only. It suppresses action summaries
and routine batch status output; it does not suppress command errors.
### Generate Summary
2026-08-01 20:11:57 +00:00
A generate summary identifies the command, report, run, generation time, valid
period, prompt version, timezone, and status. Successful output has an absolute
`outputPath` :
2026-06-20 23:01:14 +00:00
```json
{
"command": "generate",
"reportId": "today",
"promptId": "weather.today_generated_text",
2026-08-25 19:49:57 +00:00
"promptVersion": "2.1.0",
2026-06-20 23:01:14 +00:00
"runId": "20260529T120000.000000000Z_today",
"status": "succeeded",
2026-08-01 20:11:57 +00:00
"timezone": "America/Chicago",
"outputPath": "/srv/weather/today.md"
2026-06-20 23:01:14 +00:00
}
```
2026-08-01 20:11:57 +00:00
When available, the summary also includes the effective `profileId` ,
`backendId` , `modelName` , `sourceWarnings` , `validationStatus` , requested
2026-08-25 23:46:21 +00:00
`repairAttempts` , `llmDebugPath` , and compact Distributor `notification`
result. `repairAttempts` is `0` when the initial output passed validation,
positive when PromptKit made corrective generation calls, and omitted when
validation did not complete. The summary does not
2026-08-01 20:11:57 +00:00
include historical or transient artifact paths such as metadata, prompt input,
raw generated text, render context, or notification receipts.
2026-06-20 23:01:14 +00:00
2026-07-31 00:57:46 +00:00
### Run Summary And Stderr
2026-06-20 23:01:14 +00:00
2026-07-31 00:57:46 +00:00
A run summary contains `command` , `batch` , `status` , `startedAt` , `finishedAt` ,
2026-08-01 20:11:57 +00:00
`total` , `succeeded` , `failed` , and a `reports` array. Each report item includes
its identity, status, effective profile and model details when available,
2026-08-25 23:46:21 +00:00
source warnings, validation status, repair-attempt count when validation
completed, and absolute `outputPath` after publication.
2026-08-01 20:11:57 +00:00
The top-level summary may also contain a batch `notification` object and
`error` . Batch status is `failed` if any report or the batch notification fails.
2026-08-01 22:01:28 +00:00
The `total` , `succeeded` , and `failed` counters describe report items only, so
a failed batch notification can leave `failed` at `0` while the top-level
notification and action status are `failed` .
2026-06-20 23:01:14 +00:00
2026-08-13 03:02:59 +00:00
When cancellation stops a batch, the summary also includes a nonzero
`canceled` count. Canceled reports have `"status": "canceled"` ; they are not
included in `failed` , and the action still has failed status and exits nonzero.
2026-07-31 00:57:46 +00:00
Without `--quiet` , batch status lines use this form:
2026-06-20 23:01:14 +00:00
```text
2026-08-01 20:11:57 +00:00
report=today status=succeeded output="/srv/weather/reports/today.md"
2026-08-13 03:02:59 +00:00
batch=morning total=2 succeeded=2 failed=0 canceled=0
2026-06-20 23:01:14 +00:00
```
2026-05-29 18:33:24 +00:00
2026-08-02 06:10:15 +00:00
### Compare Summary
A comparison summary contains these fields in this order: `command` ,
`comparisonId` , `reportId` , `reportName` , `promptId` , `promptVersion` ,
`promptHash` , `status` , `startedAt` , `finishedAt` , `timezone` , `validPeriod` ,
`outputDirectory` , `manifestPath` , `dataPackagePath` , `total` , `succeeded` ,
`failed` , `results` , and optional `error` . Published artifact paths and each
successful `results[].reportPath` are absolute. `results` preserves the
supplied profile order and each item contains `position` , `profileId` , optional
`backendId` , `modelName` , `status` , optional `validationStatus` , optional
2026-08-25 23:46:21 +00:00
`repairAttempts` , optional `reportPath` , optional `llmDebugPath` , and optional
safe `error` . The repair-attempt semantics match the generate summary.
2026-08-02 06:10:15 +00:00
The comparison status is `succeeded` only when every selected profile succeeds
and the bundle is published. Individual profile failures still publish a
complete partial bundle and return a failed command result. Cancellation or a
failure before publication omits the artifact paths and returns a safe
2026-08-02 13:35:31 +00:00
top-level error; the resolved `outputDirectory` and finalized timestamp remain
when available. The safe error includes only a category and message: aggregate
and unclassified application failures use `application` ; cancellation uses
`canceled` ; deadlines use `deadline_exceeded` ; prompt execution uses its
published Promptkit category; destination failures use `destination_<kind>` ;
2026-08-13 03:18:55 +00:00
and committed cleanup failures use `publication_cleanup` with a message that
states whether a complete prior bundle, partial remnants, or no prior bundle
remains, or that recovery state could not be inspected. It does not expose
2026-08-25 23:46:21 +00:00
provider diagnostics, filesystem causes, or recovery paths. A provider HTTP
failure may include its numeric status in the safe message. See the
2026-08-02 06:10:15 +00:00
[comparison bundle contract ](integrations/comparison-bundle.md ) for durable
artifact fields and failure invariants.
2026-08-02 13:23:18 +00:00
If the bundle is published but cleanup of its replaced prior bundle fails, the
summary still includes the published artifact paths and has status `failed` .
2026-08-13 03:18:55 +00:00
Its JSON error is `publication_cleanup` ; the returned command error identifies
a recovery path only when cleanup left a sibling behind. Only a reported
complete prior bundle is a rollback artifact.
2026-08-02 13:23:18 +00:00
2026-07-31 00:57:46 +00:00
## Flag Reference
2026-05-29 16:58:18 +00:00
2026-07-31 00:57:46 +00:00
| Flag | Accepted by | Meaning |
| --- | --- | --- |
2026-08-02 13:35:31 +00:00
| `-h` , `--help` | top level, `compare` | Show help without loading configuration or contacting a provider. |
2026-07-31 00:57:46 +00:00
| `--config PATH` | all commands | Load `PATH` instead of `/usr/local/etc/weatherreporter/config.yml` . |
2026-08-02 06:10:15 +00:00
| `--units VALUE` | `generate` , `run` , `compare` | Override `weather_api.units` for this command. |
| `--tz NAME` | `generate` , `run` , `compare` | Override `weather_api.timezone` for this command. |
2026-08-02 01:41:03 +00:00
| `--out PATH` | every `generate` command | Write the report to this complete file destination instead of the configured or current-directory default. |
2026-08-13 13:52:16 +00:00
| `--llm-debug-dir PATH` | every `generate` , `run` , and `compare` command | On Unix hosts, write requested sensitive prompt diagnostics under this absolute path. Other hosts fail closed when the flag is requested. |
2026-08-02 06:10:15 +00:00
| `--profile PROFILE` | `compare` | Select one explicit profile. Repeat at least twice with distinct, nonblank IDs. |
| `--out-dir PATH` | `run morning` , `run evening` , `compare` | Write batch reports beneath this directory, or select the exact comparison directory. |
| `--replace` | `compare` | Authorize replacement of a recognized nonempty comparison bundle. |
2026-08-13 00:28:31 +00:00
| `--quiet` | `generate` , `run` , `compare` | Suppress all action summaries and routine batch status output. |
2026-08-02 06:10:15 +00:00
| `--date YYYY-MM-DD` | `generate daily` , `generate today` , `compare daily` , `compare today` | Required for Daily; optional for Today. |
2026-05-29 18:33:24 +00:00
2026-07-31 00:57:46 +00:00
Distributor notification is configured through `notify.distributor` ; there are
no Distributor-specific CLI flags. See the [configuration reference ](config.md ).
2026-06-07 23:50:55 +00:00
2026-07-31 00:57:46 +00:00
## Invocation Examples
2026-05-29 19:47:01 +00:00
```sh
2026-08-01 20:11:57 +00:00
weatherreporter generate daily --date 2026-05-29
weatherreporter generate today --out ./reports/today.md
weatherreporter generate hourly --out /srv/weather/hourly.md
2026-07-31 04:48:16 +00:00
weatherreporter generate today --llm-debug-dir /var/tmp/weatherreporter-debug
2026-07-31 05:03:02 +00:00
weatherreporter run morning --out-dir ./reports --llm-debug-dir /var/tmp/weatherreporter-debug
2026-08-02 06:10:15 +00:00
weatherreporter compare daily --date 2026-05-29 --profile weather-light --profile weather-balanced --out-dir ./comparison-daily-2026-05-29
2026-05-29 19:47:01 +00:00
```