Starter kit for dotnet tools on the cli.
Already implements a statically typed implementation of the chuck norris api
To install the tool go to the dotnet-tool-starterkit directory and execute the scriptwrapper.sh
script by invoking it with the following arguments:
./scriptwrapper.sh install
To update the tool after having made modifications to it run the following script
./scriptwrapper.sh update
Make sure ~/.dotnet/tools/ has been added to your $PATH on linux
- TODO Write ScriptWrapper in powershell
- TODO Write Install tool script
- TODO Write Update tool script
Adding more commands is as simple as adding a new argument in Program.cs and an if-statement checking for it. For example, to invoke the chucknorris api invoke this tool with the following parameter
chucknorris fetch
which matches this if-statement from Program.cs
if (arguments == "fetch")
{
RandomApi randomApi = new RandomApi();
await randomApi.CallApi();
}
To rename the name of the tool simply edit the property ToolCommandName in the .csproj file
<ToolCommandName>chucknorris</ToolCommandName>