An implementation of `Tectonic.Core` for executing Tectonic activities and workflows on the command line using `System.CommandLine`.
$ dotnet add package Tectonic.Extensions.CommandLineAn implementation of Tectonic.Core for executing Tectonic activities and workflows on the command line using System.CommandLine.
Refer to Tectonic.Abstractions for how to create an activity, then follow these steps to execute it on the command line:
Add a reference to the library from your CLI project:
<PackageReference Include="Tectonic.Extensions.CommandLine" Version="0.8.0" />
Add the following code to your CLI project:
IHost host = Host
.CreateDefaultBuilder()
.RegisterCustomLoggingProviders()
.ConfigureServices((context, services) => services
.AddCommandBuilderServices())
.Build();
CommandBuilder builder = host
.Services
.GetRequiredService<CommandBuilder>();
RootCommand command = builder
.Register<CreateSomethingAsAnActivity>("your-command-name", "your-subcommand-name")
.Build();
await command.InvokeAsync(args);
Then
dotnet run your-command-name your-subcommand-name --help
./path/to/YOUR_EXECUTABLE your-command-name your-subcommand-name --help