parent |
---|
Generators |
Before you can install Kiota as a dotnet tool you will first have to create a Nuget configuration file to access the authenticated GitHub package feed. The following steps show you how to create this file. This is a temporary step until we publish the Kiota tool to the public nuget feed.
-
Navigate to New personal access token and generate a new token. (permissions: package:read, repo).
-
Copy the token, you will need it later.
-
Enable the SSO on the token if you are a Microsoft employee.
-
Create a
nuget.config
file in the current directory with the following content.<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="GitHub" value="https://nuget.pkg.github.com/microsoft/index.json" /> </packageSources> <packageSourceCredentials> <GitHub> <add key="Username" value="" /><!-- your github username --> <!-- your github PAT: read:pacakges with SSO enabled for the Microsoft org (for microsoft employees only) --> <add key="ClearTextPassword" value="" /> </GitHub> </packageSourceCredentials> </configuration>
-
Execute the following command to install the tool.
dotnet tool install --global --configfile nuget.config kiota
-
Execute the following command to run kiota.
kiota -d /some/input/description.yml -o /some/output/path --language csharp -n samespaceprefix