hydra-cli
Command-line interface for Hydra, the water infrastructure simulation platform. It drives Hydra's water distribution engine: reads EPANET .inp network descriptions from files or HTTP URLs, runs extended-period hydraulic and water quality simulation, and writes results to .rpt and .out files. Hydra's other engines — urban drainage and open channel — are planned and not yet available from the CLI.
Breaking changes in 3.0
The argument surface was redesigned so it can carry more than one engine.
- Subcommands.
hydra run <model>,hydra report,hydra engines. A barehydra <model>prints a hint naming the replacement. - The EPANET positional triple is gone.
hydra net.inp net.rpt net.outbecomeshydra run net.inp --summary net.rpt --results net.out. The old order encoded one engine and one pair of artifacts; every added engine made it less true. - One name per concept. The model is
<MODEL>, the binary time series is--results, the native run log is--summary. Previously--outputmeant the binary results whilehydra report's--outmeant the report document — one letter apart, opposite meanings. --engine, defaulting to detection from the model's contents. There is no default engine; an unidentifiable model is an error, never a guess.-vis verbosity (repeatable), reclaimed at this major boundary.-Vremains--version.- Internal errors exit
4, no longer reusing2(solver).0–3unchanged.
Install
For most users, Cargo install is the recommended path.
Option 1 — Pre-built binary (no Rust required)
Download the hydra binary for your platform from the releases page.
macOS — Pre-built CLI binaries are currently not notarised. If Gatekeeper blocks the binary, remove the quarantine flag:
Option 2 — Cargo (recommended)
Usage
# Run a simulation — summary goes to stdout
# Write the summary and the binary time-series results
# JSON summary (chosen by the .json suffix)
# Accept an HTTP URL as the model (redirects followed, up to 10; plain
# http:// accepted; bodies up to 1 GiB; 10 s connect / 300 s overall timeout)
# Name the engine instead of detecting it from the model
# What engines does this build provide?
# Build a report document from a finished run
# Suppress progress output / add detail
# Print version
Engine selection
The engine is decided by the model's contents, never its extension —
.inp belongs to both EPANET and SWMM. Exactly one engine must identify the
model for it to run. If none does, or the file is only shaped like some
engine's format without identifying it, Hydra stops and asks for --engine
rather than guessing: routing a stormwater model to a pressurised-pipe solver
would return a confident wrong answer instead of an error.
Exit codes
| Code | Meaning |
|---|---|
0 |
Simulation completed (warnings may appear in the report) |
1 |
Usage/input error (bad arguments, bad INP, HTTP 4xx, missing input file) |
2 |
Solver error (non-convergence or singularity) |
3 |
I/O error (permission denied, HTTP 5xx, network failure) |
4 |
Internal error (unexpected engine state; please report a bug) |
License
AGPL v3 — see COMMERCIAL_LICENSE.md for commercial licensing options.