How to toggle portrait / landsape screen orientation with single launchable command?

I would like to get screen rotation under manual control.

Action A: set portrait mode Action B: set landscape mode

Both actions with immediate effect, no menu, no confirmation, etc.

I would like to have these commands reachable as regular app. And add it into customizable actions in other apps, i.e. to on-screen drawer (Jina), as Bixby voice command, Bixby button action etc.

Apps I reviewed put such rotation commands somewhere to toggle buttons area or to widget. So they are not launchable on their own. Any idea how to get commands A and B (or one which toggles A/B) available as app?