-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a plan to support global tools install like Npm ? #7427
Comments
nuget ? |
yes |
Global tools is something we want to pursue, but won't get to it during 1.0 release. |
I assume no project file is required for someone to acquire a global tool. Many tools people want to deliver are not about projects. They are about debugging or reverse engineering already built assets. |
We (the diagnostics folks) would love to use something like this to deliver some diagnostic tools we have in mind. |
Can it be just |
@piotrpMSFT was there any progress on this issue and do we know if this is a committed work item for 2.0? |
@lt72 No 2.0 work is committed at this point. we're still getting 1.0 out the door. |
@piotrpMSFT Any updates? 1.0 is already out the door for quite some time, and this feature would really be useful to actually make tools usable. |
In the npm/node world, installing a package globally allows you to invoke it with nothing else in front of it:
Installed locally, you need to either call it in the scripts of your
Maybe I'm wrong, but I feel like the dotnet tools (whether installed locally or globally) should always be invoked with Potential issue |
My personal opinion : when install a tool globally, dotnet should publish a Self-Contained app , so when you update/remove the dotnet cli or clear the packages cache ,those tools still can work . |
Yea, the more I'm thinking about it, self contained would be nice after an upgrade of the cli/runtime |
.NET Standard is backward compatible, so it is safe to assume that it will work. I don't think it is a good idea to package a small tool to a size of 100mb+ just to make it standalone. And I am more inclined into tools being accessible from the terminal directly, with no need for 'dotnet tool'. Just like how we use npm tools. In case of breaking changes, there should be enough time given for authors to upgrade their tools. |
3.0 can be side-by-side installed to 2.0. If you uninstall 2.0, the tool will give a message it doesn't find the appropriate runtime.
Considering runtimes can be installed side-by-side, tools should be published as framework dependent applications. This means they have a dependency on a runtime (e.g. .NET Core 2.x) but not a dependency on a specific platform (e.g. linux-x64). |
@Ghasan @tmds Framework dependent applications will be great only if the tools only serve for development . and probably easier to implement : create a new project and reference the tools as a PackageReference , and then publish, the project's as a proxy to call the tools |
@John0King I don't see at what point a self-contained application would be created. This would be the framework dependent way: |
Do you mean publish to Nuget as framework dependent application (platform irrelevant app) ? If you do, I will agree with you. Self-contained publish process should only happen when you install it. |
The publish process for a self-contained application starts from the application source code. It doesn't start from a published framework-dependent application. |
project file: <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<AssemblyName>CLITools</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
</ItemGroup> Program.cs public static void Main(string[] args)
{
Microsoft.Extensions.SecretManager.Tools.Program.Main(args);
} add the folder to this is the most easy way , and can change the long name to a short name (without the |
Aha. You are suggesting that the way to make the FDD NuGet package callable via a short name is to create and publish a SCD that calls the FDD. So, we both think tools should be published to NuGet as FDD. That was what I was talking about. |
@tonerdo implemented this feature as a cli extension: https://github.com/tonerdo/dotget |
This is actually being implemented in the CLI directly as well, as global tools. The install tool and pack tool experience just made in to the CLI available from our nightlies at the main branch. |
@livarcocc is this 2.1 milestone or 2.2? |
Just finished a blog post on how to create & use tool packages for |
It will be 2.1 of .NET Core. 2.1.3xx of the CLI. |
@livarcocc Should |
cc @wli3 |
Yes, it is automatically added to path on macOS using the installer. |
issue on dotnet-x not working on mac https://github.com/dotnet/cli/issues/8450 |
@livarcocc |
Yes, they will still run. Tools asset is stored in a different place. |
@wli3 , ok on macOS I had to manually add |
@johnkors you don’t happen to use zsh with oh-my-zsh? |
Yeah, I'm using zsh. Makes sense. Thanks, @dasMulli ! |
@johnkors @dasMulli I added an issue on different shell support on mac. https://github.com/dotnet/cli/issues/8466 suggestions are welcome |
Will this also cover use cases such as installing a test runner? |
As plan for 2.1.300 all the answers are no |
@wli3 @rohit21agrawal
is inaccurate as there's still going to be a lot of use cases missing that have been possible with solution level packages. |
may be create a new tool |
I've heard people ask offline for a "pull and execute" 1-step tool invoke command that - like |
AFAIK, |
We have now implemented our global tools feature through dotnet tool install (formerly dotnet install tool). It has a local tool version (through --tool-path instead of --global) along with uninstall, list and update. As such, I am going to close this issue. If there are specific feature requests around the feature we have built in 2.1.300, I would suggest filling new separate issues for those asks. |
In NodeJs we can use
npm install bower -g
to install bower or other tools ,I think dotnet should do it too .
I expect there will be a command like :
dotnet tools install <toolname> -g
by default the tools put in global shoud build a platform specific binary ( on windows, there will be a<app>.exe
file )and
dotnet tools install <toolname>
to manage the tools section in project.json.The text was updated successfully, but these errors were encountered: