wp acorn not working in Sage site on Local app

Hi, I’m trying to get started with a new Bedrock and Sage site using Local by Flywheel for local development. I’ve followed the steps here and everything is working beautifully.

The next thing I would like to do is install the generoi/sage-woocommerce package, but I can’t seem to run wp acorn from the site shell.

I’ve confirmed the Sage starter theme is installed and activated, but I still see Error: 'acorn' is not a registered wp command.

The base Sage theme should handle booting Acorn, so I’m not sure what I’ve missed.

Thanks for your help!

Are you using the shell accessed through the local ui? Because it’s a container based environment you need to use the shell inside the container.

also is sage theme active? It needs to be to access acorn commands

Thanks @csorrentino, I had checked those things but now I see where the issue was…

When I open the site shell from Local, it drops me into the /public folder, not the new /bedrock folder. I needed to cd to /app/bedrock/web/app/themes/sage-example to use wp acorn. Dumb mistake!

If you’re using Local and wp acorn isn’t working in your regular terminal (outside Local’s built-in shell), it’s likely due to the database connection relying on a socket.

You can fix this by updating your wp-config.php like so:

define( 'DB_HOST', 'localhost:/Users/your-username/Library/Application Support/Local/run/your-site-id/mysql/mysqld.sock' );

Replace your username and your site ID with the correct values for your machine.

You can find the exact DB_HOST value by opening Local, selecting your project, then navigating to PHP → Details. Look for the line containing mysqld.sock, it shows the full socket path you need.

After that, you should be able to run wp acorn directly from your IDE terminal. No need to use Local’s built-in shell anymore.

Hope this helps!

Interesting approach, thanks for sharing!

Another solution is to setup WP-CLI aliases for not just remote environments, but also local Docker-based installs (like Local)

That way you could run commands like wp @local acorn (or wp @development acorn, whatever you’d like to name the alias)