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/AsyncAI.CLI/Commands/APIStatusApiGroupCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

namespace AsyncAI.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"api-status", @"API Status endpoint commands.");
command.Subcommands.Add(ApiStatusGetStatusCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
5 changes: 4 additions & 1 deletion src/cli/AsyncAI.CLI/Commands/ApiCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

namespace AsyncAI.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(APIStatusApiGroupCommand.Create());
command.Subcommands.Add(TextToSpeechApiGroupCommand.Create());
command.Subcommands.Add(VoiceManagementApiGroupCommand.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::AsyncAI.St
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-status", @"API status check");
Expand All @@ -58,6 +60,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 @@ -4,14 +4,17 @@

namespace AsyncAI.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"text-to-speech", @"Text to Speech endpoint commands.");
command.Subcommands.Add(TextToSpeechStreamSpeechCommandApiCommand.Create());
command.Subcommands.Add(TextToSpeechSynthesizeSpeechCommandApiCommand.Create());
command.Subcommands.Add(TextToSpeechSynthesizeSpeechWithTimestampsCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ internal static partial class TextToSpeechStreamSpeechCommandApiCommand
Hidden = true,
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"stream-speech", @"Text to speech stream
Expand Down Expand Up @@ -126,6 +128,7 @@ await CliRuntime.RunAsync(async () =>

await CliRuntime.WriteBinaryAsync(parseResult, response, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ internal static partial class TextToSpeechSynthesizeSpeechCommandApiCommand
Hidden = true,
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"synthesize-speech", @"Text to speech
Expand Down Expand Up @@ -126,6 +128,7 @@ await CliRuntime.RunAsync(async () =>

await CliRuntime.WriteBinaryAsync(parseResult, response, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ private static string FormatResponse(ParseResult parseResult, global::AsyncAI.Te
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"synthesize-speech-with-timestamps", @"Text to speech with word timestamps
Expand Down Expand Up @@ -152,6 +154,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 @@ -4,8 +4,10 @@

namespace AsyncAI.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"voice-management", @"Voice Management endpoint commands.");
Expand All @@ -16,6 +18,7 @@ public static Command Create()
command.Subcommands.Add(VoiceManagementGetVoicesBatchCommandApiCommand.Create());
command.Subcommands.Add(VoiceManagementListVoicesCommandApiCommand.Create());
command.Subcommands.Add(VoiceManagementUpdateVoiceCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ private static string FormatResponse(ParseResult parseResult, global::AsyncAI.Cl
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"clone-voice", @"Clone voice
Expand Down Expand Up @@ -176,6 +178,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 @@ -19,6 +19,8 @@ internal static partial class VoiceManagementDeleteVoiceCommandApiCommand
Description = @"API version header.",
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"delete-voice", @"Delete voice
Expand All @@ -42,6 +44,7 @@ await client.VoiceManagement.DeleteVoiceAsync(

await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private static string FormatResponse(ParseResult parseResult, global::AsyncAI.Vo
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-voice", @"Get voice
Expand Down Expand Up @@ -68,6 +70,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 @@ -39,6 +39,8 @@ private static string FormatResponse(ParseResult parseResult, global::AsyncAI.Vo
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-voice-preview", @"Get voice preview
Expand Down Expand Up @@ -68,6 +70,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 @@ -40,6 +40,8 @@ private static string FormatResponse(ParseResult parseResult, global::System.Col
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-voices-batch", @"Get voices by id
Expand Down Expand Up @@ -77,6 +79,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 @@ -95,6 +95,8 @@ private static string FormatResponse(ParseResult parseResult, global::AsyncAI.Li
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"list-voices", @"List voices
Expand Down Expand Up @@ -173,6 +175,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 @@ -65,6 +65,8 @@ internal static partial class VoiceManagementUpdateVoiceCommandApiCommand
Hidden = true,
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"update-voice", @"Update voice
Expand Down Expand Up @@ -123,6 +125,7 @@ await client.VoiceManagement.UpdateVoiceAsync(

await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
11 changes: 9 additions & 2 deletions src/cli/AsyncAI.CLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ dotnet tool install --global AsyncAI.CLI --prerelease

```bash
async-ai --help
async-ai api --help
```
async-ai api-status --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