Add new wireguard config in a script

Hello.
I have a wireguard server and my router is a wireguard client. So i can connect to it from anywhere and i will be in my lan. But i uploaded config in the Web UI, and now i would like to make a script for this, in case if i reinstall firmware on the router.
And there is the problem - i did not found a way to do that in cli. Adding a config in the Web UI changes 4 configs in /etc/configs by adding/modifing a lot of entries. I tried all obvious solutions already.
Is there any way to add and enable new wg config using a script and have the same result as with the WebUI?

router: mt3000
firmware: 4.6.9

Hi!

It seems that this requirement can only be achieved through GL.iNet's API.

Please email [email protected] with reference to this post or your requirements, so that our support team can provide the relevant API.

Support solved my problem. This topic can be closed.