Hello @Moose
Welcome to ST Community
In STM32CubeMX and STM32CubeIDE, you will find fields labeled:
"User action, Before code generation"
"User action, After code generation"
These fields allow you to specify commands or scripts that will be executed:
Before code generation:
The command in the "Before code generation" field runs just before the code is generated from the .ioc file.
After code generation:
The command in the "After code generation" field runs immediately after the code is generated.

THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.