There are lots of internal commands in Mailpile. These can be accessed via any of the interaction modes, including web, command line, JSON API, or Python module.
Type "help" in the command line interface to get a list. See [[URLS]] for API endpoint specifications. See [[Command plugins]] for adding new commands.