How to use automator to create a service which converts an ebook (using calibre commands)
Open Automator, choose the service template, change "Service receives selected" to "files or folders", add a Run Shell Script action, change "Pass input" to "as arguments", and change the command to:

for f;do /Applications/calibre.app/Contents/MacOS/ebook-convert "$f" "${f%.*}.mobi";done




Or if you add

2mobi() {
  for f; do
    /Applications/calibre.app/Contents/MacOS/ebook-convert "$f" "${f%.*}.mobi"
  done
}


to a shell configuration file like ~/.bash_profile, you can run 2mobi /path/to/file.epub in a shell.