https://github.com/dotnet-labs/netcoreglobaltools
Create a custom .NET Core CLI tool
https://github.com/dotnet-labs/netcoreglobaltools
cli command-line command-line-tool commandline docker dotnet dotnetcore global-tool
Last synced: 19 days ago
JSON representation
Create a custom .NET Core CLI tool
- Host: GitHub
- URL: https://github.com/dotnet-labs/netcoreglobaltools
- Owner: dotnet-labs
- Created: 2020-07-08T14:56:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-08T19:41:16.000Z (about 2 years ago)
- Last Synced: 2023-12-08T20:33:02.129Z (about 2 years ago)
- Topics: cli, command-line, command-line-tool, commandline, docker, dotnet, dotnetcore, global-tool
- Language: C#
- Homepage:
- Size: 636 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# .NET Core Global Tools
## [Medium Article](https://codeburst.io/creating-a-custom-net-core-global-tool-40cf3c1410c9)
This blog post discussed CLI tools. It contains a step-by-step guide of creating a custom .NET Core global tool.
## Build this project Locally
You can build this project locally either using Docker or using .NET CLI tools.
### 1. using Docker with Linux containers

```PowerShell
docker build -t global-tool-test .
docker run -it global-tool-test bash
root@7a5df30fefaa:/src/tools# ./stat sd -n 1 2 3
Population Standard Deviation: 0.816496580927726
Sample Standard Deviation: 1
root@7a5df30fefaa:/src/tools# ./stat avg -n 1 2 3
Arithmetic Average: 2
root@7a5df30fefaa:/src/tools# exit
# can rebuild the project using bash commands in the container
```
### 2. using `dotnet cli`
```PowerShell
cd StatisticsToolbox
dotnet pack
dotnet tool install --add-source .nuget\ stat --tool-path .\tools
dotnet tool update --add-source .nuget\ stat --tool-path .\tools
.\tools\stat.exe avg -n 1
.\tools\stat.exe sd -n 1 2 3
```