Assign all interfaces to a port group by interface name

I have 150 calix e7 shelves and would like to put all the interfaces named say 1/1/gp1 to a certain port group.

Is there a way to do this in the config.php file?

I use the following to tell librenms not to scan ONT’s:
$config [‘os’][‘axos’][‘bad_if’] = ‘/^CXNK[0-9]*/’;

Is there a command similar to assign all ports named 1/1/gp1 to a specific port group?

I don’t think anything like that exists and port groups are statically defined right now.

API is probably your best bet: Port_Groups - LibreNMS Docs