You can use project-scoped tool manifests. Then you can call dotnet tool restore to load all tools specified in the manifest.

https://learn.microsoft.com/en-us/dotnet/core/tools/global-t...

Sure, but I think you still need to provide the full path of the script. If you're inside a source folder very deep it will lead to something like:

  dotnet script ../../../../../scrips/scaffold-something.cs
With npm run it works from any subdirectory:

  npm run scaffold-something

TIL, thank you!