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...
https://learn.microsoft.com/en-us/dotnet/core/tools/global-t...
dotnet script ../../../../../scrips/scaffold-something.cs
With npm run it works from any subdirectory: npm run scaffold-something