diff --git a/src/cli/Pruna.CLI/Commands/ApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/ApiCommand.g.cs index 2963d04..b287c04 100644 --- a/src/cli/Pruna.CLI/Commands/ApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/ApiCommand.g.cs @@ -4,13 +4,16 @@ namespace Pruna.CLI.Commands; -internal static class ApiCommand +internal static partial class ApiCommand { + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command("api", "Generated endpoint commands."); command.Subcommands.Add(DefaultApiGroupCommand.Create()); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/CreatePredictionCommandApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/CreatePredictionCommandApiCommand.g.cs index c1a629e..7808479 100644 --- a/src/cli/Pruna.CLI/Commands/CreatePredictionCommandApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/CreatePredictionCommandApiCommand.g.cs @@ -45,6 +45,8 @@ private static string FormatResponse(ParseResult parseResult, global::Pruna.Pred static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"create-prediction", @"Create a prediction for a Pruna model."); @@ -76,6 +78,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/Pruna.CLI/Commands/DefaultApiGroupCommand.g.cs index 6f4b3c0..a1fcf84 100644 --- a/src/cli/Pruna.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -4,8 +4,10 @@ namespace Pruna.CLI.Commands; -internal static class DefaultApiGroupCommand +internal static partial class DefaultApiGroupCommand { + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"default", @"default endpoint commands."); @@ -14,6 +16,7 @@ public static Command Create() command.Subcommands.Add(GetPredictionDeliveryCommandApiCommand.Create()); command.Subcommands.Add(GetPredictionStatusCommandApiCommand.Create()); command.Subcommands.Add(UploadFileCommandApiCommand.Create()); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/GetFileCommandApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/GetFileCommandApiCommand.g.cs index 549a782..67734ac 100644 --- a/src/cli/Pruna.CLI/Commands/GetFileCommandApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/GetFileCommandApiCommand.g.cs @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::Pruna.File static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-file", @"Get uploaded file metadata."); @@ -58,6 +60,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/GetPredictionDeliveryCommandApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/GetPredictionDeliveryCommandApiCommand.g.cs index 7d637c5..0c9d866 100644 --- a/src/cli/Pruna.CLI/Commands/GetPredictionDeliveryCommandApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/GetPredictionDeliveryCommandApiCommand.g.cs @@ -13,6 +13,8 @@ internal static partial class GetPredictionDeliveryCommandApiCommand Description = @"", }; + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-prediction-delivery", @"Download or retrieve a generated prediction artifact."); @@ -32,6 +34,7 @@ await CliRuntime.RunAsync(async () => await CliRuntime.WriteBinaryAsync(parseResult, response, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/GetPredictionStatusCommandApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/GetPredictionStatusCommandApiCommand.g.cs index ccf0298..a3d3613 100644 --- a/src/cli/Pruna.CLI/Commands/GetPredictionStatusCommandApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/GetPredictionStatusCommandApiCommand.g.cs @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::Pruna.Pred static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-prediction-status", @"Get prediction status and result metadata."); @@ -58,6 +60,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/Commands/UploadFileCommandApiCommand.g.cs b/src/cli/Pruna.CLI/Commands/UploadFileCommandApiCommand.g.cs index 1826dbf..30f5ee1 100644 --- a/src/cli/Pruna.CLI/Commands/UploadFileCommandApiCommand.g.cs +++ b/src/cli/Pruna.CLI/Commands/UploadFileCommandApiCommand.g.cs @@ -41,6 +41,8 @@ private static string FormatResponse(ParseResult parseResult, global::Pruna.File static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"upload-file", @"Upload a file for prediction inputs."); @@ -69,6 +71,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/Pruna.CLI/README.md b/src/cli/Pruna.CLI/README.md index d173c0e..e15cbb4 100644 --- a/src/cli/Pruna.CLI/README.md +++ b/src/cli/Pruna.CLI/README.md @@ -12,5 +12,12 @@ dotnet tool install --global Pruna.CLI --prerelease ```bash pruna --help -pruna api --help -``` \ No newline at end of file +pruna default --help +``` + +## Customization + +Generated operation, tag, and API group command classes are partial. Implement +`static partial void CustomizeCommand(ref Command command)` in a separate source +file to add aliases or validators, change the action, or replace a command. The +hook runs after the generated command has been configured. \ No newline at end of file