Add close command to CLI

Added 'close' command to the CLI to close the currently opened object.