Is there any way to run command line from iOS on MacOS
Solution 1:
You can use any SSH app on iOS to access the command line on a Mac.
On the Mac you want to open System Preferences => Sharing and enable Remote Login.
On the iOS device you want to install an SSH app, such as for example Terminus from the App Store.
You can then use Terminus to connect to the Mac using its IP address and your user name and password.