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 @@ -16,6 +16,7 @@ public static Command Create()
command.Subcommands.Add(ApiEndpointsGetProjectCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsGetStatusCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsImportProjectMediaCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsListAgentModelsCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsListJobsCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsListProjectsCommandApiCommand.Create());
command.Subcommands.Add(ApiEndpointsPublishJobCommandApiCommand.Create());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ provided. Requires `project_id`.
private static Option<string?> Model { get; } = new(
name: @"--model")
{
Description = @"AI model to use for editing. Defaults to the default model.
Description = @"AI model to use for editing. Accepts a canonical model id
(e.g. `claude-opus-4.8`, `claude-sonnet-4.6`, `gpt-5.5`,
`gemini-3.5-flash`) or a friendly alias (`auto`, `claude-opus`,
`claude-sonnet`, `claude-haiku`, `gpt`, `gemini-pro`,
`gemini-flash`). Call [GET /agent/models](#operation/listAgentModels)
to discover the current set of supported models and aliases.

Defaults to `auto` when omitted, which selects a recommended
model for your account.
",
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace Descript.CLI.Commands;

internal static partial class ApiEndpointsListAgentModelsCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, global::Descript.ListAgentModelsResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
string? text = null;
CustomizeResponseText(parseResult, value, ref text);
if (!string.IsNullOrWhiteSpace(text))
{
return text;
}

var hints = new Dictionary<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, global::Descript.ListAgentModelsResponse value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"list-agent-models", @"List agent models
List the currently available agent models and the aliases that resolve to them.

The `model` parameter on [POST /jobs/agent](#operation/agentEditJob) accepts any
value listed under `availableModels[].id` or `aliases[].id`. Aliases let you target
the latest
recommended model for a given tier without chasing version bumps — for example,
passing `claude-opus` always routes to whichever Claude Opus version Descript
currently recommends.

Cost tiers are coarse buckets — `low`, `medium`, `high` — useful for showing
users a relative price/performance signal. Exact pricing is reported per job via
the `ai_credits_used` field on [GET /jobs/{job_id}](#operation/getJob).

When `model` is omitted on `POST /jobs/agent`, the request defaults to `auto`, which
selects a recommended model for your account. `auto` is a `medium`-cost option. For an
`auto` request, `result.resolved_model` on [GET /jobs/{job_id}](#operation/getJob) reports
`auto`; for an explicit model or alias it reports the canonical id that ran.
");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.ApiEndpoints.ListAgentModelsAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::Descript.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,14 @@ partial void ProcessAgentEditJobResponseContent(
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </param>
/// <param name="model">
/// AI model to use for editing. Defaults to the default model.
/// AI model to use for editing. Accepts a canonical model id<br/>
/// (e.g. `claude-opus-4.8`, `claude-sonnet-4.6`, `gpt-5.5`,<br/>
/// `gemini-3.5-flash`) or a friendly alias (`auto`, `claude-opus`,<br/>
/// `claude-sonnet`, `claude-haiku`, `gpt`, `gemini-pro`,<br/>
/// `gemini-flash`). Call [GET /agent/models](#operation/listAgentModels)<br/>
/// to discover the current set of supported models and aliases.<br/>
/// Defaults to `auto` when omitted, which selects a recommended<br/>
/// model for your account.
/// </param>
/// <param name="prompt">
/// Natural language instruction for the agent to execute.<br/>
Expand Down
Loading