Ah, you might have been thinking of gui/gm-unit. They have similar names, but gui/gm-editor came first.
That is exactly what i was thinking
If it's something presentable, sharing it here might be useful to others
So first you need to find the civilization entity ID or site entity ID (I think first one affects new forts while second affects current forts, but have only done it for site entity ID), if you go to nemesis record, for example:
gui/gm-editor dfhack.units.getNemesis(dfhack.gui.getSelectedUnit())
then there is an entry entity_links, which all your dwarves should have two memberst entries, one for civilization entity ID and one for site entity ID. Your nobles/administrators should have a positionst entry for your site ID, while I would expect a monarch to have a positionst entry for the civilization ID
I'm sure there are other ways to find civlization ID / site ID
then with gui/gm-editor df.historical_entity.find(ID), there will be an entry for positions, which has an entity "own" (maybe "site" for the civilization level ID, not sure)
that is a list of all positions, each has the name, an ID, and then what i care about is appointed_by and appointed_by_civ fields, in my case they were empty and I needed to add (alt+i) to the first one an entry with no name (leave blank) and value of the ID of another position in my fort and for the second one an entry with no name and value of the ID of the site entity (not sure if this was neccessary, but all the other positions had it)