Anvil CLI Guide
The anvil command-line interface (CLI) runs Anvil workflows for model building from a recipe file. It provides options for specifying input files, debug mode, output directories, and optional tagging of models.
Usage
openadmetanvil --recipe-path PATH [--output-dir DIR] [--tag TAG] [--debug]
Options
- --recipe-path PATH
Required. Path to the recipe YAML file that defines the workflow. Must be an existing file.
Example:
openadmet anvil --recipe-path ./recipes/my_model.yaml
- --output-dir DIR
Directory where output artifacts (such as logs, trained models, or reports) will be saved. Defaults to
anvil_trainingif not provided. The directory must be writable. If the directory already exists, a hash will be appended to avoid overwriting.Example:
openadmet anvil --recipe-path ./recipes/my_model.yaml --output-dir ./results
Description
The openadmet anvil CLI reads a recipe YAML file, initializes a workflow using AnvilSpecification, and executes it. A workflow run typically includes data preparation, model training, and report generation.
The command proceeds in the following steps:
Load the recipe specification from
--recipe-path.Convert the recipe into a workflow instance.
Run the workflow with the specified
--tag,--debug, and--output-diroptions.Print status messages before and after execution.
Example Workflow Run
openadmet anvil \
--recipe-path ./recipes/lgbm.yaml \
--output-dir ./output \
--debug
Expected output:
Workflow initialized successfully with recipe: ./recipes/lgbm.yaml
... # lots of logging output
Workflow completed successfully
Exit Codes
0: Workflow completed successfully.Non-zero: Workflow encountered an error (details will be shown in debug mode or logs).
Notes
Ensure that the recipe YAML file is valid and contains all required fields.
The
--output-dirwill be created if it does not exist.If the output directory already exists, a hash will be appended to avoid overwriting.
Debug mode can produce extensive logging; use it when diagnosing failures.