There’s an option, probably --admin-password, which allows to specify the admin password when running a YunoHost command. (You can see it when running yunohost --help)
Be aware though, that when doing this, the full command will appear in commands like ps -ef. Therefore a malicious user on the machine that would be monitor ps -ef could be able to grab the admin password and gain access…