I'm creating a second gen managed package using sfdx and I'm not sure how to add a post-install script. Most information I've come across involves updating the package from within an org. Is this option available to me when creating 2GP packages?
Have a look on this stackEchange item: PostInstallScript with second generation package
You can define the postInstallScript and UninstallScript within the file sfdx-project.json or when you use sfdx force:package:version:create