This might not be the exact answer to your question, but you can select multiple files on your calibre library, right click, select
group convert, and on the following window select
kepub as the output format (provided that you have installed the corresponding plugin).
If your concern was to convert multiple files at once, this could be a solution.
Another thing that you might want to try, is to go to the program settings, go in the
Add books section, and check the second tab
Automatic adding: here you can specify a folder where Calibre will look for books to be automatically imported in your library, and optionally convert them to a format of your liking; again, this could be a solution to your issue.
If you wanted to include the conversion process in a script, however, these tricks won't be useful; I'm not very knowledgeable of Calibre CLI interface, so I can't help you further.
Please Note that I'm using Calibre with the italian interface, so the previous menu entries can be a little different from what I've written, they are just what I've translated on-the-fly.