Hydra's command line flags
Hydra is using the command line for two things:
- Configuring your application (See Override Grammar)
- Telling Hydra what to do.
Any argparse argument that is prefixed by --
or '-
is telling Hydra what to do.
The rest of the parameters are used to configure your application.
You can view the Hydra specific flags via --hydra-help
.
Example output
$ python my_app.py --hydra-help
Hydra (1.0.0rc3)
See https://hydra.cc for more info.
== Flags ==
--help,-h : Application's help
--hydra-help : Hydra's help
--version : Show Hydra's version and exit
--cfg,-c : Show config instead of running [job|hydra|all]
--package,-p : Config package to show
--run,-r : Run a job
--multirun,-m : Run multiple jobs with the configured launcher and sweeper
--shell-completion,-sc : Install or Uninstall shell completion:
Bash - Install:
eval "$(python my_app.py -sc install=bash)"
Bash - Uninstall:
eval "$(python my_app.py -sc uninstall=bash)"
Fish - Install:
python my_app.py -sc install=fish | source
Fish - Uninstall:
python my_app.py -sc uninstall=fish | source
--config-path,-cp : Overrides the config_path specified in hydra.main().
The config_path is relative to the Python file declaring @hydra.main()
--config-name,-cn : Overrides the config_name specified in hydra.main()
--config-dir,-cd : Adds an additional config dir to the config search path
--info,-i : Print Hydra information
Overrides : Any key=value arguments to override config values (use dots for.nested=overrides)
== Configuration groups ==
Compose your configuration from those groups (For example, append hydra/job_logging=disabled to command line)
hydra/help: default
hydra/hydra_help: default
hydra/hydra_logging: default, disabled, hydra_debug
hydra/job_logging: default, disabled
hydra/launcher: basic, rq, submitit_local, submitit_slurm
hydra/output: default
hydra/sweeper: ax, basic, nevergrad
Use '--cfg hydra' to Show the Hydra config.
--help,-h :β
Shows the application's help. This can be customized.
Example output
$ python my_app.py --help
my_app is powered by Hydra.
== Configuration groups ==
Compose your configuration from those groups (group=option)
db: mysql, postgresql
== Config ==
Override anything in the config (foo.bar=value)
db:
driver: mysql
user: omry
pass: secret
Powered by Hydra (https://hydra.cc)
Use --hydra-help to view Hydra specific help
--versionβ
Show Hydra's version and exit
--cfg,-cβ
Show config instead of running. Takes as parameter one of job
, hydra
or all
.
Example output
$ python my_app.py --cfg job
# @package _global_
db:
driver: mysql
user: omry
pass: secret
--package,-pβ
Used in conjunction with --cfg. -p select a specific config package to show.
Example output
$ python my_app.py --cfg hydra -p hydra.job
# @package hydra.job
name: my_app
override_dirname: ''
id: ???
num: ???
config_name: config
env_set: {}
env_copy: []
config:
override_dirname:
kv_sep: '='
item_sep: ','
exclude_keys: []
--run,-rβ
Run is the default mode and is not normally needed.
--multirun,-mβ
Run multiple jobs with the configured launcher and sweeper. See .
--shell-completion,-scβ
Install or Uninstall shell tab completion.
--config-path,-cpβ
Overrides the config_path specified in hydra.main(). The config_path is relative to the Python file declaring @hydra.main()
--config-name,-cnβ
Overrides the config_name specified in hydra.main()
--config-dir,-cdβ
Adds an additional config directory to the config search path. This is useful for installed apps that want to allow their users to provide additional configs.
--info,-iβ
Print Hydra information. This includes installed plugins, search path, composition trace, generated config and more.