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...
TIL, thank you!
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
But then each script has an individual list of dependencies so there should be no need for further scoping like in npm (as in, the compilation of the script is always scoped behind the scenes). In this regard, both should be similar to https://docs.astral.sh/uv/guides/scripts/#declaring-script-d... which I absolutely love.