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
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Descript.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"api-endpoints", @"API Endpoints endpoint commands.");
Expand All @@ -22,6 +24,7 @@ public static Command Create()
command.Subcommands.Add(ApiEndpointsListProjectsCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsPublishJobCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsSearchCommandApiCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
5 changes: 4 additions & 1 deletion src/cli/Descript.CLI/Commands/ApiCommand.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

namespace Descript.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(APIEndpointsApiGroupCommand.Create());
command.Subcommands.Add(EditInDescriptApiGroupCommand.Create());
command.Subcommands.Add(ExportFromDescriptApiGroupCommand.Create());
CustomizeCommand(ref command);
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.A
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"agent-edit-job", @"Agent edit
Expand Down Expand Up @@ -197,6 +199,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 @@ -13,6 +13,8 @@ internal static partial class ApiEndpointsCancelJobCommandApiCommand
Description = @"The job ID",
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"cancel-job", @"Cancel job
Expand All @@ -34,6 +36,7 @@ await client.ApiEndpoints.CancelJobAsync(

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 @@ -27,6 +27,8 @@ internal static partial class ApiEndpointsExportTranscriptAsBytesCommandApiComma
Hidden = true,
};

static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"export-transcript-as-bytes", @"Export project transcript
Expand Down Expand Up @@ -110,6 +112,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 @@ -47,6 +47,8 @@ private static string FormatResponse(ParseResult parseResult, string value, glob
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"export-transcript", @"Export project transcript
Expand Down Expand Up @@ -136,6 +138,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 @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.J
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-job", @"Get job status
Expand Down Expand Up @@ -62,6 +64,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 @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.G
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-project", @"Get project details
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::Descript.G
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", @"Check API status
Expand Down Expand Up @@ -63,6 +65,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 @@ -120,6 +120,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.I
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"import-project-media", @"Import media and sequences
Expand Down Expand Up @@ -215,6 +217,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::Descript.L
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"list-agent-models", @"List agent models
Expand Down Expand Up @@ -76,6 +78,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 @@ -63,6 +63,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.L
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"list-jobs", @"List jobs
Expand Down Expand Up @@ -123,6 +125,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 @@ -93,6 +93,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.L
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"list-projects", @"List projects
Expand Down Expand Up @@ -163,6 +165,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 @@ -100,6 +100,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.P
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"publish-job", @"Publish project media
Expand Down Expand Up @@ -186,6 +188,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 @@ -108,6 +108,8 @@ private static string FormatResponse(ParseResult parseResult, global::Descript.S
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"search", @"Search a drive
Expand Down Expand Up @@ -167,6 +169,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 @@ -4,12 +4,15 @@

namespace Descript.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"edit-in-descript", @"Edit in Descript endpoint commands.");
command.Subcommands.Add(EditInDescriptPostEditInDescriptSchemaCommandApiCommand.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::Descript.E
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"post-edit-in-descript-schema", @"Create Import URL
Expand Down Expand Up @@ -114,6 +116,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,12 +4,15 @@

namespace Descript.CLI.Commands;

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

public static Command Create()
{
var command = new Command(@"export-from-descript", @"Export from Descript endpoint commands.");
command.Subcommands.Add(ExportFromDescriptGetPublishedProjectMetadataCommandApiCommand.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::Descript.P
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


static partial void CustomizeCommand(ref Command command);

public static Command Create()
{
var command = new Command(@"get-published-project-metadata", @"Get Published Project Metadata
Expand Down Expand Up @@ -64,6 +66,7 @@ await CliRuntime.WriteResponseAsync(
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
CustomizeCommand(ref command);
return command;
}
}
11 changes: 9 additions & 2 deletions src/cli/Descript.CLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ dotnet tool install --global Descript.CLI --prerelease

```bash
descript --help
descript api --help
```
descript api-endpoints --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
Loading