Skip to content

CLI Contract for YAML Search Batches ​

Invocation ​

text
camply [--debug | --no-debug] campsites --yaml-config PATH
    [--debug | --no-debug] [--search-once [--json]]

File mode accepts --yaml-config alone for the file path. The file uses the checked-in Draft 2020-12 docs/cli-yaml-config.schema.json, with runtime checks described in the data model. Every search specifies a provider. Explicit provider, target, date, filter, interval, notification, and state-file flags conflict with file mode, including the root provider flag. In the absence of --yaml-config, the existing flag-based invocation remains available.

The file requires a top-level integer version: 2. Unsupported versions fail as usage errors before search fields are validated.

Lifecycle and exit status ​

EventResult
File or invocation fails local validationUsage error, exit 2, diagnostic on stderr, and no stdout in JSON mode. No search starts and no state file is written.
Continuous modeEach search attempts a check immediately, then waits for its configured interval after each completed attempt. An upstream failure is attributed and retried in the next cycle.
All single-pass checks succeedExit 0 after all checks and notification attempts finish. Empty matches count as success.
Any single-pass check failsExit 1 after every search has attempted its check. Available results from successful searches are retained.
User interrupts the batchCancel active and waiting searches, release owned clients, and follow the current CLI abort behavior.
Notification delivery or state-file access failsEmit an attributed warning and continue. The availability outcome and exit status still depend on the provider check.

Output ​

Terminal results and search-specific diagnostics identify the search name and canonical provider. Diagnostics use known field paths and safe messages. Provider responses, credentials, and raw rejected values are excluded.

For --search-once --json, stdout contains exactly one array, ordered as the input file. Progress and diagnostics go to stderr. Example with an empty successful search and a failed search:

json
[
  {
    "name": "no-openings",
    "provider": "RecreationDotGov",
    "status": "ok",
    "stays": []
  },
  {
    "name": "coastal-trip",
    "provider": "ReserveCalifornia",
    "status": "error",
    "stays": []
  }
]

Each stay uses the existing keys provider_id, provider_name, recreation_area_id, recreation_area_name, campground_id, campground_name, campsite_id, campsite_name, arrival, checkout, nights, and booking_url. Arrival and checkout use ISO dates. Optional values retain the current serializers' representations.