How to run a Jupyter notebook in the command line

When executing automatic tests, it is useful to run all cells in the Jupyter notebook in command line.

jupyter nbconvert --to notebook --inplace --execute mynotebook.ipynb

Link on Stack Overflow

Add --ExecutePreprocessor.timeout=600 in case you have cells in the notebook that take >30 seconds to execute.

See also