Implemented the 'ensure' subcommand and a unit test, and updated the docs.