How to get a Hydra config without using @hydra.main()
问题 Let's say we have following setup (copied & shortened from the Hydra docs): Configuration file: config.yaml db: driver: mysql user: omry pass: secret Python file: my_app.py import hydra @hydra.main(config_path="config.yaml") def my_app(cfg): print(cfg.pretty()) if __name__ == "__main__": my_app() This works well when we can use a decorator on the function my_app . Now I would like (for small scripts and testing purposes, but that is not important) to get this cfg object outside of any