clone and install
git clone https://github.com/amtrack/sfdx-browserforce-plugin-demo.git
cd sfdx-browserforce-plugin-demo
npm install
create a scratch org
sfdx force:org:create -f config/project-scratch-def.json -a browserforce-demo
try to push the source (it fails because customer portal is not enabled)
$ sfdx force:source:push -u browserforce-demo
PROJECT PATH ERROR
────────────────────────────────────────────────────────────── ──────────────────────────────────────────────
force-app/main/default/portals/Customer Portal.portal-meta.xml Not available for deploy for this organization
ERROR running force:source:push: Push failed.
lets install sfdx-browserforce-plugin and activate the customer portal using browser automation
npm install --save-dev sfdx-browserforce-plugin
echo -e "{\n \"settings\": {\n \"customerPortal\": { \"enabled\": true }\n }\n}" > config/browserforce-shape-def.json
BROWSER_DEBUG=true npx sfdx-browserforce-plugin browserforce:apply -f config/browserforce-shape-def.json -u browserforce-demo
and push the source again (force push because the "Customer Portal" has been created by default)
sfdx force:source:push -u browserforce-demo -f