Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cli/Revocalize.CLI/Commands/ApiCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

namespace Revocalize.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(ConversionApiGroupCommand.Create());
command.Subcommands.Add(ModelsApiGroupCommand.Create());
command.Subcommands.Add(TrainingApiGroupCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

namespace Revocalize.CLI.Commands;

internal static class ConversionApiGroupCommand
internal static partial class ConversionApiGroupCommand
{
static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"conversion", @"Conversion endpoint commands.");
command.Subcommands.Add(ConversionCheckTaskCommandApiCommand.Create());
command.Subcommands.Add(ConversionConvertAudioCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::Revocalize
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"check-task", @"Check conversion task status");
Expand Down Expand Up @@ -66,6 +68,7 @@ await CliRuntime.WriteResponseAsync(
cancellationToken).ConfigureAwait(false);
}
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ private static string FormatResponse(ParseResult parseResult, global::Revocalize
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"convert-audio", @"Convert a vocal audio file to a target voice model");
Expand Down Expand Up @@ -133,6 +135,7 @@ await CliRuntime.WriteResponseAsync(
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
5 changes: 4 additions & 1 deletion src/cli/Revocalize.CLI/Commands/ModelsApiGroupCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

namespace Revocalize.CLI.Commands;

internal static class ModelsApiGroupCommand
internal static partial class ModelsApiGroupCommand
{
static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"models", @"Models endpoint commands.");
command.Subcommands.Add(ModelsCreateModelCommandApiCommand.Create());
command.Subcommands.Add(ModelsListModelsCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ private static string FormatResponse(ParseResult parseResult, global::Revocalize
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"create-model", @"Create a pending custom AI voice model");
Expand Down Expand Up @@ -69,6 +71,7 @@ await CliRuntime.WriteResponseAsync(
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ private static string FormatResponse(ParseResult parseResult, global::Revocalize
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"list-models", @"Get available AI voice models");
Expand Down Expand Up @@ -62,6 +64,7 @@ await CliRuntime.WriteResponseAsync(
cancellationToken).ConfigureAwait(false);
}
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
5 changes: 4 additions & 1 deletion src/cli/Revocalize.CLI/Commands/TrainingApiGroupCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

namespace Revocalize.CLI.Commands;

internal static class TrainingApiGroupCommand
internal static partial class TrainingApiGroupCommand
{
static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"training", @"Training endpoint commands.");
command.Subcommands.Add(TrainingTrainModelCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ private static string FormatResponse(ParseResult parseResult, global::Revocalize
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"train-model", @"Train a custom AI voice model");
Expand Down Expand Up @@ -68,6 +70,7 @@ await CliRuntime.WriteResponseAsync(
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
11 changes: 9 additions & 2 deletions src/cli/Revocalize.CLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ dotnet tool install --global Revocalize.CLI --prerelease

```bash
revocalize --help
revocalize api --help
```
revocalize conversion --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.
Loading