lib: implemented the `edit` command.