Moving rstgen here since it is quite specific to the CLI.