Manual:CreateAndPromote.php

Details
createAndPromote.php is a maint-scripts>Special:MyLanguage/Manual:Maintenance scripts|maintenance script that creates a new user and grants them additional rights (e.g. sysop, bureaucrat or bot rights).

There is also an option to promote a user who already exists.

Example
This adds the user to the bureaucrat group, the sysop group and to the custom developer group.