Any way to add oauth2 application via commandline?

Is there any way to add an oauth2 application via cmdline ? Basically a

docker exec -u git gitea /app/gitea/gitea admin oauth2 blah blah

rather than a curl to the host running the gitea container.

This was also requested in [Feature Request] Add creation OAuth APP from cli and with ENVIRONMENT VARS · Issue #8764 · go-gitea/gitea · GitHub

Background : I have an ansible playbook that installs gitea and drone very nicely. Sets up the drone admin user, the oauth2 application via token using the REST api, secrets, the works.

Now trying to incorporate CI/CD testing via molecule, and it’s almost there … The hangup is creating the oauth2 application. The base playbook works fine, with a uri: task that calls /api/v1/user/applications/oauth2?token=xxxxx but running under molecule either via drone or locally has trouble due to the unknown location or accessibility of the gitea container.

It would take a bunch of hacky jinja2 crap and conditional tasks to accommodate the variations. But a straight-up cmdline call would be easy.