Mostly I was using this web site for my example.

In my case I have created the project C:\projects\ReverseGeoCoding, then open PowerShell, and first, if you don't have EF tool installed, execute following:

dotnet tool install --global dotnet-ef
Go to project folder, like cd "C:\projects\ReverseGeoCoding", and add packages "Microsoft.EntityFrameworkCore.Design" and "MySql.EntityFrameworkCore" like:
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package MySql.EntityFrameworkCore --version 5.0.0-m8.0.23
Now scaffold:
dotnet ef dbcontext scaffold "SERVER=localhost;DATABASE=myDb;UID=uid;PASSWORD=pass;" MySql.EntityFrameworkCore -o C:\projects\ReverseGeoCoding -f
Now, I have made my own console applicatcation for scaffolding:
using System.Diagnostics;
using System.Threading;

namespace MySQLScaffold
  class Program
    static void Main(string[] args)
      // Use ProcessStartInfo class
      ProcessStartInfo startInfo = new ProcessStartInfo
        CreateNoWindow = false,
        UseShellExecute = false,
        FileName = "dotnet",
        WindowStyle = ProcessWindowStyle.Hidden,
        Arguments = "ef dbcontext scaffold"
                    + " \"SERVER=localhost;DATABASE=myDb;UID=uid;PASSWORD=pass;\""
                    + " MySql.EntityFrameworkCore -o"
                    + " C:\\projects\\ReverseGeoCoding"
                    + " -f -v"
                    + " -p C:\\projects\\ReverseGeoCoding"

      Mutex myMutex;
      if (!Mutex.TryOpenExisting("testMutex", out myMutex))
        myMutex = new Mutex(true, "testMutex");
          // Start the process with the info we specified.
          // Call WaitForExit and then the using statement will close.
          using (Process exeProcess = Process.Start(startInfo))
          // Log error.

      //Console.WriteLine("Press any key");
Then I have created Class library application "EFCore", where in prebuild event I have added
I had to add package "Microsoft.EntityFrameworkCore.Design", and I had to reference my "ReverseGeoCoding" project, here is how my "EFCore.csproj" look like:
<Project Sdk="Microsoft.NET.Sdk">


  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="C:\projects\MySQLScaffold\MySQLScaffold\bin\Debug\netcoreapp3.1\MySQLScaffold.exe" />

    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

    <ProjectReference Include="..\..\ReverseGeoCoding\ReverseGeoCoding.csproj" />