Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorTypeName(err CommandError) string
- type APIFlags
- type APIInferenceFlags
- type APIManagementFlags
- type APISandboxFlags
- type AuditLogFlags
- type AuthConfigDescribeFlags
- type AuthConfigResult
- type AuthConfigUpdateFlags
- type AuthListFlags
- type AuthListProfile
- type AuthListResult
- type AuthLoginFlags
- type AuthLoginResult
- type AuthLogoutFlags
- type AuthLogoutResult
- type AuthStatusFlags
- type AuthStatusResult
- type AuthSwitchFlags
- type AuthSwitchResult
- type AutoscalingScheduleTimingFlags
- type AutoscalingSettingsFlags
- type Command
- type CommandError
- type CommandErrorMeta
- type CommandExample
- type CommandFlag
- type CommandFlags
- type CommandOutput
- func (o *CommandOutput[JSONT]) ExampleList() []CommandExample
- func (o *CommandOutput[JSONT]) JQ() CommandExample
- func (o *CommandOutput[JSONT]) JSON() string
- func (o *CommandOutput[JSONT]) JSONAlternativeList() []CommandOutputAlternative
- func (o *CommandOutput[JSONT]) JSONArrayStreamedBool() bool
- func (*CommandOutput[JSONT]) JSONOutputType() reflect.Type
- func (o *CommandOutput[JSONT]) JSONOutputUnimportantBool() bool
- func (o *CommandOutput[JSONT]) Text() string
- type CommandOutputAlternative
- type CommandOutputSpec
- type ErrAuth
- type ErrGeneric
- type ErrInterrupted
- type ErrNotFound
- type ErrServer
- type ErrUsage
- type ErrValidation
- type ErrorDesc
- type ExitCode
- type GridClaudeServedModelFlags
- type GridConnectionConfigFlags
- type GridConnectionCreateFlags
- type GridConnectionDeleteFlags
- type GridConnectionDescribeFlags
- type GridConnectionList
- type GridConnectionListFlags
- type GridConnectionUpdateFlags
- type GridHarnessFlags
- type GridHarnessInstall
- type GridHarnessRoute
- type GridHarnessStatus
- type GridMachineUserAPIKeyCreateFlags
- type GridMachineUserAPIKeyDeleteFlags
- type GridMachineUserAPIKeyListFlags
- type GridMachineUserCreateFlags
- type GridMachineUserDeleteFlags
- type GridMachineUserDescribeFlags
- type GridMachineUserIDFlags
- type GridMachineUserKeyOwnerFlags
- type GridMachineUserList
- type GridMachineUserListFlags
- type GridMachineUserUpdateFlags
- type GridPlan
- type GridPlanList
- type GridRouteClassifierDescribeFlags
- type GridRouteClassifierList
- type GridRouteClassifierListFlags
- type GridRouteCreateFlags
- type GridRouteDeleteFlags
- type GridRouteDescribeFlags
- type GridRouteList
- type GridRouteListFlags
- type GridRouteRefFlags
- type GridRouteTargetFlags
- type GridRouteUpdateFlags
- type GridRouteUsageFlags
- type GridRouteUsageQueryFlags
- type GridSetupFlags
- type GridStatusFlags
- type GridStatusList
- type GridSyncFlags
- type GridTeamFlags
- type GridTeamListFlags
- type GridTeamSettingsDescribeFlags
- type GridTeamSettingsUpdateFlags
- type GridTeardownFlags
- type GridTokenFlags
- type GridUserSettingsDescribeFlags
- type GridUserSettingsList
- type GridUserSettingsListFlags
- type GridUserSettingsUpdateFlags
- type GridUserSettingsUserFlags
- type InferenceClientFlags
- type JSONAny
- type JSONError
- type JSONErrorEnvelope
- type JSONUndefined
- type LogFlags
- type LoopsCheckpointDeployFlags
- type LoopsCheckpointFilesFlags
- type LoopsCheckpointListFlags
- type LoopsExecFlags
- type LoopsExecResult
- type LoopsLogFlags
- type LoopsRunCreateFlags
- type LoopsRunDeactivateFlags
- type LoopsRunDescribeFlags
- type LoopsRunListFlags
- type LoopsRunLogsFlags
- type LoopsRunRefFlags
- type LoopsUsageFlags
- type LoopsUsageResult
- type LoopsUsageRow
- type LoopsUsageSummary
- type MetricsFlags
- type ModelAPIDescribeFlags
- type ModelAPIList
- type ModelAPIListFlags
- type ModelAPIMetricsFlags
- type ModelAPIPredictFlags
- type ModelAPIUsageFlags
- type ModelAuditLogsFlags
- type ModelDeleteFlags
- type ModelDeploymentActivateFlags
- type ModelDeploymentConfigFlags
- type ModelDeploymentDeactivateFlags
- type ModelDeploymentDeleteFlags
- type ModelDeploymentDescribeFlags
- type ModelDeploymentDownloadFlags
- type ModelDeploymentDownloadResult
- type ModelDeploymentIDFlags
- type ModelDeploymentListFlags
- type ModelDeploymentLogsFlags
- type ModelDeploymentMetricsFlags
- type ModelDeploymentPromoteFlags
- type ModelDeploymentRenameFlags
- type ModelDeploymentReplicaIDFlags
- type ModelDeploymentReplicaTerminateFlags
- type ModelDeploymentUpdateAutoscalingFlags
- type ModelDeploymentUpdateRequestBackpressureFlags
- type ModelDescribeFlags
- type ModelEnvironmentActivateFlags
- type ModelEnvironmentAutoscalingScheduleCreateFlags
- type ModelEnvironmentAutoscalingScheduleDeleteFlags
- type ModelEnvironmentAutoscalingScheduleListFlags
- type ModelEnvironmentAutoscalingScheduleRefFlags
- type ModelEnvironmentAutoscalingScheduleUpdateFlags
- type ModelEnvironmentAutoscalingScheduleUpdateSettingsFlags
- type ModelEnvironmentDeactivateFlags
- type ModelEnvironmentDescribeFlags
- type ModelEnvironmentFlags
- type ModelEnvironmentListFlags
- type ModelEnvironmentLogsFlags
- type ModelEnvironmentMetricsFlags
- type ModelEnvironmentTrafficRuleCreateFlags
- type ModelEnvironmentTrafficRuleDeleteFlags
- type ModelEnvironmentTrafficRuleListFlags
- type ModelEnvironmentTrafficRuleUpdateFlags
- type ModelEnvironmentUpdateAutoscalingFlags
- type ModelEnvironmentUpdatePromotionFlags
- type ModelEnvironmentUpdateRequestBackpressureFlags
- type ModelImageBuildFlags
- type ModelImageBuildResult
- type ModelImageCommonFlags
- type ModelImagePrepareFlags
- type ModelImagePrepareResult
- type ModelInstanceTypesFlags
- type ModelListFlags
- type ModelPredictFlags
- type ModelPushFlags
- type ModelPushResult
- type ModelRefFlags
- type ModelRenameFlags
- type ModelWatchFlags
- type OptionalFlag
- type OrgAPIKeyCreateFlags
- type OrgAPIKeyDeleteFlags
- type OrgAPIKeyListFlags
- type OrgAccessCheckFlags
- type OrgAuditLogsFlags
- type OrgBillingUsageFlags
- type OrgDescribeFlags
- type OrgIdentityProviderCreateFlags
- type OrgIdentityProviderDeleteFlags
- type OrgIdentityProviderDescribeFlags
- type OrgIdentityProviderList
- type OrgIdentityProviderListFlags
- type OrgIdentityProviderListPredefinedFlags
- type OrgIdentityProviderRefFlags
- type OrgIdentityProviderUpdateFlags
- type OrgPermissionsFlags
- type OrgRegionsFlags
- type OrgRoleAssignmentCreateFlags
- type OrgRoleAssignmentList
- type OrgRoleAssignmentListFlags
- type OrgRoleAssignmentRefFlags
- type OrgRoleCreateFlags
- type OrgRoleDeleteFlags
- type OrgRoleDescribeFlags
- type OrgRoleList
- type OrgRoleListFlags
- type OrgRoleRefFlags
- type OrgRoleUpdateFlags
- type OrgSecretDeleteFlags
- type OrgSecretListFlags
- type OrgSecretSetFlags
- type OrgServiceAccountAccessFlags
- type OrgServiceAccountCreateFlags
- type OrgServiceAccountDeleteFlags
- type OrgServiceAccountDescribeFlags
- type OrgServiceAccountList
- type OrgServiceAccountListFlags
- type OrgServiceAccountPermissionFlags
- type OrgServiceAccountRefFlags
- type OrgServiceAccountUpdateFlags
- type OrgTeamDescribeFlags
- type OrgTeamListFlags
- type OrgTrustRuleCreateFlags
- type OrgTrustRuleDeleteFlags
- type OrgTrustRuleDescribeFlags
- type OrgTrustRuleList
- type OrgTrustRuleListFlags
- type OrgTrustRuleRefFlags
- type OrgTrustRuleUpdateFlags
- type OrgUpdateFlags
- type OrgUserAccessFlags
- type OrgUserDescribeFlags
- type OrgUserList
- type OrgUserListFlags
- type PromotionSettingsOverrideFlags
- type RequestBackpressureFlags
- type SSHProxyFlags
- type SSHSetupFlags
- type SSHSetupResult
- type SSHSignFlags
- type SandboxConnectFlags
- type SandboxCreateFlags
- type SandboxDeleteFlags
- type SandboxDescribeFlags
- type SandboxEnvFlags
- type SandboxExecFlags
- type SandboxImageDeleteFlags
- type SandboxImageLibraryList
- type SandboxImageList
- type SandboxImageListFlags
- type SandboxImageListLibraryFlags
- type SandboxImageLogsFlags
- type SandboxImagePushFlags
- type SandboxImageRefCommandFlags
- type SandboxImageRefFlags
- type SandboxImageTagList
- type SandboxLifecycleFlags
- type SandboxList
- type SandboxListFlags
- type SandboxPreviewCreateFlags
- type SandboxPreviewDeleteFlags
- type SandboxPreviewDescribeFlags
- type SandboxPreviewExpiryFlags
- type SandboxPreviewHeaderFlags
- type SandboxPreviewList
- type SandboxPreviewListFlags
- type SandboxPreviewRefFlags
- type SandboxPreviewTokenCreateFlags
- type SandboxPreviewTokenDeleteFlags
- type SandboxPreviewTokenList
- type SandboxPreviewTokenListFlags
- type SandboxPreviewUpdateFlags
- type SandboxProcessDescribeFlags
- type SandboxProcessList
- type SandboxProcessListFlags
- type SandboxProcessLogLine
- type SandboxProcessLogsFlags
- type SandboxProcessOptionFlags
- type SandboxProcessRefCommandFlags
- type SandboxProcessRefFlags
- type SandboxProcessStartFlags
- type SandboxProcessWaitFlags
- type SandboxRefFlags
- type SandboxUpdateFlags
- type SandboxVolumeCreateFlags
- type SandboxVolumeDeleteFlags
- type SandboxVolumeList
- type SandboxVolumeListFlags
- type SandboxVolumeRefCommandFlags
- type SandboxVolumeRefFlags
- type SandboxVolumeUpdateFlags
- type TrainCapacityDescribeFlags
- type TrainCapacityUpdateFlags
- type TrainCheckpointDeployFlags
- type TrainCheckpointFilesFlags
- type TrainCheckpointListFlags
- type TrainInitFlags
- type TrainJobDescribeFlags
- type TrainJobDownloadFlags
- type TrainJobDownloadResult
- type TrainJobListFlags
- type TrainJobLogsFlags
- type TrainJobMetricsFlags
- type TrainJobRecreateFlags
- type TrainJobRefFlags
- type TrainJobSessionDescribeFlags
- type TrainJobStopFlags
- type TrainJobUpdateFlags
- type TrainLogFlags
- type TrainProjectCacheDescribeFlags
- type TrainProjectListFlags
- type TrainPushFlags
- type TrainWorkstationCreateFlags
- type TrussAuthFlags
- type TrussDelegatedResult
- type TrussFlags
- type TrussPassthroughFlags
- type VersionFlags
- type VersionResult
- type VolumeCatFlags
- type VolumeEntry
- type VolumeEntryDetail
- type VolumeEntryList
- type VolumeHostingFlags
- type VolumeList
- type VolumeLsFlags
- type VolumeNamespaceList
- type VolumePullFlags
- type VolumePullResult
- type VolumePushFlags
- type VolumePushResult
- type VolumeRefFlags
- type VolumeRestoreFlags
- type VolumeRmFlags
- type VolumeStatFlags
- type VolumeSyncIDFlags
- type VolumeSyncList
- type VolumeSyncListFlags
- type VolumeSyncStartFlags
- type VolumeTagDeleteFlags
- type VolumeTagSetFlags
- type VolumeTransferFlags
- type VolumeUpdateFlags
- type VolumeVersionsFlags
- type WhoamiFlags
Constants ¶
const ( // DefaultFlagGroup is the group name applied to a flag with no `group:` tag. DefaultFlagGroup = "command" // DefaultFlagGroupPri is the rendering priority for a group whose flags // declare no `group-pri:` tag. DefaultFlagGroupPri = 100 // FlagAnnotationGroup names the pflag.Flag annotation key that carries the // declarative `group` tag onto the bound flag, where the help renderer reads it. FlagAnnotationGroup = "baseten/group" // FlagAnnotationGroupPri names the pflag.Flag annotation key that carries the // declarative `group-pri` tag onto the bound flag, where the help renderer reads it. FlagAnnotationGroupPri = "baseten/group-pri" )
Flag group defaults and pflag annotation keys.
const NullFlagValue = "null"
NullFlagValue is the literal a caller passes to a `nullable:"true"` flag to send an explicit null, clearing a setting rather than leaving it unchanged.
Variables ¶
var Root = Command{ Name: "baseten", Summary: "Baseten CLI", Description: "Command-line interface for managing Baseten resources.\n\n" + "Authentication is via 'baseten auth login' or the BASETEN_API_KEY environment variable.\n\n" + "The CLI never prompts interactively when stdin is not a terminal; commands that need " + "input must be supplied via flags or stdin redirection or they fail fast.", Children: []Command{ commandAPI, commandAuth, commandGrid, commandLoops, commandModel, commandModelAPI, commandOrg, commandSandbox, commandSSH, commandTrain, commandTruss, commandVersion, commandVolume, commandWhoami, }, }
Root is the top-level baseten command.
Functions ¶
func ErrorTypeName ¶ added in v1.0.0
func ErrorTypeName(err CommandError) string
ErrorTypeName returns the name of a CommandError's concrete type: the value carried in JSONError.Type, and the name listed alongside the exit code in the --help-output exit-code tables.
Types ¶
type APIFlags ¶
type APIFlags struct {
CommandFlags
Method string `flag:"method" short:"X" desc:"HTTP method, defaults to GET or POST if fields are provided"`
Field []string `flag:"field" short:"F" desc:"Add a string field (key=value), parsed as JSON value"`
RawField []string `flag:"raw-field" short:"f" desc:"Add a raw string field (key=value)"`
Header []string `flag:"header" short:"H" desc:"Add a request header (key:value)"`
Input string `flag:"input" desc:"Read request body from file (use - for stdin)"`
}
APIFlags are shared flags for raw API commands.
type APIInferenceFlags ¶
type APIInferenceFlags struct {
APIFlags
InferenceClientFlags
}
type APIManagementFlags ¶
type APIManagementFlags struct {
APIFlags
}
type APISandboxFlags ¶ added in v1.2.0
type AuditLogFlags ¶ added in v0.4.0
type AuditLogFlags struct {
Start time.Time `` /* 258-byte string literal not displayed */
End time.Time `` /* 152-byte string literal not displayed */
Since time.Duration `` /* 184-byte string literal not displayed */
Limit int `` /* 135-byte string literal not displayed */
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages without a full page of entries.
PageSize int `flag:"page-size" hidden:"true" desc:"Entries fetched per backend request while paging." default:"200"`
Direction string `` /* 145-byte string literal not displayed */
Search string `flag:"search" desc:"Case-insensitive substring matched against resource names and IDs in the entry."`
EventTypeGroups []string `` /* 364-byte string literal not displayed */
Sources []string `flag:"source" desc:"Only return entries issued from one of these surfaces. May be repeated. One of: ui, api, mcp, other."`
UserIDs []string `flag:"user-id" desc:"Only return entries whose acting user is one of these IDs. May be repeated."`
DeploymentIDs []string `flag:"deployment-id" desc:"Only return entries referencing one of these model deployment IDs. May be repeated."`
Environments []string `flag:"environment" desc:"Only return entries for one of these environments. May be repeated."`
}
AuditLogFlags is the shared query flag set for `baseten org audit-logs` and `baseten model audit-logs`. Both commands accept the same window, filter, and paging flags; only the audit-log scope differs. Unlike the log-query flags, there is no time-window default (the full history is queried) and no maximum window: results are bounded by --limit.
type AuthConfigDescribeFlags ¶ added in v1.8.0
type AuthConfigDescribeFlags struct {
CommandFlags
}
AuthConfigDescribeFlags are the flags for baseten auth config describe.
type AuthConfigResult ¶ added in v1.8.0
type AuthConfigResult struct {
RequireExplicitProfile bool `json:"require_explicit_profile"`
}
AuthConfigResult is the JSON output of `baseten auth config describe` and `baseten auth config update`.
type AuthConfigUpdateFlags ¶ added in v1.8.0
type AuthConfigUpdateFlags struct {
CommandFlags
RequireExplicitProfile bool `flag:"require-explicit-profile" desc:"Require every command to select a profile instead of using the current profile"`
}
AuthConfigUpdateFlags are the flags for baseten auth config update.
type AuthListFlags ¶ added in v1.4.0
type AuthListFlags struct {
CommandFlags
}
AuthListFlags are the flags for baseten auth list.
type AuthListProfile ¶ added in v1.4.0
type AuthListProfile struct {
Profile string `json:"profile"`
RemoteURL string `json:"remote_url"`
AuthType string `json:"auth_type"`
Current bool `json:"current"`
}
AuthListProfile is a single stored profile in `baseten auth list` output.
type AuthListResult ¶ added in v1.4.0
type AuthListResult struct {
Profiles []AuthListProfile `json:"profiles"`
}
AuthListResult is the JSON output of `baseten auth list`.
type AuthLoginFlags ¶
type AuthLoginFlags struct {
CommandFlags
Web bool `flag:"web" desc:"Use browser login without interactive prompts"`
WithAPIKey bool `flag:"with-api-key" desc:"Read API key from stdin"`
RemoteURL string `flag:"remote-url" desc:"Baseten remote URL for this profile (default https://app.baseten.co)"`
NoSwitch bool `flag:"no-switch" desc:"Store the profile without making it the current profile"`
InsecureStorage bool `flag:"insecure-storage" desc:"Store credentials in plain text instead of system keyring"`
}
AuthLoginFlags are the flags for baseten auth login.
type AuthLoginResult ¶
type AuthLoginResult struct {
Profile string `json:"profile"`
UserID string `json:"user_id"`
Email string `json:"email"`
Name string `json:"name"`
WorkspaceName string `json:"workspace_name"`
}
AuthLoginResult is the JSON output of `baseten auth login`.
type AuthLogoutFlags ¶
type AuthLogoutFlags struct {
CommandFlags
}
AuthLogoutFlags are the flags for baseten auth logout.
type AuthLogoutResult ¶
type AuthLogoutResult struct {
Profile string `json:"profile"`
}
AuthLogoutResult is the JSON output of `baseten auth logout`.
type AuthStatusFlags ¶
type AuthStatusFlags struct {
CommandFlags
}
AuthStatusFlags are the flags for baseten auth status.
type AuthStatusResult ¶
type AuthStatusResult struct {
Profile string `json:"profile"`
RemoteURL string `json:"remote_url"`
AuthType string `json:"auth_type"`
RequireExplicitProfile bool `json:"require_explicit_profile"`
}
AuthStatusResult is the JSON output of `baseten auth status`.
type AuthSwitchFlags ¶
type AuthSwitchFlags struct {
CommandFlags
}
AuthSwitchFlags are the flags for baseten auth switch.
type AuthSwitchResult ¶
type AuthSwitchResult struct {
Profile string `json:"profile"`
}
AuthSwitchResult is the JSON output of `baseten auth switch`.
type AutoscalingScheduleTimingFlags ¶ added in v0.4.0
type AutoscalingScheduleTimingFlags struct {
Enabled OptionalFlag[bool] `flag:"enabled" desc:"Whether the schedule is enabled. Defaults to true on create."`
Weekdays []string `` /* 157-byte string literal not displayed */
StartHour OptionalFlag[int] `` /* 151-byte string literal not displayed */
StartMinute OptionalFlag[int] `flag:"start-minute" desc:"Minute the window opens. Recurring schedules only."`
EndHour OptionalFlag[int] `` /* 150-byte string literal not displayed */
EndMinute OptionalFlag[int] `flag:"end-minute" desc:"Minute the window closes. Recurring schedules only."`
StartAt time.Time `` /* 211-byte string literal not displayed */
EndAt time.Time `flag:"end-at" desc:"Exclusive end of the window, ISO 8601. One-time schedules only."`
}
AutoscalingScheduleTimingFlags describes when a schedule is active. Which flags apply depends on the schedule's cadence: recurring schedules use weekdays and a clock window, one-time schedules use an absolute interval.
type AutoscalingSettingsFlags ¶ added in v0.4.0
type AutoscalingSettingsFlags struct {
MinReplica OptionalFlag[int] `flag:"min-replica" desc:"Minimum number of replicas." group:"autoscaling" group-pri:"200"`
MaxReplica OptionalFlag[int] `flag:"max-replica" desc:"Maximum number of replicas." group:"autoscaling"`
AutoscalingWindow OptionalFlag[int] `flag:"autoscaling-window" desc:"Timeframe of traffic considered for autoscaling decisions, in seconds." group:"autoscaling"`
ScaleDownDelay OptionalFlag[int] `flag:"scale-down-delay" desc:"Waiting period before scaling down any active replica, in seconds." group:"autoscaling"`
ConcurrencyTarget OptionalFlag[int] `flag:"concurrency-target" desc:"Number of requests per replica before scaling up." group:"autoscaling"`
TargetUtilizationPercentage OptionalFlag[int] `flag:"target-utilization-percentage" desc:"Target utilization percentage for scaling up and down." group:"autoscaling"`
TargetInFlightTokens OptionalFlag[int] `` /* 137-byte string literal not displayed */
MaxScaleDownRate OptionalFlag[int] `` /* 205-byte string literal not displayed */
}
AutoscalingSettingsFlags is the shared autoscaling flag set for `baseten model deployment update-autoscaling` and its environment twin. Each field is a pointer because the settings endpoints patch only what the request body carries: a nil field means the flag was never passed, so that setting is left unchanged rather than reset.
type Command ¶
type Command struct {
Name string
Summary string
Description string
Flags any // nil, or struct value with flag tags
Children []Command
// ArgsUsage is appended to the command name in help output (e.g. "[path]").
ArgsUsage string
// ExactArgs requires exactly this many positional arguments. Mutually
// exclusive with MaxArgs.
ExactArgs int
// MaxArgs is the maximum number of positional arguments. 0 means no args
// (the default), -1 means unlimited. Mutually exclusive with ExactArgs.
MaxArgs int
// DisableFlagParsing disables all flag parsing; everything after the command
// name is passed as raw args. MaxArgs is ignored and assumed -1.
DisableFlagParsing bool
// Output declares the leaf command's stdout shape, text-mode behavior, and
// examples. Required on every leaf (a command with no Children); must be
// nil on commands with Children. Typically a *[CommandOutput][T].
Output CommandOutputSpec
// Errors lists command-declared typed errors. Each entry is built via
// [ErrorDescOf] and documents one extra exit code surfaced by this leaf
// beyond the standard set. Rendered in --help-output.
Errors []ErrorDesc
// Hidden keeps the command out of help listings and completion. The command
// is still fully runnable.
Hidden bool
}
Command defines a CLI command declaratively. The tree structure is built via Children. Flags is a struct value whose fields use struct tags to define CLI flags.
func (Command) LoadFlags ¶
func (c Command) LoadFlags() []CommandFlag
LoadFlags parses the Flags struct tags and returns the flag metadata. Returns nil if Flags is nil.
type CommandError ¶
CommandError is implemented by typed errors a command may return. The framework calls errors.As on the returned error to discover a CommandError implementation and uses its ExitCode and [Meaning] to classify the failure and populate the JSONErrorEnvelope.
Implementations should embed CommandErrorMeta for the underlying error/unwrap plumbing and provide static ExitCode and [Meaning] on a pointer receiver so they can be queried without an instance.
func WrapHTTPStatus ¶
func WrapHTTPStatus(status int, err error) CommandError
WrapHTTPStatus picks the appropriate standard typed error for an HTTP status code and wraps the underlying error. Status → error: 401/403 → ErrAuth, 404 → ErrNotFound, other 4xx → ErrValidation, 5xx → ErrServer, anything else → ErrGeneric.
type CommandErrorMeta ¶
type CommandErrorMeta struct {
// contains filtered or unexported fields
}
CommandErrorMeta is embedded by typed CommandError implementations to supply [error.Error] and errors.Unwrap. Construct via NewCommandErrorMeta.
func NewCommandErrorMeta ¶
func NewCommandErrorMeta(msg string, wrapped error) CommandErrorMeta
NewCommandErrorMeta builds a meta with the formatted message and optional wrapped error.
func (*CommandErrorMeta) Error ¶
func (m *CommandErrorMeta) Error() string
func (*CommandErrorMeta) Unwrap ¶
func (m *CommandErrorMeta) Unwrap() error
type CommandExample ¶
type CommandExample struct {
// Description is a one-line "what this does" preceding the command.
Description string
// Command is a literal shell line beginning with "baseten ...".
Command string
// CommandLines is Command split over multiple lines for an invocation too
// long to render on one. Help joins them with a trailing backslash and
// indents the continuations, so write each line without either. Break at
// argument boundaries the reader would choose, never inside a quoted
// argument.
CommandLines []string
}
CommandExample documents one usage of a command. Exactly one of Command or CommandLines carries the invocation.
func (CommandExample) CommandString ¶ added in v1.0.0
func (e CommandExample) CommandString() string
CommandString returns the example as a single shell line, whichever field it was declared in. Empty when the example is unset.
type CommandFlag ¶
type CommandFlag struct {
Name string
Short string
Desc string
Default string
Enum []string
Required bool
Hidden bool // omitted from help output; still parsed and settable
Oneof string // group name: exactly one flag in the group must be set
// Nullable allows an [OptionalFlag] to be passed as 'null'.
Nullable bool
Type reflect.Type
FieldName string // Go struct field name
// Group is the help-output flag-section bucket. Empty in raw metadata; the
// loader fills in [DefaultFlagGroup] when no `group:` tag is set.
Group string
// GroupPri is the rendering priority declared via `group-pri:`. 0 means
// "unset on this field". The whole group resolves to [DefaultFlagGroupPri]
// when no field in the group declares one. Lower values render earlier.
GroupPri int
}
CommandFlag describes a single CLI flag parsed from struct tags.
func LoadFlagsFromType ¶
func LoadFlagsFromType(t reflect.Type) []CommandFlag
LoadFlagsFromType parses flag metadata from a struct type's tags.
type CommandFlags ¶
type CommandFlags struct {
Verbose bool `flag:"verbose" short:"v" desc:"Enable verbose logging" group:"common" group-pri:"500"`
Output string `flag:"output" short:"o" desc:"Output format" default:"text" enum:"text,json,jsonl,none" group:"common"`
JQ string `` /* 137-byte string literal not displayed */
Profile string `` /* 135-byte string literal not displayed */
}
CommandFlags are shared flags that every command must embed, either directly or via another struct that embeds it.
type CommandOutput ¶
type CommandOutput[JSONT any] struct { // TextDescription describes the --output text format. Free-form prose. TextDescription string // JSONDescription is optional prose describing the --output json shape // beyond what the JSON schema already conveys (e.g. how status fields // behave, what --dry-run emits). Free-form. // // A command declaring JSONAlternatives says here when JSONT itself // applies, since only the alternatives carry that with them. JSONDescription string // Examples documents how to invoke the command. At least one required. Examples []CommandExample // JQExample is a required example that uses --jq. Surfaced separately so // every command guarantees a JQ-using example for agents to copy. // Optional on commands with DisableFlagParsing, since --jq is not honored // when the framework does not parse flags. JQExample CommandExample // JSONArrayStreamed indicates the command streams JSONT records: under // --output json the records are wrapped in a JSON array, under // --output jsonl one record per line, and --jq applies per record. JSONArrayStreamed bool // JSONOutputUnimportant marks a command that produces no meaningful JSON // stdout payload (e.g. a long-running watcher that streams status to // stderr). Such a command is exempt from the JQExample requirement, and // --help-output omits the JSON schema block for it. JSONOutputUnimportant bool // JSONAlternatives declares the stdout shapes this command produces // besides JSONT, for a command whose answer changes shape with its input. // See [CommandOutputAlternative]. JSONAlternatives []CommandOutputAlternative }
CommandOutput declaratively documents a leaf command's output. JSONT is the Go type produced on stdout under --output json (and --output jsonl, one JSONT per line). JSONT is also rendered as a JSON schema in --help-output.
func (*CommandOutput[JSONT]) ExampleList ¶
func (o *CommandOutput[JSONT]) ExampleList() []CommandExample
func (*CommandOutput[JSONT]) JQ ¶
func (o *CommandOutput[JSONT]) JQ() CommandExample
func (*CommandOutput[JSONT]) JSON ¶
func (o *CommandOutput[JSONT]) JSON() string
func (*CommandOutput[JSONT]) JSONAlternativeList ¶ added in v1.0.0
func (o *CommandOutput[JSONT]) JSONAlternativeList() []CommandOutputAlternative
func (*CommandOutput[JSONT]) JSONArrayStreamedBool ¶
func (o *CommandOutput[JSONT]) JSONArrayStreamedBool() bool
func (*CommandOutput[JSONT]) JSONOutputType ¶
func (*CommandOutput[JSONT]) JSONOutputType() reflect.Type
func (*CommandOutput[JSONT]) JSONOutputUnimportantBool ¶ added in v0.2.0
func (o *CommandOutput[JSONT]) JSONOutputUnimportantBool() bool
func (*CommandOutput[JSONT]) Text ¶
func (o *CommandOutput[JSONT]) Text() string
type CommandOutputAlternative ¶ added in v1.0.0
type CommandOutputAlternative struct {
// When completes "when the ...", naming the input that produces this
// shape: "ref names a namespace", "ref carries a path".
When string
// Type is the Go type of the payload, as [CommandOutput.JSONOutputType] is
// for the primary shape.
Type reflect.Type
}
CommandOutputAlternative is one of the several stdout shapes a command can produce, together with the input that selects it.
A command needs these when what it was asked for decides the shape of the answer rather than only its contents: `volume ls` returns namespaces, volumes, or file entries depending on how much of a ref it was given, and those are three different objects, not one object with optional fields. Declaring them keeps --help-output honest about all of them; use JSONAlternativeFor to build one.
func JSONAlternativeFor ¶ added in v1.0.0
func JSONAlternativeFor[T any](when string) CommandOutputAlternative
JSONAlternativeFor builds a CommandOutputAlternative for T.
type CommandOutputSpec ¶
type CommandOutputSpec interface {
// JSONOutputType returns the Go type of the stdout payload under
// --output json, used for JSON schema generation and documentation.
JSONOutputType() reflect.Type
// Text describes the human-readable (--output text) output. Free-form
// prose; surfaced via --help-output.
Text() string
// JSON describes the --output json shape beyond what the JSON schema
// already conveys (special cases, status semantics, etc.). May be empty.
JSON() string
// ExampleList returns the declared usage examples. Every leaf must
// declare at least one.
ExampleList() []CommandExample
// JQ returns the required example invoking --jq.
JQ() CommandExample
// JSONArrayStreamedBool reports whether the command streams JSONT records:
// --output json wraps them in a JSON array, --output jsonl emits one
// record per line, and --jq applies per record.
JSONArrayStreamedBool() bool
// JSONOutputUnimportantBool reports whether the command produces no
// meaningful JSON stdout payload (so --jq is not useful and no JQ example
// is required).
JSONOutputUnimportantBool() bool
// JSONAlternativeList returns the stdout shapes the command produces
// besides JSONOutputType, each with the input that selects it. Empty for a
// command with one fixed shape, which is nearly all of them.
JSONAlternativeList() []CommandOutputAlternative
}
CommandOutputSpec is the type-erased view of a leaf command's CommandOutput. Every leaf Command must declare an Output value implementing this interface (concretely a *CommandOutput[JSONT] for some T).
type ErrAuth ¶
type ErrAuth struct{ CommandErrorMeta }
ErrAuth signals an authentication or authorization failure (typically HTTP 401/403). Surfaces ExitAuth.
type ErrGeneric ¶
type ErrGeneric struct{ CommandErrorMeta }
ErrGeneric is the catch-all typed error for failures with no more specific classification. Surfaces ExitGeneric.
func NewErrGeneric ¶
func NewErrGeneric(err error) *ErrGeneric
NewErrGeneric wraps any error as an ErrGeneric. Returns nil if err is nil.
func (*ErrGeneric) ExitCode ¶
func (*ErrGeneric) ExitCode() ExitCode
func (*ErrGeneric) Meaning ¶
func (*ErrGeneric) Meaning() string
type ErrInterrupted ¶ added in v1.0.0
type ErrInterrupted struct{ CommandErrorMeta }
ErrInterrupted signals that the command's context was cancelled by a signal (Ctrl-C / SIGTERM) rather than failing on its own. Surfaces ExitInterrupted.
func NewErrInterrupted ¶ added in v1.0.0
func NewErrInterrupted(err error) *ErrInterrupted
NewErrInterrupted wraps any error as an ErrInterrupted.
func (*ErrInterrupted) ExitCode ¶ added in v1.0.0
func (*ErrInterrupted) ExitCode() ExitCode
func (*ErrInterrupted) Meaning ¶ added in v1.0.0
func (*ErrInterrupted) Meaning() string
type ErrNotFound ¶
type ErrNotFound struct{ CommandErrorMeta }
ErrNotFound signals that a referenced resource does not exist (typically HTTP 404). Surfaces ExitNotFound.
func NewErrNotFound ¶
func NewErrNotFound(err error) *ErrNotFound
NewErrNotFound wraps any error as an ErrNotFound.
func (*ErrNotFound) ExitCode ¶
func (*ErrNotFound) ExitCode() ExitCode
func (*ErrNotFound) Meaning ¶
func (*ErrNotFound) Meaning() string
type ErrServer ¶
type ErrServer struct{ CommandErrorMeta }
ErrServer signals a server-side failure (typically HTTP 5xx). Surfaces ExitServer.
func NewErrServer ¶
NewErrServer wraps any error as an ErrServer.
type ErrUsage ¶
type ErrUsage struct{ CommandErrorMeta }
ErrUsage signals invalid command invocation (bad flags, missing required input, mutually exclusive options). Surfaces ExitUsage and tells the framework to display the command's usage line alongside the error.
func NewErrUsage ¶
NewErrUsage wraps any error as an ErrUsage.
func NewErrUsagef ¶
NewErrUsagef builds an ErrUsage from a fmt.Errorf-style format string. Supports %w to wrap an underlying error.
type ErrValidation ¶
type ErrValidation struct{ CommandErrorMeta }
ErrValidation signals a request rejected by server-side validation (typically HTTP 4xx other than 401/403/404). Surfaces ExitValidation.
func NewErrValidation ¶
func NewErrValidation(err error) *ErrValidation
NewErrValidation wraps any error as an ErrValidation.
func (*ErrValidation) ExitCode ¶
func (*ErrValidation) ExitCode() ExitCode
func (*ErrValidation) Meaning ¶
func (*ErrValidation) Meaning() string
type ErrorDesc ¶
ErrorDesc documents one command-declared error: its Go type name, the ExitCode it surfaces, and the static CommandError.Meaning. Listed in Command.Errors and rendered in --help-output.
func ErrorDescOf ¶
func ErrorDescOf[PT CommandError]() ErrorDesc
ErrorDescOf builds an ErrorDesc from a typed command error. Call as ErrorDescOf[*ErrFoo](). Panics if the error reports ExitCode == 0 (success), which is meaningless for an error.
func StandardErrors ¶
func StandardErrors() []ErrorDesc
StandardErrors enumerates the framework-provided typed [CommandError]s in the order the root command's --help-output should render them. Each leaf command inherits these implicitly; per-leaf Command.Errors only lists errors *beyond* this standard set.
type ExitCode ¶
type ExitCode int
ExitCode is the process exit code the CLI returns. The standard set below is what the framework emits automatically; commands may declare additional codes by implementing CommandError on a typed error and listing it in Command.Errors. The enum is open: codes beyond ExitServer are reserved for command-declared errors.
const ( ExitSuccess ExitCode = 0 ExitGeneric ExitCode = 1 ExitUsage ExitCode = 2 ExitAuth ExitCode = 3 ExitNotFound ExitCode = 4 ExitValidation ExitCode = 5 ExitServer ExitCode = 6 // ExitInterrupted is returned when the command's context is cancelled // (Ctrl-C / SIGTERM). 128 + SIGINT(2), the conventional shell convention. ExitInterrupted ExitCode = 130 )
type GridClaudeServedModelFlags ¶ added in v1.7.0
type GridClaudeServedModelFlags struct {
CommandFlags
IntelligentRoute []string `` /* 239-byte string literal not displayed */
// Router is the pre-rename spelling, kept for status lines and hooks older builds wrote.
Router []string `flag:"router" hidden:"true" desc:"Deprecated spelling of --intelligent-route."`
Hook bool `` /* 186-byte string literal not displayed */
Wait time.Duration `` /* 130-byte string literal not displayed */
}
type GridConnectionConfigFlags ¶ added in v1.5.0
type GridConnectionCreateFlags ¶ added in v1.5.0
type GridConnectionCreateFlags struct {
CommandFlags
GridTeamFlags
GridConnectionConfigFlags
}
type GridConnectionDeleteFlags ¶ added in v1.5.0
type GridConnectionDeleteFlags struct {
CommandFlags
ID string `flag:"id" desc:"Connection ID." required:"true"`
Yes bool `flag:"yes" desc:"Skip confirmation; required when stdin is not a terminal."`
}
type GridConnectionDescribeFlags ¶ added in v1.7.0
type GridConnectionDescribeFlags struct {
CommandFlags
ID string `flag:"id" desc:"Connection ID." required:"true"`
}
type GridConnectionList ¶ added in v1.5.0
type GridConnectionList struct {
Items []managementapi.GridConnection `json:"items"`
}
type GridConnectionListFlags ¶ added in v1.5.0
type GridConnectionListFlags struct {
CommandFlags
GridTeamListFlags
}
type GridConnectionUpdateFlags ¶ added in v1.5.0
type GridConnectionUpdateFlags struct {
CommandFlags
GridConnectionConfigFlags
ID string `flag:"id" desc:"Connection ID." required:"true"`
}
type GridHarnessFlags ¶ added in v1.5.0
type GridHarnessFlags struct {
Harness []string `flag:"harness" desc:"Harness to apply to. May be repeated." enum:"claude,codex,opencode,pi"`
ConfigDir string `` /* 129-byte string literal not displayed */
}
GridHarnessFlags selects the harnesses a command applies to.
type GridHarnessInstall ¶ added in v1.5.0
type GridHarnessInstall struct {
// Kind is "CLI" or "Desktop".
Kind string `json:"kind"`
Binary string `json:"binary"`
Version string `json:"version"`
}
GridHarnessInstall is one copy of a harness found on this machine.
type GridHarnessRoute ¶ added in v1.5.0
GridHarnessRoute is a route configured in a harness.
type GridHarnessStatus ¶ added in v1.5.0
type GridHarnessStatus struct {
Harness string `json:"harness"`
Config string `json:"config"`
Installed bool `json:"installed"`
// Installs lists every copy of the harness found, the one on PATH first.
// They all share the configuration file at Config.
Installs []GridHarnessInstall `json:"installs,omitempty"`
State string `json:"state"`
DefaultRoute string `json:"default_route,omitempty"`
BackgroundRoute string `json:"background_route,omitempty"`
Routes []GridHarnessRoute `json:"routes,omitempty"`
ManagedSettings []string `json:"managed_settings,omitempty"`
NameColumnOverride *string `json:"-"`
}
GridHarnessStatus is the local integration state of one harness.
type GridMachineUserAPIKeyCreateFlags ¶ added in v1.7.0
type GridMachineUserAPIKeyCreateFlags struct {
CommandFlags
GridMachineUserKeyOwnerFlags
Name string `flag:"name" desc:"Name of the API key."`
}
type GridMachineUserAPIKeyDeleteFlags ¶ added in v1.7.0
type GridMachineUserAPIKeyDeleteFlags struct {
CommandFlags
GridMachineUserKeyOwnerFlags
Name string `flag:"name" desc:"Name of the API key to delete." oneof:"identifier"`
Prefix string `flag:"prefix" desc:"Prefix of the API key to delete (as shown in list)." oneof:"identifier"`
}
type GridMachineUserAPIKeyListFlags ¶ added in v1.7.0
type GridMachineUserAPIKeyListFlags struct {
CommandFlags
GridMachineUserKeyOwnerFlags
}
type GridMachineUserCreateFlags ¶ added in v1.7.0
type GridMachineUserCreateFlags struct {
CommandFlags
GridTeamFlags
Name string `flag:"name" desc:"Name of the machine user, unique within the team." required:"true"`
APIKeyName string `flag:"api-key-name" desc:"Name of the first API key. Cannot be combined with --no-api-key."`
NoAPIKey bool `flag:"no-api-key" desc:"Create the machine user without an API key."`
}
type GridMachineUserDeleteFlags ¶ added in v1.7.0
type GridMachineUserDeleteFlags struct {
CommandFlags
GridMachineUserIDFlags
Yes bool `flag:"yes" desc:"Skip confirmation; required when stdin is not a terminal."`
}
type GridMachineUserDescribeFlags ¶ added in v1.7.0
type GridMachineUserDescribeFlags struct {
CommandFlags
GridMachineUserIDFlags
}
type GridMachineUserIDFlags ¶ added in v1.7.0
type GridMachineUserIDFlags struct {
ID string `flag:"id" desc:"Machine user ID." required:"true"`
}
type GridMachineUserKeyOwnerFlags ¶ added in v1.7.0
type GridMachineUserKeyOwnerFlags struct {
MachineUserID string `flag:"machine-user-id" desc:"Machine user ID." required:"true"`
}
type GridMachineUserList ¶ added in v1.7.0
type GridMachineUserList struct {
Items []managementapi.GridMachineUser `json:"items"`
}
type GridMachineUserListFlags ¶ added in v1.7.0
type GridMachineUserListFlags struct {
CommandFlags
GridTeamListFlags
}
type GridMachineUserUpdateFlags ¶ added in v1.7.0
type GridMachineUserUpdateFlags struct {
CommandFlags
GridMachineUserIDFlags
NewName string `flag:"new-name" desc:"New name for the machine user, unique within the team." required:"true"`
}
type GridPlan ¶ added in v1.5.0
type GridPlan struct {
Harness string `json:"harness"`
Config string `json:"config"`
Settings []string `json:"settings"`
ReplacedSettings []string `json:"replaced_settings,omitempty"`
Managed bool `json:"managed"`
Changed bool `json:"changed"`
}
GridPlan is one configuration file that setup or teardown changes. Credentials are never included.
type GridPlanList ¶ added in v1.5.0
type GridPlanList struct {
Items []GridPlan `json:"items"`
// DeletedAPIKeys lists the prefixes of Grid API keys setup or teardown deleted.
DeletedAPIKeys []string `json:"deleted_api_keys,omitempty"`
}
GridPlanList is the JSON output of `baseten grid setup` and `baseten grid teardown`.
type GridRouteClassifierDescribeFlags ¶ added in v1.8.0
type GridRouteClassifierDescribeFlags struct {
CommandFlags
ID string `flag:"id" desc:"Route classifier ID." required:"true"`
}
type GridRouteClassifierList ¶ added in v1.8.0
type GridRouteClassifierList struct {
Items []managementapi.GridRouteClassifier `json:"items"`
}
type GridRouteClassifierListFlags ¶ added in v1.8.0
type GridRouteClassifierListFlags struct{ CommandFlags }
type GridRouteCreateFlags ¶ added in v1.5.0
type GridRouteCreateFlags struct {
CommandFlags
GridRouteTargetFlags
Team string `` /* 163-byte string literal not displayed */
DisplayName OptionalFlag[string] `flag:"display-name" desc:"Display name (1 to 255 characters). Defaults to the route name."`
Description OptionalFlag[string] `flag:"description" desc:"Optional route description (up to 1000 characters)."`
}
type GridRouteDeleteFlags ¶ added in v1.5.0
type GridRouteDeleteFlags struct {
CommandFlags
GridRouteRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
type GridRouteDescribeFlags ¶ added in v1.5.0
type GridRouteDescribeFlags struct {
CommandFlags
GridRouteRefFlags
}
type GridRouteList ¶ added in v1.5.0
type GridRouteList struct {
Items []managementapi.GridRoute `json:"items"`
}
GridRouteList contains the routes aggregated across all pages.
type GridRouteListFlags ¶ added in v1.5.0
type GridRouteListFlags struct {
CommandFlags
Team string `` /* 137-byte string literal not displayed */
}
type GridRouteRefFlags ¶ added in v1.5.0
type GridRouteTargetFlags ¶ added in v1.5.0
type GridRouteTargetFlags struct {
TargetType string `flag:"target-type" desc:"Target type." enum:"baseten-model-api,connection,intelligent" required:"true"`
TargetModel string `` /* 135-byte string literal not displayed */
TargetConnection string `` /* 147-byte string literal not displayed */
RouteClassifierID string `` /* 188-byte string literal not displayed */
Tradeoff string `` /* 151-byte string literal not displayed */
}
type GridRouteUpdateFlags ¶ added in v1.5.0
type GridRouteUpdateFlags struct {
CommandFlags
GridRouteRefFlags
DisplayName OptionalFlag[string] `flag:"display-name" desc:"New display name (1 to 255 characters). Omit to keep it unchanged."`
Description OptionalFlag[string] `flag:"description" desc:"New description (up to 1000 characters). Pass an empty string to clear it."`
}
type GridRouteUsageFlags ¶ added in v1.5.0
type GridRouteUsageFlags struct {
CommandFlags
Team string `flag:"team" desc:"Team name or ID to filter usage by. Without it, returns your authorized usage across teams."`
Start time.Time `` /* 156-byte string literal not displayed */
End time.Time `` /* 144-byte string literal not displayed */
Since time.Duration `flag:"since" desc:"Window from a relative time ago until now (e.g. '7d'). Mutually exclusive with --start and --end."`
UserIDs []string `` /* 135-byte string literal not displayed */
GridRouteUsageQueryFlags
}
GridRouteUsageFlags are the flags for `baseten grid route usage`.
type GridRouteUsageQueryFlags ¶ added in v1.5.0
type GridRouteUsageQueryFlags struct {
GroupBy []string `` /* 147-byte string literal not displayed */
Models []string `flag:"model" desc:"Only return usage for these models. May be repeated."`
Providers []string `` /* 149-byte string literal not displayed */
Harnesses []string `` /* 162-byte string literal not displayed */
Limit int `flag:"limit" desc:"Maximum number of daily buckets, paging as needed. 0 for no limit."`
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages. Zero uses the backend's maximum.
PageSize int `flag:"page-size" hidden:"true" desc:"Daily buckets fetched per backend request while paging."`
}
GridRouteUsageQueryFlags are the usage filters and paging flags of `baseten grid route usage`.
type GridSetupFlags ¶ added in v1.5.0
type GridSetupFlags struct {
CommandFlags
GridHarnessFlags
Team string `` /* 204-byte string literal not displayed */
KeyName string `` /* 126-byte string literal not displayed */
PrimaryRouteID string `` /* 136-byte string literal not displayed */
BackgroundRouteID string `` /* 189-byte string literal not displayed */
SubagentRouteID string `flag:"subagent-route-id" desc:"Route ID for subagents (Claude Code and OpenCode). Defaults to the harness's own setting."`
FallbackRouteID string `` /* 134-byte string literal not displayed */
HideServedModel bool `` /* 317-byte string literal not displayed */
GitContext bool `` /* 232-byte string literal not displayed */
ClaudeExtendedPromptCache bool `` /* 277-byte string literal not displayed */
KeepChatGPTLogin bool `` /* 249-byte string literal not displayed */
UseSessionCredential bool `` /* 263-byte string literal not displayed */
DryRun bool `flag:"dry-run" desc:"Show the changes without applying them or creating an API key."`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
GridSetupFlags are the flags for `baseten grid setup`.
type GridStatusFlags ¶ added in v1.5.0
type GridStatusFlags struct {
CommandFlags
GridHarnessFlags
}
GridStatusFlags are the flags for `baseten grid status`.
type GridStatusList ¶ added in v1.5.0
type GridStatusList struct {
Items []GridHarnessStatus `json:"items"`
}
GridStatusList is the JSON output of `baseten grid status`.
type GridSyncFlags ¶ added in v1.5.0
type GridSyncFlags struct {
CommandFlags
HideServedModel bool `` /* 317-byte string literal not displayed */
GitContext bool `` /* 217-byte string literal not displayed */
ClaudeExtendedPromptCache bool `` /* 262-byte string literal not displayed */
DryRun bool `flag:"dry-run" desc:"Show the changes without applying them or creating an API key."`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
GridSyncFlags are the flags for `baseten grid sync`.
type GridTeamFlags ¶ added in v1.5.0
type GridTeamFlags struct {
Team string `flag:"team" desc:"Team name or ID. Omit to use your only team; required when you belong to several."`
}
type GridTeamListFlags ¶ added in v1.5.0
type GridTeamListFlags struct {
Team string `flag:"team" desc:"Team name or ID. Omit to list across all accessible teams."`
}
type GridTeamSettingsDescribeFlags ¶ added in v1.5.0
type GridTeamSettingsDescribeFlags struct {
CommandFlags
GridTeamFlags
}
type GridTeamSettingsUpdateFlags ¶ added in v1.5.0
type GridTeamSettingsUpdateFlags struct {
CommandFlags
GridTeamFlags
Harness string `flag:"harness" desc:"Harness whose default route IDs to update." enum:"claude,codex,opencode,pi"`
PrimaryRouteID OptionalFlag[string] `flag:"primary-route-id" desc:"Primary route ID; null clears the configured default. Requires --harness." nullable:"true"`
BackgroundRouteID OptionalFlag[string] `` /* 134-byte string literal not displayed */
ClearHarnessDefaults bool `flag:"clear-harness-defaults" desc:"Clear all configured harness defaults. Cannot be combined with --harness or route flags."`
ClearSpendLimit bool `` /* 179-byte string literal not displayed */
PerMemberMonthlyLimitUSD OptionalFlag[string] `flag:"per-member-monthly-limit-usd" desc:"Default monthly USD limit per member; null removes it." nullable:"true"`
TeamWideMonthlyLimitUSD OptionalFlag[string] `` /* 132-byte string literal not displayed */
}
type GridTeardownFlags ¶ added in v1.5.0
type GridTeardownFlags struct {
CommandFlags
GridHarnessFlags
DryRun bool `flag:"dry-run" desc:"Preview removal without changing files."`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
GridTeardownFlags are the flags for `baseten grid teardown`.
type GridTokenFlags ¶ added in v1.7.0
type GridTokenFlags struct {
CommandFlags
Harness string `` /* 233-byte string literal not displayed */
Team string `flag:"team" desc:"Team name or ID the token is for. Defaults to the team the harness was set up with."`
}
GridTokenFlags are the flags for `baseten grid token`.
type GridUserSettingsDescribeFlags ¶ added in v1.5.0
type GridUserSettingsDescribeFlags struct {
CommandFlags
GridTeamFlags
GridUserSettingsUserFlags
}
type GridUserSettingsList ¶ added in v1.5.0
type GridUserSettingsList struct {
Items []managementapi.GridTeamUserSettings `json:"items"`
}
type GridUserSettingsListFlags ¶ added in v1.5.0
type GridUserSettingsListFlags struct {
CommandFlags
GridTeamListFlags
}
type GridUserSettingsUpdateFlags ¶ added in v1.5.0
type GridUserSettingsUpdateFlags struct {
CommandFlags
GridTeamFlags
GridUserSettingsUserFlags
UserMonthlyLimitUSD OptionalFlag[string] `flag:"user-monthly-limit-usd" desc:"Standing monthly USD limit for this user in the team; null removes it." nullable:"true"`
MonthOverrideUSD OptionalFlag[string] `flag:"month-override-usd" desc:"USD limit for the current UTC month; null removes the override." nullable:"true"`
}
type GridUserSettingsUserFlags ¶ added in v1.5.0
type GridUserSettingsUserFlags struct {
User string `flag:"user-id" desc:"User ID, or me for yourself." default:"me"`
}
type InferenceClientFlags ¶
type InferenceClientFlags struct {
ModelID string `flag:"model-id" desc:"Model ID to target"`
ChainID string `flag:"chain-id" desc:"Chain ID to target"`
Environment string `flag:"environment" desc:"Environment name (e.g. production)"`
}
InferenceClientFlags are the flags needed to target an inference endpoint. Embedded by any command that needs to create an inference client.
type JSONAny ¶
JSONAny is the JSONT for leaf commands whose stdout JSON is valid JSON but whose shape is user- or runtime-determined. --help-output renders it as "any JSON object" rather than a concrete schema.
type JSONError ¶ added in v1.0.0
type JSONError struct {
// Message is the human-readable failure message, identical to the line
// written to stderr. For a failure originating in an API response this
// includes the raw response body.
Message string `json:"message"`
// Type is the name of the typed error, matching the names listed in the
// exit-code tables of `baseten --help-output` and each command's
// --help-output.
Type string `json:"type"`
// ExitCode is the process exit code, the same value the shell sees.
ExitCode ExitCode `json:"exit_code"`
// APIStatusCode is the HTTP status of the failed API response. Absent when
// the failure did not come from an API call.
APIStatusCode int `json:"api_status_code,omitempty"`
// APIErrorCode is the machine-readable error code from the API response
// body. Absent when the failure did not come from an API call, or when the
// response carried no code (some failures are reported by an upstream
// proxy whose body has only a message).
APIErrorCode string `json:"api_error_code,omitempty"`
// APIDetails is the structured, per-failure-kind payload from the API
// response body. Absent when the failure did not come from an API call, or
// when the response carried no details.
APIDetails map[string]any `json:"api_details,omitempty"`
}
JSONError is the error object inside a JSONErrorEnvelope.
type JSONErrorEnvelope ¶ added in v1.0.0
type JSONErrorEnvelope struct {
Error JSONError `json:"error"`
}
JSONErrorEnvelope is written to stdout when a command fails under --output json or --output jsonl, on top of the plain-text message that goes to stderr whatever the output format.
It is the last JSON document on stdout: alone when the command produced no payload, or after the records a streamed command emitted. Two kinds of failure write none. A command whose own payload already reports the failure suppresses it, so stdout stays a single document under --output json, and a command that delegates to another tool leaves that tool's stdout untouched.
type JSONUndefined ¶
type JSONUndefined struct{}
JSONUndefined is the JSONT for leaf commands whose stdout is not guaranteed to be JSON at all (e.g. raw HTTP passthrough, binary, streamed model output). --help-output renders it as "output shape is undefined".
type LogFlags ¶ added in v0.3.0
type LogFlags struct {
Tail bool `` /* 254-byte string literal not displayed */
Start time.Time `` /* 278-byte string literal not displayed */
End time.Time `` /* 185-byte string literal not displayed */
Since time.Duration `` /* 203-byte string literal not displayed */
Limit int `` /* 196-byte string literal not displayed */
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages without generating a full page of logs.
PageSize int `flag:"page-size" hidden:"true" desc:"Log lines fetched per backend request while paging." default:"1000"`
MinLevel string `flag:"min-level" desc:"Only return logs at or above this severity level." enum:"debug,info,warning,error"`
Includes []string `flag:"includes" desc:"Case-sensitive substring that must appear in the log message. May be repeated; all must match."`
Excludes []string `flag:"excludes" desc:"Case-sensitive substring; lines containing it are dropped. May be repeated."`
SearchPattern string `` /* 146-byte string literal not displayed */
Replica string `flag:"replica" desc:"Only return logs emitted by this replica (5-char short ID)."`
RequestID string `flag:"request-id" desc:"Only return logs tagged with this inference request ID."`
}
LogFlags is the shared log-query flag set for `baseten model deployment logs` and `baseten model environment logs`. Both commands accept the same window, filter, and tail flags; only the log source differs.
type LoopsCheckpointDeployFlags ¶ added in v0.4.0
type LoopsCheckpointDeployFlags struct {
CommandFlags
TrussAuthFlags
RunID string `flag:"run-id" desc:"Loops run whose checkpoints are deployed. Cannot be combined with --checkpoint-id."`
Checkpoint []string `` /* 196-byte string literal not displayed */
CheckpointID []string `` /* 186-byte string literal not displayed */
Config string `` /* 280-byte string literal not displayed */
DryRun bool `flag:"dry-run" desc:"Print the generated model config without deploying anything."`
}
LoopsCheckpointDeployFlags configures `baseten loops checkpoint deploy`.
type LoopsCheckpointFilesFlags ¶ added in v0.4.0
type LoopsCheckpointFilesFlags struct {
CommandFlags
CheckpointID string `` /* 127-byte string literal not displayed */
}
LoopsCheckpointFilesFlags configures `baseten loops checkpoint files`.
type LoopsCheckpointListFlags ¶ added in v0.4.0
type LoopsCheckpointListFlags struct {
CommandFlags
RunID string `flag:"run-id" desc:"List checkpoints saved by this run." oneof:"loops-checkpoint-scope"`
BaseModel string `flag:"base-model" desc:"List checkpoints across your runs of this base model." oneof:"loops-checkpoint-scope"`
Direction string `` /* 130-byte string literal not displayed */
}
LoopsCheckpointListFlags configures `baseten loops checkpoint list`.
type LoopsExecFlags ¶ added in v1.1.0
type LoopsExecFlags struct {
CommandFlags
TrussAuthFlags
Accelerator string `` /* 158-byte string literal not displayed */
GPUCount int `flag:"gpu-count" desc:"Number of GPUs, from 1 to 8. Requires --accelerator."`
CPUCount int `flag:"cpu-count" desc:"Number of CPUs to request." default:"16"`
Memory string `flag:"memory" desc:"Memory to request, for example 8Gi." default:"64Gi"`
ProjectName string `flag:"project-name" desc:"Training project name. Defaults to the selected directory's name."`
Image string `flag:"image" desc:"Custom Docker base image."`
Dir string `` /* 130-byte string literal not displayed */
ExcludeDir []string `flag:"exclude-dir" desc:"Top-level directory of the workspace root to leave out of the upload. Repeatable."`
ExternalDir []string `` /* 148-byte string literal not displayed */
Env []string `flag:"env" desc:"Environment variable for the job as KEY=VALUE. Repeatable."`
Secret []string `flag:"secret" desc:"Environment variable sourced from a Baseten workspace secret as KEY=SECRET_NAME. Repeatable."`
NoAPIKey bool `flag:"no-api-key" desc:"Do not provision BASETEN_API_KEY in the job from a per-team workspace secret."`
NoSSH bool `` /* 126-byte string literal not displayed */
WithUV bool `flag:"with-uv" desc:"Make uv available in the job image. The start command must invoke uv itself."`
Team string `flag:"team" desc:"Team name that owns the training project."`
Tail bool `` /* 134-byte string literal not displayed */
}
LoopsExecFlags configures `baseten loops exec`.
type LoopsExecResult ¶ added in v1.1.0
type LoopsExecResult struct {
JobID string `json:"job_id"`
Project struct {
ID *string `json:"id"`
Name *string `json:"name"`
} `json:"project"`
SSHHostname *string `json:"ssh_hostname"`
StartCommand string `json:"start_command"`
EnvironmentVariables []string `json:"environment_variables"`
Compute struct {
CPUCount int `json:"cpu_count"`
Memory string `json:"memory"`
Accelerator *string `json:"accelerator"`
GPUCount *int `json:"gpu_count"`
} `json:"compute"`
Job map[string]any `json:"job"`
}
LoopsExecResult is the structured result returned by Truss loops exec.
type LoopsLogFlags ¶ added in v0.4.0
type LoopsLogFlags struct {
Tail bool `` /* 244-byte string literal not displayed */
Start time.Time `` /* 278-byte string literal not displayed */
End time.Time `` /* 185-byte string literal not displayed */
Since time.Duration `` /* 203-byte string literal not displayed */
Limit int `` /* 196-byte string literal not displayed */
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages without generating a full page of logs.
PageSize int `flag:"page-size" hidden:"true" desc:"Log lines fetched per backend request while paging." default:"1000"`
MinLevel string `flag:"min-level" desc:"Only return logs at or above this severity level." enum:"debug,info,warning,error"`
}
LoopsLogFlags is the log-query flag set for `baseten loops run logs`. It is a subset of LogFlags: the Loops trainer logs endpoint supports only the window, limit, and severity filters, so the message and replica filters that model deployment logs accept are not offered here.
type LoopsRunCreateFlags ¶ added in v0.4.0
type LoopsRunCreateFlags struct {
CommandFlags
BaseModel string `` /* 196-byte string literal not displayed */
Name string `flag:"name" desc:"Display name for the run. Defaults to the base model."`
Replicas int `` /* 214-byte string literal not displayed */
Team string `` /* 157-byte string literal not displayed */
}
LoopsRunCreateFlags configures `baseten loops run create`.
type LoopsRunDeactivateFlags ¶ added in v0.4.0
type LoopsRunDeactivateFlags struct {
CommandFlags
LoopsRunRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
LoopsRunDeactivateFlags configures `baseten loops run deactivate`.
type LoopsRunDescribeFlags ¶ added in v0.4.0
type LoopsRunDescribeFlags struct {
CommandFlags
LoopsRunRefFlags
}
LoopsRunDescribeFlags configures `baseten loops run describe`.
type LoopsRunListFlags ¶ added in v0.4.0
type LoopsRunListFlags struct {
CommandFlags
BaseModel string `flag:"base-model" desc:"Only list runs of this base model."`
Org bool `flag:"org" desc:"List every run in the organization, with its owner, instead of only your own."`
All bool `flag:"all" desc:"Include inactive runs."`
Direction string `` /* 130-byte string literal not displayed */
}
LoopsRunListFlags configures `baseten loops run list`.
type LoopsRunLogsFlags ¶ added in v0.4.0
type LoopsRunLogsFlags struct {
CommandFlags
LoopsRunRefFlags
LoopsLogFlags
Sampler bool `flag:"sampler" desc:"Fetch the paired sampler's logs instead of the run's trainer logs."`
}
LoopsRunLogsFlags configures `baseten loops run logs`.
type LoopsRunRefFlags ¶ added in v0.4.0
type LoopsRunRefFlags struct {
RunID string `flag:"run-id" desc:"ID of the Loops run." required:"true"`
}
LoopsRunRefFlags identifies a Loops run. Embedded by commands that act on a specific run.
type LoopsUsageFlags ¶ added in v0.4.0
type LoopsUsageFlags struct {
CommandFlags
Org bool `flag:"org" desc:"Report usage across the organization, with each allocation's owner, instead of only your own."`
User string `flag:"user" desc:"Only report allocations owned by this email. Implies --org."`
All bool `flag:"all" desc:"Include allocations holding no live GPUs (scaled to zero, or in a terminal state)."`
}
LoopsUsageFlags configures `baseten loops usage`.
type LoopsUsageResult ¶ added in v0.4.0
type LoopsUsageResult struct {
Summary LoopsUsageSummary `json:"summary"`
Rows []LoopsUsageRow `json:"rows"`
}
LoopsUsageResult is the JSON output of `baseten loops usage`: the GPU summary plus one entry per displayed row. The rows are a client-side join of trainer deployments and standalone samplers, so this has no generated equivalent.
type LoopsUsageRow ¶ added in v0.4.0
type LoopsUsageRow struct {
RunID string `json:"run_id,omitempty"`
Owner string `json:"owner,omitempty"`
BaseModel string `json:"base_model"`
CreatedAt string `json:"created_at"`
TrainerStatus string `json:"trainer_status,omitempty"`
TrainerInstanceType string `json:"trainer_instance_type,omitempty"`
TrainerNodeCount int `json:"trainer_node_count,omitempty"`
TrainerGPUs int `json:"trainer_gpus"`
SamplerStatus string `json:"sampler_status,omitempty"`
SamplerInstanceType string `json:"sampler_instance_type,omitempty"`
SamplerNodeCount int `json:"sampler_node_count,omitempty"`
SamplerGPUs int `json:"sampler_gpus"`
}
LoopsUsageRow is one row of `baseten loops usage`: a trainer deployment with its paired sampler, or a standalone sampler with the trainer fields empty.
type LoopsUsageSummary ¶ added in v0.4.0
type LoopsUsageSummary struct {
TrainerInUse int `json:"trainer_in_use"`
TrainerScaledToZero int `json:"trainer_scaled_to_zero"`
SamplerInUse int `json:"sampler_in_use"`
SamplerScaledToZero int `json:"sampler_scaled_to_zero"`
}
LoopsUsageSummary totals GPU capacity across every allocation, including rows hidden from the table.
type MetricsFlags ¶ added in v0.3.0
type MetricsFlags struct {
Mode string `` /* 324-byte string literal not displayed */
Start time.Time `` /* 314-byte string literal not displayed */
End time.Time `` /* 221-byte string literal not displayed */
Since time.Duration `` /* 198-byte string literal not displayed */
Metric []string `` /* 206-byte string literal not displayed */
NoChart bool `flag:"no-chart" desc:"For --mode series, emit a per-step table instead of sparklines."`
}
MetricsFlags is the shared metric-query flag set for `baseten model deployment metrics`, `baseten model environment metrics`, and `baseten model-api metrics`. All accept the same mode, window, and metric-selection flags; only the metric source differs.
type ModelAPIDescribeFlags ¶ added in v0.2.0
type ModelAPIDescribeFlags struct {
CommandFlags
Model string `flag:"model" desc:"Name of the Model API to describe." required:"true"`
}
ModelAPIDescribeFlags configures `baseten model-api describe`.
type ModelAPIList ¶ added in v0.2.0
type ModelAPIList struct {
Items []managementapi.ModelAPI `json:"items"`
}
ModelAPIList is the JSON output of `baseten model-api list`: the Model APIs aggregated across all pages.
type ModelAPIListFlags ¶ added in v0.2.0
type ModelAPIListFlags struct {
CommandFlags
AddedOnly bool `flag:"added-only" desc:"Restrict to the Model APIs the workspace has added instead of the full visible catalog."`
}
ModelAPIListFlags configures `baseten model-api list`.
type ModelAPIMetricsFlags ¶ added in v1.9.0
type ModelAPIMetricsFlags struct {
CommandFlags
MetricsFlags
Model string `flag:"model" desc:"Name of the Model API to fetch metrics for." required:"true"`
Teams []string `` /* 167-byte string literal not displayed */
}
ModelAPIMetricsFlags configures `baseten model-api metrics`.
type ModelAPIPredictFlags ¶ added in v0.2.0
type ModelAPIPredictFlags struct {
CommandFlags
URL string `flag:"url" desc:"Endpoint to POST the request to. Defaults to https://inference.baseten.co/v1/chat/completions."`
Model string `flag:"model" desc:"Name of the Model API. Required with --content, where it sets the request's model." `
Content string `` /* 194-byte string literal not displayed */
Data string `` /* 169-byte string literal not displayed */
File string `flag:"file" desc:"Path to a file containing the request body, sent verbatim. Use '-' for stdin." oneof:"predict-input"`
}
ModelAPIPredictFlags configures `baseten model-api predict`.
type ModelAPIUsageFlags ¶ added in v0.4.0
type ModelAPIUsageFlags struct {
CommandFlags
Start time.Time `` /* 127-byte string literal not displayed */
End time.Time `flag:"end" desc:"End of the range, exclusive. ISO 8601, local when no timezone is given. Defaults to now."`
Since time.Duration `flag:"since" desc:"Window from a relative time ago until now (e.g. '30m', '3d'). Mutually exclusive with --start and --end."`
BucketWidth string `` /* 147-byte string literal not displayed */
GroupBy []string `` /* 128-byte string literal not displayed */
APIKeyPrefixes []string `flag:"api-key-prefix" desc:"Only return usage for these API key prefixes. May be repeated."`
UserIDs []string `flag:"user-id" desc:"Only return usage attributed to these user IDs. May be repeated."`
Models []string `flag:"model" desc:"Only return usage for these models. May be repeated."`
Teams []string `` /* 165-byte string literal not displayed */
Limit int `flag:"limit" desc:"Maximum number of time buckets, paging as needed. Rows per bucket depend on --group-by. 0 for no limit."`
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages without a full page of buckets. Zero uses
// the backend's maximum for the bucket width.
PageSize int `flag:"page-size" hidden:"true" desc:"Time buckets fetched per backend request while paging."`
}
ModelAPIUsageFlags configures `baseten model-api usage`.
type ModelAuditLogsFlags ¶ added in v0.4.0
type ModelAuditLogsFlags struct {
CommandFlags
ModelRefFlags
AuditLogFlags
}
ModelAuditLogsFlags configures `baseten model audit-logs`. It reuses the shared AuditLogFlags, scoped to a single model via ModelRefFlags.
type ModelDeleteFlags ¶
type ModelDeleteFlags struct {
CommandFlags
ModelRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeleteFlags configures `baseten model delete`.
type ModelDeploymentActivateFlags ¶
type ModelDeploymentActivateFlags struct {
CommandFlags
ModelDeploymentIDFlags
}
ModelDeploymentActivateFlags configures `baseten model deployment activate`.
type ModelDeploymentConfigFlags ¶
type ModelDeploymentConfigFlags struct {
CommandFlags
ModelDeploymentIDFlags
}
ModelDeploymentConfigFlags configures `baseten model deployment config`.
type ModelDeploymentDeactivateFlags ¶
type ModelDeploymentDeactivateFlags struct {
CommandFlags
ModelDeploymentIDFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeploymentDeactivateFlags configures `baseten model deployment deactivate`.
type ModelDeploymentDeleteFlags ¶
type ModelDeploymentDeleteFlags struct {
CommandFlags
ModelDeploymentIDFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeploymentDeleteFlags configures `baseten model deployment delete`.
type ModelDeploymentDescribeFlags ¶ added in v0.2.0
type ModelDeploymentDescribeFlags struct {
CommandFlags
ModelDeploymentIDFlags
}
ModelDeploymentDescribeFlags configures `baseten model deployment describe`.
type ModelDeploymentDownloadFlags ¶
type ModelDeploymentDownloadFlags struct {
CommandFlags
ModelDeploymentIDFlags
OutFile string `flag:"out-file" desc:"Save the model source as an uncompressed tar file at this path." oneof:"download-out"`
OutDir string `flag:"out-dir" desc:"Extract the model source tar into this directory." oneof:"download-out"`
Overwrite bool `flag:"overwrite" desc:"Allow overwriting an existing file or non-empty directory."`
}
ModelDeploymentDownloadFlags configures `baseten model deployment download`.
type ModelDeploymentDownloadResult ¶
type ModelDeploymentDownloadResult struct {
OutFile string `json:"out_file,omitempty"`
OutDir string `json:"out_dir,omitempty"`
}
ModelDeploymentDownloadResult is the JSON output of `baseten model deployment download`. Exactly one of OutFile or OutDir is set, matching whichever flag the caller passed.
type ModelDeploymentIDFlags ¶
type ModelDeploymentIDFlags struct {
ModelRefFlags
DeploymentID string `flag:"deployment-id" desc:"ID of the deployment." oneof:"deployment-ref"`
DeploymentName string `flag:"deployment-name" desc:"Name of the deployment." oneof:"deployment-ref"`
}
ModelDeploymentIDFlags identifies a deployment of a model. Embedded by commands that act on a specific deployment.
type ModelDeploymentListFlags ¶
type ModelDeploymentListFlags struct {
CommandFlags
ModelRefFlags
}
ModelDeploymentListFlags configures `baseten model deployment list`.
type ModelDeploymentLogsFlags ¶
type ModelDeploymentLogsFlags struct {
CommandFlags
ModelDeploymentIDFlags
LogFlags
}
ModelDeploymentLogsFlags configures `baseten model deployment logs`.
type ModelDeploymentMetricsFlags ¶ added in v0.2.0
type ModelDeploymentMetricsFlags struct {
CommandFlags
ModelDeploymentIDFlags
MetricsFlags
}
ModelDeploymentMetricsFlags configures `baseten model deployment metrics`.
type ModelDeploymentPromoteFlags ¶
type ModelDeploymentPromoteFlags struct {
CommandFlags
ModelDeploymentIDFlags
Environment string `flag:"environment" desc:"Target environment name. Defaults to production." default:"production"`
PreserveEnvInstanceType bool `` /* 139-byte string literal not displayed */
Region OptionalFlag[string] `` /* 146-byte string literal not displayed */
InstanceType OptionalFlag[string] `` /* 219-byte string literal not displayed */
RequestBackpressurePolicy OptionalFlag[string] `` /* 185-byte string literal not displayed */
AutoscalingScheduleUpdateJSON OptionalFlag[string] `` /* 312-byte string literal not displayed */
AutoscalingSettingsFlags
PromotionSettingsOverrideFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeploymentPromoteFlags configures `baseten model deployment promote`.
type ModelDeploymentRenameFlags ¶ added in v0.4.0
type ModelDeploymentRenameFlags struct {
CommandFlags
ModelDeploymentIDFlags
NewName string `` /* 182-byte string literal not displayed */
}
ModelDeploymentRenameFlags configures `baseten model deployment rename`. The new name is --new-name rather than --name, which already identifies the deployment being renamed.
type ModelDeploymentReplicaIDFlags ¶
type ModelDeploymentReplicaIDFlags struct {
ModelDeploymentIDFlags
ReplicaID string `flag:"replica-id" desc:"ID of the replica." required:"true"`
}
ModelDeploymentReplicaIDFlags identifies a replica of a deployment. Embedded by commands that act on a specific replica.
type ModelDeploymentReplicaTerminateFlags ¶
type ModelDeploymentReplicaTerminateFlags struct {
CommandFlags
ModelDeploymentReplicaIDFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeploymentReplicaTerminateFlags configures `baseten model deployment replica terminate`.
type ModelDeploymentUpdateAutoscalingFlags ¶ added in v0.4.0
type ModelDeploymentUpdateAutoscalingFlags struct {
CommandFlags
ModelDeploymentIDFlags
AutoscalingSettingsFlags
}
ModelDeploymentUpdateAutoscalingFlags configures `baseten model deployment update-autoscaling`.
type ModelDeploymentUpdateRequestBackpressureFlags ¶ added in v0.4.0
type ModelDeploymentUpdateRequestBackpressureFlags struct {
CommandFlags
ModelDeploymentIDFlags
RequestBackpressureFlags
}
ModelDeploymentUpdateRequestBackpressureFlags configures `baseten model deployment update-request-backpressure`.
type ModelDescribeFlags ¶ added in v0.2.0
type ModelDescribeFlags struct {
CommandFlags
ModelRefFlags
}
ModelDescribeFlags configures `baseten model describe`.
type ModelEnvironmentActivateFlags ¶
type ModelEnvironmentActivateFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentActivateFlags configures `baseten model environment activate`.
type ModelEnvironmentAutoscalingScheduleCreateFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleCreateFlags struct {
CommandFlags
ModelEnvironmentFlags
AutoscalingScheduleTimingFlags
AutoscalingSettingsFlags
Name string `flag:"name" desc:"Name of the schedule, unique among the environment's schedules." required:"true"`
Cadence string `` /* 193-byte string literal not displayed */
Timezone string `` /* 187-byte string literal not displayed */
}
ModelEnvironmentAutoscalingScheduleCreateFlags configures `baseten model environment autoscaling-schedule create`.
type ModelEnvironmentAutoscalingScheduleDeleteFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleDeleteFlags struct {
CommandFlags
ModelEnvironmentFlags
ModelEnvironmentAutoscalingScheduleRefFlags
}
ModelEnvironmentAutoscalingScheduleDeleteFlags configures `baseten model environment autoscaling-schedule delete`.
type ModelEnvironmentAutoscalingScheduleListFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleListFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentAutoscalingScheduleListFlags configures `baseten model environment autoscaling-schedule list`.
type ModelEnvironmentAutoscalingScheduleRefFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleRefFlags struct {
ScheduleID string `flag:"schedule-id" desc:"Stable identifier of the schedule, from 'autoscaling-schedule list'." oneof:"schedule-ref"`
ScheduleName string `flag:"schedule-name" desc:"Name of the schedule, unique among the environment's schedules." oneof:"schedule-ref"`
}
ModelEnvironmentAutoscalingScheduleRefFlags identifies one schedule on an environment, by id or by name. Schedule names are unique per environment, so either identifies exactly one. The name flag is --schedule-name rather than --name because update uses --name for the new name when renaming.
type ModelEnvironmentAutoscalingScheduleUpdateFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleUpdateFlags struct {
CommandFlags
ModelEnvironmentFlags
ModelEnvironmentAutoscalingScheduleRefFlags
AutoscalingScheduleTimingFlags
AutoscalingSettingsFlags
Name OptionalFlag[string] `flag:"name" desc:"New name for the schedule, unique among the environment's schedules."`
Cadence OptionalFlag[string] `` /* 167-byte string literal not displayed */
}
ModelEnvironmentAutoscalingScheduleUpdateFlags configures `baseten model environment autoscaling-schedule update`.
type ModelEnvironmentAutoscalingScheduleUpdateSettingsFlags ¶ added in v0.4.0
type ModelEnvironmentAutoscalingScheduleUpdateSettingsFlags struct {
CommandFlags
ModelEnvironmentFlags
Timezone string `` /* 129-byte string literal not displayed */
}
ModelEnvironmentAutoscalingScheduleUpdateSettingsFlags configures `baseten model environment autoscaling-schedule update-settings`.
type ModelEnvironmentDeactivateFlags ¶
type ModelEnvironmentDeactivateFlags struct {
CommandFlags
ModelEnvironmentFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelEnvironmentDeactivateFlags configures `baseten model environment deactivate`.
type ModelEnvironmentDescribeFlags ¶ added in v0.2.0
type ModelEnvironmentDescribeFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentDescribeFlags configures `baseten model environment describe`.
type ModelEnvironmentFlags ¶
type ModelEnvironmentFlags struct {
ModelRefFlags
Environment string `` /* 152-byte string literal not displayed */
}
ModelEnvironmentFlags identifies an environment of a model by name. Embedded by commands that act on a specific environment.
type ModelEnvironmentListFlags ¶
type ModelEnvironmentListFlags struct {
CommandFlags
ModelRefFlags
}
ModelEnvironmentListFlags configures `baseten model environment list`.
type ModelEnvironmentLogsFlags ¶ added in v0.3.0
type ModelEnvironmentLogsFlags struct {
CommandFlags
ModelEnvironmentFlags
LogFlags
}
ModelEnvironmentLogsFlags configures `baseten model environment logs`.
type ModelEnvironmentMetricsFlags ¶ added in v0.3.0
type ModelEnvironmentMetricsFlags struct {
CommandFlags
ModelEnvironmentFlags
MetricsFlags
}
ModelEnvironmentMetricsFlags configures `baseten model environment metrics`.
type ModelEnvironmentTrafficRuleCreateFlags ¶ added in v1.6.0
type ModelEnvironmentTrafficRuleCreateFlags struct {
CommandFlags
ModelEnvironmentFlags
Type string `` /* 130-byte string literal not displayed */
TargetEnvironment string `` /* 144-byte string literal not displayed */
TargetDeploymentID string `flag:"target-deployment-id" desc:"ID of the target deployment." oneof:"target"`
PercentTraffic int `flag:"percent-traffic" desc:"Percentage of the environment's traffic to shadow." required:"true"`
ExpiresAt time.Time `` /* 191-byte string literal not displayed */
SamplingMode string `` /* 202-byte string literal not displayed */
PropagateClientCancellation OptionalFlag[bool] `` /* 135-byte string literal not displayed */
}
ModelEnvironmentTrafficRuleCreateFlags configures `baseten model environment traffic-rule create`.
type ModelEnvironmentTrafficRuleDeleteFlags ¶ added in v1.6.0
type ModelEnvironmentTrafficRuleDeleteFlags struct {
CommandFlags
ModelEnvironmentFlags
RuleID string `` /* 135-byte string literal not displayed */
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelEnvironmentTrafficRuleDeleteFlags configures `baseten model environment traffic-rule delete`.
type ModelEnvironmentTrafficRuleListFlags ¶ added in v1.6.0
type ModelEnvironmentTrafficRuleListFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentTrafficRuleListFlags configures `baseten model environment traffic-rule list`.
type ModelEnvironmentTrafficRuleUpdateFlags ¶ added in v1.6.0
type ModelEnvironmentTrafficRuleUpdateFlags struct {
CommandFlags
ModelEnvironmentFlags
RuleID string `` /* 135-byte string literal not displayed */
PercentTraffic OptionalFlag[int] `flag:"percent-traffic" desc:"New percentage of the environment's traffic to shadow."`
ExpiresAt time.Time `` /* 179-byte string literal not displayed */
SamplingMode OptionalFlag[string] `flag:"sampling-mode" desc:"New way requests are picked for shadowing." enum:"random,user-session"`
PropagateClientCancellation OptionalFlag[bool] `flag:"propagate-client-cancellation" desc:"Whether a shadow request is cancelled when the original client disconnects."`
}
ModelEnvironmentTrafficRuleUpdateFlags configures `baseten model environment traffic-rule update`.
type ModelEnvironmentUpdateAutoscalingFlags ¶ added in v0.4.0
type ModelEnvironmentUpdateAutoscalingFlags struct {
CommandFlags
ModelEnvironmentFlags
AutoscalingSettingsFlags
}
ModelEnvironmentUpdateAutoscalingFlags configures `baseten model environment update-autoscaling`.
type ModelEnvironmentUpdatePromotionFlags ¶ added in v0.4.0
type ModelEnvironmentUpdatePromotionFlags struct {
CommandFlags
ModelEnvironmentFlags
RedeployOnPromotion OptionalFlag[bool] `` /* 234-byte string literal not displayed */
RollingDeploy OptionalFlag[bool] `flag:"rolling-deploy" desc:"Whether the environment should rely on rolling deploy orchestration."`
PromotionCleanupStrategy OptionalFlag[string] `` /* 134-byte string literal not displayed */
// Deprecated: models no longer support canary promotions. Hidden but still
// parsed so existing scripts keep running until the flags are removed.
RampUpWhilePromoting OptionalFlag[bool] `` /* 160-byte string literal not displayed */
RampUpDurationSeconds OptionalFlag[int] `flag:"ramp-up-duration-seconds" hidden:"true" desc:"Deprecated: models no longer support canary promotions."`
RollingDeployStrategy OptionalFlag[string] `flag:"rolling-deploy-strategy" desc:"The rolling deploy strategy to use for promotions." enum:"replica"`
MaxSurgePercent OptionalFlag[int] `flag:"max-surge-percent" desc:"The maximum surge percentage for rolling deploys."`
StabilizationTimeSeconds OptionalFlag[int] `flag:"stabilization-time-seconds" desc:"The stabilization time for rolling deploys, in seconds."`
ReplicaOverheadPercent OptionalFlag[int] `flag:"replica-overhead-percent" desc:"The replica overhead percentage for rolling deploys."`
}
ModelEnvironmentUpdatePromotionFlags configures `baseten model environment update-promotion`. The rolling deploy config is flattened into these flags; its nesting in the API exists only to group the fields.
type ModelEnvironmentUpdateRequestBackpressureFlags ¶ added in v0.4.0
type ModelEnvironmentUpdateRequestBackpressureFlags struct {
CommandFlags
ModelEnvironmentFlags
RequestBackpressureFlags
}
ModelEnvironmentUpdateRequestBackpressureFlags configures `baseten model environment update-request-backpressure`.
type ModelImageBuildFlags ¶ added in v0.4.0
type ModelImageBuildFlags struct {
ModelImageCommonFlags
BuildDir string `flag:"build-dir" desc:"Directory for the Docker build context. Defaults to a temp dir removed after the build."`
Tag string `flag:"tag" desc:"Image tag. Defaults to '<model_name>:latest' from config.yaml."`
}
ModelImageBuildFlags configures `baseten model image build`.
type ModelImageBuildResult ¶ added in v0.4.0
ModelImageBuildResult is the JSON output of `baseten model image build`.
type ModelImageCommonFlags ¶ added in v0.4.0
type ModelImageCommonFlags struct {
CommandFlags
// TrussFlags without credential forwarding: generating a build context runs
// entirely locally and calls no API.
TrussFlags
Dir string `flag:"dir" desc:"Model directory." default:"."`
RootUser bool `flag:"root-user" desc:"Run the image's container as root instead of the default non-root user."`
CacheMountID string `flag:"cache-mount-id" desc:"Enable a persistent apt/pip/uv build cache keyed by this id."`
}
ModelImageCommonFlags are the flags shared by both `baseten model image` subcommands.
type ModelImagePrepareFlags ¶ added in v0.4.0
type ModelImagePrepareFlags struct {
ModelImageCommonFlags
BuildDir string `flag:"build-dir" desc:"Directory for the Docker build context. Created if absent and kept." required:"true"`
}
ModelImagePrepareFlags configures `baseten model image prepare`.
type ModelImagePrepareResult ¶ added in v0.4.0
type ModelImagePrepareResult struct {
BuildDir string `json:"build_dir"`
Dockerfile string `json:"dockerfile"`
}
ModelImagePrepareResult is the JSON output of `baseten model image prepare`.
type ModelInstanceTypesFlags ¶ added in v1.9.0
type ModelInstanceTypesFlags struct {
CommandFlags
}
type ModelListFlags ¶
type ModelListFlags struct {
CommandFlags
Team string `flag:"team" desc:"Team name or ID to scope the listing to. Defaults to all teams the caller can see."`
}
ModelListFlags configures `baseten model list`.
type ModelPredictFlags ¶
type ModelPredictFlags struct {
CommandFlags
ModelRefFlags
Environment string `` /* 247-byte string literal not displayed */
DeploymentID string `` /* 132-byte string literal not displayed */
DeploymentName string `` /* 135-byte string literal not displayed */
Regional string `` /* 162-byte string literal not displayed */
Data string `` /* 176-byte string literal not displayed */
File string `flag:"file" desc:"Path to a JSON file containing the request body. Use '-' for stdin." oneof:"predict-input"`
Websocket bool `` /* 173-byte string literal not displayed */
}
ModelPredictFlags configures `baseten model predict`.
type ModelPushFlags ¶
type ModelPushFlags struct {
CommandFlags
Dir string `flag:"dir" desc:"Model directory to push. Defaults to the current directory when --file is not set."`
File string `` /* 199-byte string literal not displayed */
Team string `flag:"team" desc:"Team the model belongs to. Only valid for new models."`
DryRun bool `flag:"dry-run" desc:"Validate the push and request upload credentials without uploading or creating anything."`
Environment string `flag:"environment" desc:"Stable environment to push to. Run 'baseten model environment list' to see a model's environments."`
CreateEnvironmentIfMissing bool `` /* 274-byte string literal not displayed */
DeploymentName string `flag:"deployment-name" desc:"Human-readable name for the new deployment."`
Region string `` /* 155-byte string literal not displayed */
NoBuildCache bool `flag:"no-build-cache" desc:"Force a full rebuild without using cached layers."`
Labels string `flag:"labels" desc:"User-provided labels for the deployment as a JSON object, e.g. '{\"team\":\"ml\",\"priority\":1}'."`
IncludeGitInfo bool `` /* 181-byte string literal not displayed */
Tail bool `` /* 178-byte string literal not displayed */
Wait bool `flag:"wait" desc:"Block until the deployment is active. Exits non-zero on a terminal-failure status."`
Develop bool `` /* 201-byte string literal not displayed */
Watch bool `` /* 132-byte string literal not displayed */
WatchHotReload bool `` /* 154-byte string literal not displayed */
WatchNoKeepalive bool `` /* 153-byte string literal not displayed */
DeployTimeout string `flag:"deploy-timeout" desc:"Deployment timeout as a duration (e.g. 30m, 1h); allowed range 10m to 24h."`
OverrideName string `` /* 129-byte string literal not displayed */
PreserveEnvInstanceType bool `` /* 187-byte string literal not displayed */
InstanceType string `` /* 326-byte string literal not displayed */
RequestBackpressurePolicy OptionalFlag[string] `` /* 243-byte string literal not displayed */
AutoscalingScheduleUpdateJSON OptionalFlag[string] `` /* 336-byte string literal not displayed */
AutoscalingSettingsFlags
PromotionSettingsOverrideFlags
DisableArchiveDownload bool `flag:"disable-archive-download" desc:"Disable archive download for the new model. Only valid for new models."`
}
ModelPushFlags configures `baseten model push`.
type ModelPushResult ¶
type ModelPushResult struct {
Model managementapi.Model `json:"model"`
Deployment managementapi.Deployment `json:"deployment"`
PredictURL string `json:"predict_url"`
LogsURL string `json:"logs_url"`
}
ModelPushResult is the JSON output of `baseten model push` on a successful non-dry-run push.
type ModelRefFlags ¶
type ModelRefFlags struct {
ModelID string `flag:"model-id" desc:"ID of the model." oneof:"model-ref"`
ModelName string `` /* 133-byte string literal not displayed */
Team string `flag:"team" desc:"Team name or ID. Only valid with --model-name."`
}
ModelRefFlags identifies a model by ID or by name (with optional --team for disambiguation across teams in the same org). Embedded by commands that act on a specific model.
type ModelRenameFlags ¶ added in v1.1.0
type ModelRenameFlags struct {
CommandFlags
ModelRefFlags
NewName string `flag:"new-name" desc:"New name for the model, unique within its team." required:"true"`
}
ModelRenameFlags configures `baseten model rename`. The new name is --new-name rather than --name, which would read as identifying the model being renamed.
type ModelWatchFlags ¶ added in v0.2.0
type ModelWatchFlags struct {
CommandFlags
Dir string `flag:"dir" desc:"Model directory to watch. Defaults to the current directory." default:"."`
Team string `flag:"team" desc:"Team the model belongs to. Use to disambiguate when the same model_name exists in multiple teams."`
HotReload bool `` /* 134-byte string literal not displayed */
NoKeepalive bool `` /* 133-byte string literal not displayed */
}
ModelWatchFlags configures `baseten model watch`.
type OptionalFlag ¶ added in v0.4.0
type OptionalFlag[T any] struct { // contains filtered or unexported fields }
OptionalFlag is a flag that can be left unpassed, keeping `--min-replica 0` distinguishable from an omitted flag. The settings endpoints patch only the fields the request body carries, so that distinction decides whether a setting is changed at all.
Adding `nullable:"true"` lets the flag also be passed as NullFlagValue. Optionality and nullability are separate concerns: an OptionalFlag without the tag can be omitted but not nulled.
The state is behind methods rather than exported fields so binding cannot leave it inconsistent, and so a value type carries no pointer to patch.
func (OptionalFlag[T]) APIOptional ¶ added in v1.9.0
func (o OptionalFlag[T]) APIOptional() managementapi.Optional[T]
APIOptional returns the flag as an API request field: omitted when the flag was, and sent, even empty or null, when it was passed.
func (OptionalFlag[T]) IsNull ¶ added in v0.4.0
func (o OptionalFlag[T]) IsNull() bool
IsNull reports whether the flag was passed as null.
func (OptionalFlag[T]) IsSet ¶ added in v0.4.0
func (o OptionalFlag[T]) IsSet() bool
IsSet reports whether the flag was passed at all, as a value or as null.
func (OptionalFlag[T]) Pointer ¶ added in v0.4.0
func (o OptionalFlag[T]) Pointer() *T
Pointer returns the value, or nil when the flag was omitted or passed as null. Both cases marshal away, so a caller that has already rejected null can use this directly as a request field.
func (*OptionalFlag[T]) SetNull ¶ added in v0.4.0
func (o *OptionalFlag[T]) SetNull()
SetNull records that the flag was passed as null. Called by flag binding.
func (*OptionalFlag[T]) SetValue ¶ added in v0.4.0
func (o *OptionalFlag[T]) SetValue(value T)
SetValue records that the flag was passed with a value. Called by flag binding.
type OrgAPIKeyCreateFlags ¶
type OrgAPIKeyCreateFlags struct {
CommandFlags
Type string `` /* 162-byte string literal not displayed */
Name string `flag:"name" desc:"Optional human-readable name for the key."`
ModelIDs []string `` /* 146-byte string literal not displayed */
Team string `` /* 143-byte string literal not displayed */
ExpiresAt time.Time `` /* 140-byte string literal not displayed */
}
type OrgAPIKeyDeleteFlags ¶
type OrgAPIKeyDeleteFlags struct {
CommandFlags
Name string `flag:"name" desc:"Human-readable name of the API key to delete." oneof:"identifier"`
Prefix string `flag:"prefix" desc:"Prefix of the API key to delete (as shown in list)." oneof:"identifier"`
}
type OrgAPIKeyListFlags ¶
type OrgAPIKeyListFlags struct {
CommandFlags
Type string `` /* 161-byte string literal not displayed */
}
type OrgAccessCheckFlags ¶
type OrgAccessCheckFlags struct {
CommandFlags
Permissions []string `flag:"permission" desc:"Permission to check, such as model.deployment.write. May be repeated." required:"true"`
Team string `flag:"team" desc:"Check in this team, by name or ID."`
ResourceSet string `flag:"resource-set" desc:"Check where this set selects, such as model:<model-id>,environment:production."`
}
type OrgAuditLogsFlags ¶ added in v0.4.0
type OrgAuditLogsFlags struct {
CommandFlags
AuditLogFlags
}
OrgAuditLogsFlags configures `baseten org audit-logs`.
type OrgBillingUsageFlags ¶
type OrgDescribeFlags ¶ added in v1.0.0
type OrgDescribeFlags struct {
CommandFlags
}
OrgDescribeFlags configures `baseten org describe`.
type OrgIdentityProviderCreateFlags ¶ added in v1.9.0
type OrgIdentityProviderCreateFlags struct {
CommandFlags
Kind string `` /* 180-byte string literal not displayed */
Name string `` /* 155-byte string literal not displayed */
IssuerURL string `` /* 213-byte string literal not displayed */
Description string `flag:"description" desc:"Optional description."`
}
type OrgIdentityProviderDeleteFlags ¶ added in v1.9.0
type OrgIdentityProviderDeleteFlags struct {
CommandFlags
OrgIdentityProviderRefFlags
}
type OrgIdentityProviderDescribeFlags ¶ added in v1.9.0
type OrgIdentityProviderDescribeFlags struct {
CommandFlags
OrgIdentityProviderRefFlags
}
type OrgIdentityProviderList ¶ added in v1.9.0
type OrgIdentityProviderList struct {
Items []managementapi.IdentityProvider `json:"items"`
}
OrgIdentityProviderList is the JSON output of `baseten org identity-provider list`: the providers aggregated across all pages.
type OrgIdentityProviderListFlags ¶ added in v1.9.0
type OrgIdentityProviderListFlags struct {
CommandFlags
Kind string `` /* 164-byte string literal not displayed */
}
type OrgIdentityProviderListPredefinedFlags ¶ added in v1.9.0
type OrgIdentityProviderListPredefinedFlags struct {
CommandFlags
}
type OrgIdentityProviderRefFlags ¶ added in v1.9.0
type OrgIdentityProviderRefFlags struct {
ID string `flag:"id" desc:"Identity provider ID." oneof:"identity-provider-ref"`
Name string `` /* 129-byte string literal not displayed */
}
OrgIdentityProviderRefFlags picks one identity provider.
type OrgIdentityProviderUpdateFlags ¶ added in v1.9.0
type OrgIdentityProviderUpdateFlags struct {
CommandFlags
OrgIdentityProviderRefFlags
NewName string `flag:"new-name" desc:"New name, unique in the organization."`
Description OptionalFlag[string] `flag:"description" desc:"New description. Pass an empty string to clear it."`
}
type OrgPermissionsFlags ¶
type OrgPermissionsFlags struct {
CommandFlags
}
type OrgRegionsFlags ¶ added in v1.0.0
type OrgRegionsFlags struct {
CommandFlags
Team string `` /* 146-byte string literal not displayed */
}
type OrgRoleAssignmentCreateFlags ¶
type OrgRoleAssignmentCreateFlags struct {
CommandFlags
UserID string `flag:"user-id" desc:"User ID." oneof:"subject"`
UserEmail string `flag:"user-email" desc:"Email of the user." oneof:"subject"`
ServiceAccountID string `flag:"service-account-id" desc:"Service account ID." oneof:"subject"`
ServiceAccountName string `flag:"service-account-name" desc:"Name of the service account." oneof:"subject"`
DirectoryGroupID string `flag:"directory-group-id" desc:"Directory group ID." oneof:"subject"`
RoleID string `flag:"role-id" desc:"Role to assign, by ID." oneof:"role-ref"`
RoleName string `flag:"role-name" desc:"Role to assign, by name." oneof:"role-ref"`
Team string `flag:"team" desc:"Team to assign a team role in, by name or ID. Omit for an organization role."`
ResourceSets []string `` /* 130-byte string literal not displayed */
}
type OrgRoleAssignmentList ¶
type OrgRoleAssignmentList struct {
Items []managementapi.AccessAssignment `json:"items"`
}
OrgRoleAssignmentList is the JSON output of `baseten org role-assignment list`: the assignments aggregated across all pages.
type OrgRoleAssignmentListFlags ¶
type OrgRoleAssignmentListFlags struct {
CommandFlags
UserID string `flag:"user-id" desc:"Only this user's. Mutually exclusive with the other holder flags."`
UserEmail string `flag:"user-email" desc:"Only the user with this email's."`
ServiceAccountID string `flag:"service-account-id" desc:"Only this service account's."`
ServiceAccountName string `flag:"service-account-name" desc:"Only the service account with this name's."`
DirectoryGroupID string `flag:"directory-group-id" desc:"Only this directory group's."`
Team string `flag:"team" desc:"Only assignments in this team, by name or ID."`
RoleID string `flag:"role-id" desc:"Only assignments of the role with this ID. Mutually exclusive with --role-name."`
RoleName string `flag:"role-name" desc:"Only assignments of the role with this name."`
}
type OrgRoleAssignmentRefFlags ¶
type OrgRoleAssignmentRefFlags struct {
CommandFlags
ID string `flag:"id" desc:"Role assignment ID." required:"true"`
}
OrgRoleAssignmentRefFlags picks one role assignment.
type OrgRoleCreateFlags ¶
type OrgRoleCreateFlags struct {
CommandFlags
Name string `flag:"name" desc:"Name, unique in the organization." required:"true"`
Kind string `flag:"kind" desc:"Where the role is assigned: across the organization, or in teams." enum:"organization,team" required:"true"`
Team string `flag:"team" desc:"For a team role, the only team it can be assigned in, by name or ID. Omit to let any team use it."`
Description string `flag:"description" desc:"Optional description."`
Permissions []string `flag:"permission" desc:"Permission the role grants, such as model.read. May be repeated."`
Includes []string `` /* 140-byte string literal not displayed */
}
type OrgRoleDeleteFlags ¶
type OrgRoleDeleteFlags struct {
CommandFlags
OrgRoleRefFlags
Team string `` /* 158-byte string literal not displayed */
}
type OrgRoleDescribeFlags ¶
type OrgRoleDescribeFlags struct {
CommandFlags
OrgRoleRefFlags
Team string `` /* 166-byte string literal not displayed */
}
type OrgRoleList ¶
type OrgRoleList struct {
Items []managementapi.AccessRole `json:"items"`
}
OrgRoleList is the JSON output of `baseten org role list`: the roles aggregated across all pages.
type OrgRoleListFlags ¶
type OrgRoleListFlags struct {
CommandFlags
Team string `flag:"team" desc:"Only the roles that can be assigned in this team, by name or ID."`
}
type OrgRoleRefFlags ¶
type OrgRoleRefFlags struct {
ID string `flag:"id" desc:"Role ID." oneof:"role-ref"`
Name string `flag:"name" desc:"Role name." oneof:"role-ref"`
}
OrgRoleRefFlags picks one role.
type OrgRoleUpdateFlags ¶
type OrgRoleUpdateFlags struct {
CommandFlags
OrgRoleRefFlags
NewName string `flag:"new-name" desc:"New name, unique in the organization."`
Description OptionalFlag[string] `flag:"description" desc:"New description. Pass an empty string to clear it."`
AddPermissions []string `flag:"add-permission" desc:"Permission to add to the role. May be repeated."`
RemovePermissions []string `flag:"remove-permission" desc:"Permission to remove from the role. May be repeated."`
AddIncludes []string `flag:"add-include" desc:"ID of a built-in role for the role to include. May be repeated."`
RemoveIncludes []string `flag:"remove-include" desc:"ID of a built-in role for the role to stop including. May be repeated."`
Team string `` /* 158-byte string literal not displayed */
}
type OrgSecretDeleteFlags ¶
type OrgSecretDeleteFlags struct {
CommandFlags
Name string `flag:"name" desc:"Name of the secret to delete." required:"true"`
Team string `` /* 144-byte string literal not displayed */
}
type OrgSecretListFlags ¶
type OrgSecretListFlags struct {
CommandFlags
Team string `flag:"team" desc:"Filter to a specific team by name or ID. Defaults to all teams the caller belongs to."`
}
type OrgSecretSetFlags ¶
type OrgSecretSetFlags struct {
CommandFlags
Name string `flag:"name" desc:"Name of the secret." required:"true"`
Value string `flag:"value" desc:"Secret value. Discouraged: leaks into shell history and process list. Prefer stdin or prompt."`
Team string `` /* 144-byte string literal not displayed */
}
type OrgServiceAccountAccessFlags ¶
type OrgServiceAccountAccessFlags struct {
CommandFlags
OrgServiceAccountRefFlags
}
type OrgServiceAccountCreateFlags ¶ added in v1.9.0
type OrgServiceAccountCreateFlags struct {
CommandFlags
OrgServiceAccountPermissionFlags
Name string `flag:"name" desc:"Name, unique in the organization." required:"true"`
Type string `` /* 183-byte string literal not displayed */
Team string `` /* 151-byte string literal not displayed */
Description string `flag:"description" desc:"Optional description."`
}
type OrgServiceAccountDeleteFlags ¶ added in v1.9.0
type OrgServiceAccountDeleteFlags struct {
CommandFlags
OrgServiceAccountRefFlags
}
type OrgServiceAccountDescribeFlags ¶ added in v1.9.0
type OrgServiceAccountDescribeFlags struct {
CommandFlags
OrgServiceAccountRefFlags
}
type OrgServiceAccountList ¶ added in v1.9.0
type OrgServiceAccountList struct {
Items []managementapi.ServiceAccount `json:"items"`
}
OrgServiceAccountList is the JSON output of `baseten org service-account list`: the accounts aggregated across all pages.
type OrgServiceAccountListFlags ¶ added in v1.9.0
type OrgServiceAccountListFlags struct {
CommandFlags
Team string `flag:"team" desc:"Only list this team's accounts, by team name or ID."`
Disabled OptionalFlag[bool] `flag:"disabled" desc:"Only list disabled (true) or enabled (false) accounts."`
}
type OrgServiceAccountPermissionFlags ¶ added in v1.9.0
type OrgServiceAccountPermissionFlags struct {
ModelIDs []string `` /* 141-byte string literal not displayed */
Environments []string `` /* 181-byte string literal not displayed */
ModelAPISlugs []string `` /* 134-byte string literal not displayed */
}
OrgServiceAccountPermissionFlags set a service account's access.
type OrgServiceAccountRefFlags ¶ added in v1.9.0
type OrgServiceAccountRefFlags struct {
ID string `flag:"id" desc:"Service account ID." oneof:"service-account-ref"`
Name string `flag:"name" desc:"Service account name." oneof:"service-account-ref"`
}
OrgServiceAccountRefFlags picks one service account.
type OrgServiceAccountUpdateFlags ¶ added in v1.9.0
type OrgServiceAccountUpdateFlags struct {
CommandFlags
OrgServiceAccountRefFlags
OrgServiceAccountPermissionFlags
NewName string `flag:"new-name" desc:"New name, unique in the organization."`
Description OptionalFlag[string] `flag:"description" desc:"New description. Pass an empty string to clear it."`
Type string `` /* 220-byte string literal not displayed */
Disabled OptionalFlag[bool] `` /* 175-byte string literal not displayed */
}
type OrgTeamDescribeFlags ¶ added in v0.3.0
type OrgTeamDescribeFlags struct {
CommandFlags
TeamID string `flag:"team-id" desc:"Team ID to describe." oneof:"team-ref"`
TeamName string `flag:"team-name" desc:"Team name to describe." oneof:"team-ref"`
}
type OrgTeamListFlags ¶ added in v0.3.0
type OrgTeamListFlags struct {
CommandFlags
}
type OrgTrustRuleCreateFlags ¶ added in v1.9.0
type OrgTrustRuleCreateFlags struct {
CommandFlags
Name string `flag:"name" desc:"Name, unique in the organization." required:"true"`
IdentityProviderID string `` /* 137-byte string literal not displayed */
IdentityProviderName string `` /* 198-byte string literal not displayed */
ServiceAccountID string `flag:"service-account-id" desc:"ID of the service account the tokens act as." oneof:"service-account"`
ServiceAccountName string `flag:"service-account-name" desc:"Name of the service account the tokens act as." oneof:"service-account"`
Description string `flag:"description" desc:"Optional description."`
Condition string `` /* 190-byte string literal not displayed */
Audience string `flag:"audience" desc:"Value the token's aud claim must equal, or contain when aud is a list." required:"true"`
MaxAccessTokenLifetime time.Duration `` /* 136-byte string literal not displayed */
}
type OrgTrustRuleDeleteFlags ¶ added in v1.9.0
type OrgTrustRuleDeleteFlags struct {
CommandFlags
OrgTrustRuleRefFlags
}
type OrgTrustRuleDescribeFlags ¶ added in v1.9.0
type OrgTrustRuleDescribeFlags struct {
CommandFlags
OrgTrustRuleRefFlags
}
type OrgTrustRuleList ¶ added in v1.9.0
type OrgTrustRuleList struct {
Items []managementapi.AccessTrustRule `json:"items"`
}
OrgTrustRuleList is the JSON output of `baseten org trust-rule list`: the rules aggregated across all pages.
type OrgTrustRuleListFlags ¶ added in v1.9.0
type OrgTrustRuleListFlags struct {
CommandFlags
IdentityProviderID string `` /* 140-byte string literal not displayed */
IdentityProviderName string `` /* 145-byte string literal not displayed */
ServiceAccountID string `` /* 134-byte string literal not displayed */
ServiceAccountName string `flag:"service-account-name" desc:"Only list rules for the service account with this name."`
Team string `flag:"team" desc:"Only list rules for this team's service accounts, by team name or ID."`
}
type OrgTrustRuleRefFlags ¶ added in v1.9.0
type OrgTrustRuleRefFlags struct {
ID string `flag:"id" desc:"Trust rule ID." oneof:"trust-rule-ref"`
Name string `flag:"name" desc:"Trust rule name." oneof:"trust-rule-ref"`
}
OrgTrustRuleRefFlags picks one trust rule.
type OrgTrustRuleUpdateFlags ¶ added in v1.9.0
type OrgTrustRuleUpdateFlags struct {
CommandFlags
OrgTrustRuleRefFlags
NewName string `flag:"new-name" desc:"New name, unique in the organization."`
Description OptionalFlag[string] `flag:"description" desc:"New description. Pass an empty string to clear it."`
ServiceAccountID string `` /* 206-byte string literal not displayed */
ServiceAccountName string `flag:"service-account-name" desc:"Name of the service account the tokens act as from now on."`
Condition string `` /* 127-byte string literal not displayed */
Audience string `flag:"audience" desc:"New value the token's aud claim must equal, or contain when aud is a list."`
MaxAccessTokenLifetime time.Duration `flag:"max-access-token-lifetime" desc:"New longest lifetime of an access token the rule issues, from 1m to 1h (e.g. '15m')."`
}
type OrgUpdateFlags ¶ added in v1.9.0
type OrgUpdateFlags struct {
CommandFlags
AllowPersonalAPIKeys OptionalFlag[bool] `flag:"allow-personal-api-keys" desc:"Whether members can create new personal API keys."`
AllowServiceAccountAPIKeys OptionalFlag[bool] `flag:"allow-service-account-api-keys" desc:"Whether new team and organization API keys can be created."`
AllowTeamAdminsToManageRoles OptionalFlag[bool] `` /* 180-byte string literal not displayed */
}
OrgUpdateFlags configures `baseten org update`.
type OrgUserAccessFlags ¶
type OrgUserAccessFlags struct {
CommandFlags
UserID string `flag:"user-id" desc:"User ID. Pass 'me' for the authenticated user." oneof:"user-ref"`
UserEmail string `flag:"user-email" desc:"Email of the user." oneof:"user-ref"`
}
type OrgUserDescribeFlags ¶ added in v0.3.0
type OrgUserDescribeFlags struct {
CommandFlags
UserID string `flag:"user-id" desc:"User ID to describe. Pass 'me' for the authenticated user." oneof:"user-ref"`
UserEmail string `flag:"user-email" desc:"Email of the user to describe." oneof:"user-ref"`
}
type OrgUserList ¶ added in v0.3.0
type OrgUserList struct {
Items []managementapi.UserInfo `json:"items"`
}
OrgUserList is the JSON output of `baseten org user list`: the users aggregated across all pages.
type OrgUserListFlags ¶ added in v0.3.0
type OrgUserListFlags struct {
CommandFlags
}
type PromotionSettingsOverrideFlags ¶ added in v1.6.0
type PromotionSettingsOverrideFlags struct {
OverrideRedeployOnPromotion OptionalFlag[bool] `` /* 173-byte string literal not displayed */
OverrideRollingDeploy OptionalFlag[bool] `` /* 134-byte string literal not displayed */
OverridePromotionCleanupStrategy OptionalFlag[string] `` /* 186-byte string literal not displayed */
OverrideRollingDeployStrategy OptionalFlag[string] `` /* 142-byte string literal not displayed */
OverrideMaxSurgePercent OptionalFlag[int] `` /* 142-byte string literal not displayed */
OverrideStabilizationTimeSeconds OptionalFlag[int] `` /* 157-byte string literal not displayed */
OverrideReplicaOverheadPercent OptionalFlag[int] `` /* 152-byte string literal not displayed */
}
PromotionSettingsOverrideFlags is the --override-* flag set for `baseten model deployment promote` and `baseten model push`: promotion settings for one promotion only.
type RequestBackpressureFlags ¶ added in v0.4.0
type RequestBackpressureFlags struct {
Policy OptionalFlag[string] `` /* 157-byte string literal not displayed */
}
RequestBackpressureFlags is the shared policy flag for `baseten model deployment update-request-backpressure` and its environment twin. Passing null clears an existing policy, which the API treats as distinct from omitting the field.
type SSHProxyFlags ¶ added in v0.3.0
type SSHProxyFlags struct {
CommandFlags
DefaultProfile string `` /* 136-byte string literal not displayed */
}
SSHProxyFlags configures `baseten ssh proxy`. The workload hostname is a positional argument.
type SSHSetupFlags ¶ added in v0.3.0
type SSHSetupFlags struct {
CommandFlags
}
SSHSetupFlags configures `baseten ssh setup`.
type SSHSetupResult ¶ added in v0.3.0
type SSHSetupResult struct {
KeyPath string `json:"key_path"`
KeyReused bool `json:"key_reused"`
Profile string `json:"profile,omitempty"`
}
SSHSetupResult is the JSON output of `baseten ssh setup`.
type SSHSignFlags ¶ added in v0.3.0
type SSHSignFlags struct {
CommandFlags
DefaultProfile string `` /* 136-byte string literal not displayed */
}
SSHSignFlags configures `baseten ssh sign`. The workload hostname is a positional argument.
type SandboxConnectFlags ¶ added in v1.2.0
type SandboxConnectFlags struct {
CommandFlags
SandboxRefFlags
}
SandboxConnectFlags configures 'baseten sandbox connect'.
type SandboxCreateFlags ¶ added in v1.2.0
type SandboxCreateFlags struct {
CommandFlags
SandboxEnvFlags
SandboxLifecycleFlags
Name string `flag:"name" desc:"Unique name of the sandbox. The server generates one when omitted."`
Team string `` /* 171-byte string literal not displayed */
IfNotExists bool `` /* 152-byte string literal not displayed */
Region string `flag:"region" desc:"Region to create the sandbox in."`
Memory int `flag:"memory" desc:"Memory in MB. When --cpu is not set, also determines the CPU allocation."`
CPU int `flag:"cpu" desc:"Number of vCPUs, from 1 to 32. Defaults to an allocation derived from memory."`
FileSystemMaxMemoryUsage string `` /* 158-byte string literal not displayed */
Image string `flag:"image" desc:"Image to create the sandbox from, including its tag, such as my-image:latest."`
Label []string `flag:"label" desc:"Label as KEY=VALUE. Repeatable."`
Volume []string `` /* 260-byte string literal not displayed */
}
SandboxCreateFlags configures 'baseten sandbox create'. Unset flags are left out of the request, so the server applies its defaults.
type SandboxDeleteFlags ¶ added in v1.2.0
type SandboxDeleteFlags struct {
CommandFlags
SandboxRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
SandboxDeleteFlags configures 'baseten sandbox delete'.
type SandboxDescribeFlags ¶ added in v1.2.0
type SandboxDescribeFlags struct {
CommandFlags
SandboxRefFlags
}
SandboxDescribeFlags configures 'baseten sandbox describe'.
type SandboxEnvFlags ¶ added in v1.2.0
type SandboxEnvFlags struct {
Env []string `flag:"env" desc:"Secret environment variable as KEY=VALUE, masked when read back. Repeatable."`
PlainEnv []string `flag:"plain-env" desc:"Environment variable that is not secret, as KEY=VALUE, readable when read back. Repeatable."`
}
SandboxEnvFlags set a sandbox's environment variables.
type SandboxExecFlags ¶ added in v1.2.0
type SandboxExecFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessOptionFlags
Stdin bool `` /* 200-byte string literal not displayed */
}
SandboxExecFlags configures 'baseten sandbox exec'.
type SandboxImageDeleteFlags ¶ added in v1.2.0
type SandboxImageDeleteFlags struct {
CommandFlags
SandboxImageRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
SandboxImageDeleteFlags configures 'baseten sandbox image delete'.
type SandboxImageLibraryList ¶ added in v1.2.0
type SandboxImageLibraryList struct {
Items []managementapi.SandboxLibraryImage `json:"items"`
}
SandboxImageLibraryList is the JSON shape of 'baseten sandbox image list-library'.
type SandboxImageList ¶ added in v1.2.0
type SandboxImageList struct {
Items []managementapi.SandboxImage `json:"items"`
}
SandboxImageList is the JSON shape of 'baseten sandbox image list'.
type SandboxImageListFlags ¶ added in v1.2.0
type SandboxImageListFlags struct {
CommandFlags
Team string `` /* 164-byte string literal not displayed */
Limit int `flag:"limit" desc:"Most images to list. 0 lists all." default:"1000"`
}
SandboxImageListFlags configures 'baseten sandbox image list'.
type SandboxImageListLibraryFlags ¶ added in v1.2.0
type SandboxImageListLibraryFlags struct {
CommandFlags
}
SandboxImageListLibraryFlags configures 'baseten sandbox image list-library'.
type SandboxImageLogsFlags ¶ added in v1.2.0
type SandboxImageLogsFlags struct {
CommandFlags
SandboxImageRefFlags
Start time.Time `flag:"start" desc:"Earliest log time to print, such as 2026-10-05T15:04:05Z."`
End time.Time `flag:"end" desc:"Latest log time to print, such as 2026-10-05T15:04:05Z."`
}
SandboxImageLogsFlags configures 'baseten sandbox image logs'.
type SandboxImagePushFlags ¶ added in v1.2.0
type SandboxImagePushFlags struct {
CommandFlags
SandboxImageRefFlags
Dir string `flag:"dir" desc:"Directory to build the image from, with a Dockerfile at its root." oneof:"image-source"`
RegistryImage string `flag:"registry-image" desc:"Registry image reference to import, such as registry.example.com/app:v1." oneof:"image-source"`
DockerConfig string `` /* 127-byte string literal not displayed */
Memory int `` /* 218-byte string literal not displayed */
Volume int `` /* 269-byte string literal not displayed */
Wait bool `flag:"wait" desc:"Wait until the image is built. Exits non-zero if the build fails. Does not stop the build if interrupted."`
}
SandboxImagePushFlags configures 'baseten sandbox image push'.
type SandboxImageRefCommandFlags ¶ added in v1.2.0
type SandboxImageRefCommandFlags struct {
CommandFlags
SandboxImageRefFlags
}
SandboxImageRefCommandFlags configures the commands that only select an image: 'baseten sandbox image describe' and 'list-tags'.
type SandboxImageRefFlags ¶ added in v1.2.0
type SandboxImageRefFlags struct {
Name string `flag:"name" desc:"Name of the image." required:"true"`
Team string `` /* 167-byte string literal not displayed */
}
SandboxImageRefFlags selects one image.
type SandboxImageTagList ¶ added in v1.2.0
type SandboxImageTagList struct {
Items []managementapi.SandboxImageTag `json:"items"`
}
SandboxImageTagList is the JSON shape of 'baseten sandbox image list-tags'.
type SandboxLifecycleFlags ¶ added in v1.4.0
type SandboxLifecycleFlags struct {
IdleTTL time.Duration `flag:"idle-ttl" desc:"Delete the sandbox after it has been idle this long, such as 30m or 2d."`
MaxAge time.Duration `flag:"max-age" desc:"Delete the sandbox once it is this old, such as 12h or 7d."`
ExpiresAt time.Time `flag:"expires-at" desc:"Delete the sandbox at this time. ISO 8601, local when no timezone is given."`
TerminatedRetention time.Duration `` /* 154-byte string literal not displayed */
}
SandboxLifecycleFlags set when a sandbox is deleted automatically.
type SandboxList ¶ added in v1.2.0
type SandboxList struct {
Items []managementapi.Sandbox `json:"items"`
}
SandboxList is the JSON shape of 'baseten sandbox list'.
type SandboxListFlags ¶ added in v1.2.0
type SandboxListFlags struct {
CommandFlags
Team string `` /* 167-byte string literal not displayed */
Query string `flag:"query" desc:"Free-text search over sandbox names and labels."`
Status []string `` /* 203-byte string literal not displayed */
Limit int `flag:"limit" desc:"Most sandboxes to list. 0 lists all." default:"1000"`
}
SandboxListFlags configures 'baseten sandbox list'.
type SandboxPreviewCreateFlags ¶ added in v1.4.0
type SandboxPreviewCreateFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewHeaderFlags
SandboxPreviewExpiryFlags
Port int `flag:"port" desc:"Sandbox port to expose." required:"true"`
PreviewName string `flag:"preview-name" desc:"Name of the preview, unique within the sandbox. The server generates one when omitted."`
Public bool `flag:"public" desc:"Make the URL reachable without a token."`
IfNotExists bool `flag:"if-not-exists" desc:"Return the existing preview with this name, unchanged, instead of failing."`
}
SandboxPreviewCreateFlags configures 'baseten sandbox preview create'. Unset flags are left out of the request, so the server applies its defaults.
type SandboxPreviewDeleteFlags ¶ added in v1.4.0
type SandboxPreviewDeleteFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
SandboxPreviewDeleteFlags configures 'baseten sandbox preview delete'.
type SandboxPreviewDescribeFlags ¶ added in v1.4.0
type SandboxPreviewDescribeFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
ShowSecrets bool `` /* 138-byte string literal not displayed */
}
SandboxPreviewDescribeFlags configures 'baseten sandbox preview describe'.
type SandboxPreviewExpiryFlags ¶ added in v1.4.0
type SandboxPreviewExpiryFlags struct {
TTL time.Duration `flag:"ttl" desc:"Delete the preview this long from now, such as 24h or 7d. Cannot be combined with --expires-at."`
ExpiresAt time.Time `` /* 131-byte string literal not displayed */
}
SandboxPreviewExpiryFlags set when a preview is deleted automatically.
type SandboxPreviewHeaderFlags ¶ added in v1.4.0
type SandboxPreviewHeaderFlags struct {
ResponseHeader []string `` /* 129-byte string literal not displayed */
RequestHeader []string `` /* 182-byte string literal not displayed */
}
SandboxPreviewHeaderFlags set the headers a preview adds.
type SandboxPreviewList ¶ added in v1.4.0
type SandboxPreviewList struct {
Items []managementapi.SandboxPreview `json:"items"`
}
SandboxPreviewList is the JSON shape of 'baseten sandbox preview list'.
type SandboxPreviewListFlags ¶ added in v1.4.0
type SandboxPreviewListFlags struct {
CommandFlags
SandboxRefFlags
Limit int `flag:"limit" desc:"Most previews to list. 0 lists all." default:"1000"`
}
SandboxPreviewListFlags configures 'baseten sandbox preview list'.
type SandboxPreviewRefFlags ¶ added in v1.4.0
type SandboxPreviewRefFlags struct {
PreviewName string `flag:"preview-name" desc:"Name of the preview." required:"true"`
}
SandboxPreviewRefFlags selects one preview of the sandbox --name selects.
type SandboxPreviewTokenCreateFlags ¶ added in v1.4.0
type SandboxPreviewTokenCreateFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
ExpiresAt time.Time `flag:"expires-at" desc:"Time the token stops working. ISO 8601, local when no timezone is given." required:"true"`
IfNotExists bool `` /* 237-byte string literal not displayed */
}
SandboxPreviewTokenCreateFlags configures 'baseten sandbox preview token create'.
type SandboxPreviewTokenDeleteFlags ¶ added in v1.4.0
type SandboxPreviewTokenDeleteFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
TokenName string `flag:"token-name" desc:"Name of the token." required:"true"`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
SandboxPreviewTokenDeleteFlags configures 'baseten sandbox preview token delete'.
type SandboxPreviewTokenList ¶ added in v1.4.0
type SandboxPreviewTokenList struct {
Items []managementapi.SandboxPreviewToken `json:"items"`
}
SandboxPreviewTokenList is the JSON shape of 'baseten sandbox preview token list'.
type SandboxPreviewTokenListFlags ¶ added in v1.4.0
type SandboxPreviewTokenListFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
}
SandboxPreviewTokenListFlags configures 'baseten sandbox preview token list'.
type SandboxPreviewUpdateFlags ¶ added in v1.4.0
type SandboxPreviewUpdateFlags struct {
CommandFlags
SandboxRefFlags
SandboxPreviewRefFlags
SandboxPreviewExpiryFlags
ResponseHeader []string `` /* 155-byte string literal not displayed */
RequestHeader []string `` /* 158-byte string literal not displayed */
Public bool `flag:"public" desc:"Make the URL reachable without a token. Cannot be combined with --private."`
Private bool `flag:"private" desc:"Require a token to reach the URL. Cannot be combined with --public."`
}
SandboxPreviewUpdateFlags configures 'baseten sandbox preview update'. Unset flags leave their fields unchanged.
type SandboxProcessDescribeFlags ¶ added in v1.2.0
type SandboxProcessDescribeFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessRefFlags
}
SandboxProcessDescribeFlags configures 'baseten sandbox process describe'.
type SandboxProcessList ¶ added in v1.2.0
type SandboxProcessList struct {
Items []sandboxapi.ProcessResponse `json:"items"`
}
SandboxProcessList is the JSON shape of 'baseten sandbox process list'.
type SandboxProcessListFlags ¶ added in v1.2.0
type SandboxProcessListFlags struct {
CommandFlags
SandboxRefFlags
}
SandboxProcessListFlags configures 'baseten sandbox process list'.
type SandboxProcessLogLine ¶ added in v1.2.0
type SandboxProcessLogLine struct {
Stream string `json:"stream,omitempty"`
Text string `json:"text"`
}
SandboxProcessLogLine is one line of 'baseten sandbox process logs'. The API streams process output as plain text, so it has no type of its own.
type SandboxProcessLogsFlags ¶ added in v1.2.0
type SandboxProcessLogsFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessRefFlags
Tail bool `` /* 204-byte string literal not displayed */
}
SandboxProcessLogsFlags configures 'baseten sandbox process logs'.
type SandboxProcessOptionFlags ¶ added in v1.2.0
type SandboxProcessOptionFlags struct {
Env []string `flag:"env" desc:"Environment variable for the command as KEY=VALUE, on top of the sandbox's own. Repeatable."`
WorkingDir string `flag:"working-dir" desc:"Directory to run the command in."`
Timeout time.Duration `flag:"timeout" desc:"Stop the command if it runs longer than this, such as 10m."`
ProcessName string `flag:"process-name" desc:"Name for the process, to find it later with --process-name."`
}
SandboxProcessOptionFlags configure a process that 'baseten sandbox exec' or 'baseten sandbox process start' runs.
type SandboxProcessRefCommandFlags ¶ added in v1.2.0
type SandboxProcessRefCommandFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessRefFlags
}
SandboxProcessRefCommandFlags configures the commands that only select a process: 'baseten sandbox process stop' and 'kill'.
type SandboxProcessRefFlags ¶ added in v1.2.0
type SandboxProcessRefFlags struct {
PID string `flag:"pid" desc:"PID of the process." oneof:"process-ref"`
ProcessName string `flag:"process-name" desc:"Name the process was started with." oneof:"process-ref"`
}
SandboxProcessRefFlags select one process in a sandbox.
type SandboxProcessStartFlags ¶ added in v1.2.0
type SandboxProcessStartFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessOptionFlags
KeepAlive bool `flag:"keep-alive" desc:"Keep the sandbox from going to sleep while the process runs."`
RestartOnFailure bool `flag:"restart-on-failure" desc:"Restart the process when it exits with a failure."`
MaxRestarts int `flag:"max-restarts" desc:"Most restarts with --restart-on-failure."`
WaitForPort []string `flag:"wait-for-port" desc:"Return only once the process listens on this port. Repeatable."`
}
SandboxProcessStartFlags configures 'baseten sandbox process start'.
type SandboxProcessWaitFlags ¶ added in v1.2.0
type SandboxProcessWaitFlags struct {
CommandFlags
SandboxRefFlags
SandboxProcessRefFlags
Timeout time.Duration `flag:"timeout" desc:"Fail if the process has not exited after this long, such as 30m. The process keeps running."`
}
SandboxProcessWaitFlags configures 'baseten sandbox process wait'.
type SandboxRefFlags ¶ added in v1.2.0
type SandboxRefFlags struct {
Name string `flag:"name" desc:"Name of the sandbox." required:"true"`
Team string `` /* 169-byte string literal not displayed */
}
SandboxRefFlags selects one sandbox.
type SandboxUpdateFlags ¶ added in v1.2.0
type SandboxUpdateFlags struct {
CommandFlags
SandboxRefFlags
SandboxEnvFlags
SandboxLifecycleFlags
Label []string `` /* 130-byte string literal not displayed */
ClearLabels bool `flag:"clear-labels" desc:"Remove all of the sandbox's labels. Cannot be combined with --label."`
}
SandboxUpdateFlags configures 'baseten sandbox update'. Unset flags leave their fields unchanged.
type SandboxVolumeCreateFlags ¶ added in v1.6.0
type SandboxVolumeCreateFlags struct {
CommandFlags
Name string `flag:"name" desc:"Unique name of the sandbox volume. The server generates one when omitted."`
Team string `` /* 178-byte string literal not displayed */
Size string `flag:"size" desc:"Capacity, as a size (10Gi) or Mi (10240). It can grow later but never shrink." required:"true"`
Region string `` /* 138-byte string literal not displayed */
Label []string `flag:"label" desc:"Label as KEY=VALUE. Repeatable."`
}
SandboxVolumeCreateFlags configures 'baseten sandbox volume create'. Unset flags are left out of the request, so the server applies its defaults.
type SandboxVolumeDeleteFlags ¶ added in v1.6.0
type SandboxVolumeDeleteFlags struct {
CommandFlags
SandboxVolumeRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
SandboxVolumeDeleteFlags configures 'baseten sandbox volume delete'.
type SandboxVolumeList ¶ added in v1.6.0
type SandboxVolumeList struct {
Items []managementapi.SandboxVolume `json:"items"`
}
SandboxVolumeList is the JSON shape of 'baseten sandbox volume list'.
type SandboxVolumeListFlags ¶ added in v1.6.0
type SandboxVolumeListFlags struct {
CommandFlags
Team string `` /* 173-byte string literal not displayed */
Query string `flag:"query" desc:"Search over sandbox volume names."`
Status []string `flag:"status" desc:"Only sandbox volumes with one of these statuses. Repeatable." enum:"deleting,deployed,deploying,failed"`
Limit int `flag:"limit" desc:"Most sandbox volumes to list. 0 lists all." default:"1000"`
}
SandboxVolumeListFlags configures 'baseten sandbox volume list'.
type SandboxVolumeRefCommandFlags ¶ added in v1.6.0
type SandboxVolumeRefCommandFlags struct {
CommandFlags
SandboxVolumeRefFlags
}
SandboxVolumeRefCommandFlags configures the commands that only select a sandbox volume: 'baseten sandbox volume describe'.
type SandboxVolumeRefFlags ¶ added in v1.6.0
type SandboxVolumeRefFlags struct {
Name string `flag:"name" desc:"Name of the sandbox volume." required:"true"`
Team string `` /* 176-byte string literal not displayed */
}
SandboxVolumeRefFlags selects one sandbox volume.
type SandboxVolumeUpdateFlags ¶ added in v1.6.0
type SandboxVolumeUpdateFlags struct {
CommandFlags
SandboxVolumeRefFlags
Size string `flag:"size" desc:"New capacity, as a size (20Gi) or Mi (20480), no less than the current capacity."`
Label []string `` /* 137-byte string literal not displayed */
ClearLabels bool `flag:"clear-labels" desc:"Remove all of the sandbox volume's labels. Cannot be combined with --label."`
}
SandboxVolumeUpdateFlags configures 'baseten sandbox volume update'. Unset flags leave their fields unchanged.
type TrainCapacityDescribeFlags ¶ added in v0.4.0
type TrainCapacityDescribeFlags struct {
CommandFlags
}
TrainCapacityDescribeFlags configures `baseten train capacity describe`.
type TrainCapacityUpdateFlags ¶ added in v0.4.0
type TrainCapacityUpdateFlags struct {
CommandFlags
Team string `flag:"team" desc:"Team name or ID whose limit changes. Run 'baseten org team list' to see teams." required:"true"`
GPUType string `flag:"gpu-type" desc:"GPU type the limit applies to (for example H100)." required:"true"`
MaxGPUs int `flag:"max-gpus" desc:"Maximum concurrent GPUs of this type the team may use." required:"true"`
}
TrainCapacityUpdateFlags configures `baseten train capacity update`.
type TrainCheckpointDeployFlags ¶ added in v0.4.0
type TrainCheckpointDeployFlags struct {
CommandFlags
TrussAuthFlags
JobID string `flag:"job-id" desc:"Training job whose checkpoints are deployed. Required unless --config names them."`
Config string `` /* 223-byte string literal not displayed */
ConfigOutDir string `` /* 127-byte string literal not displayed */
DryRun bool `flag:"dry-run" desc:"Write the generated model config without deploying anything."`
}
TrainCheckpointDeployFlags configures `baseten train checkpoint deploy`. The job is optional here, unlike TrainJobRefFlags, because a config file can name the checkpoints on its own.
type TrainCheckpointFilesFlags ¶ added in v0.4.0
type TrainCheckpointFilesFlags struct {
CommandFlags
TrainJobRefFlags
}
TrainCheckpointFilesFlags configures `baseten train checkpoint files`.
type TrainCheckpointListFlags ¶ added in v0.4.0
type TrainCheckpointListFlags struct {
CommandFlags
TrainJobRefFlags
Direction string `` /* 130-byte string literal not displayed */
}
TrainCheckpointListFlags configures `baseten train checkpoint list`.
type TrainInitFlags ¶ added in v0.4.0
type TrainInitFlags struct {
CommandFlags
// Scaffolding writes files and downloads public examples, so no credential
// is forwarded and TrussFlags is embedded rather than TrussAuthFlags.
TrussFlags
Dir string `` /* 141-byte string literal not displayed */
Example []string `flag:"example" desc:"Name of a published training example to download instead of the empty template. Repeatable."`
ListExamples bool `flag:"list-examples" desc:"List the available example names and exit."`
}
TrainInitFlags configures `baseten train init`.
type TrainJobDescribeFlags ¶ added in v0.4.0
type TrainJobDescribeFlags struct {
CommandFlags
TrainJobRefFlags
}
TrainJobDescribeFlags configures `baseten train job describe`.
type TrainJobDownloadFlags ¶ added in v0.4.0
type TrainJobDownloadFlags struct {
CommandFlags
TrainJobRefFlags
OutFile string `flag:"out-file" desc:"Save the artifact as an uncompressed tar file at this path." oneof:"download-out"`
OutDir string `flag:"out-dir" desc:"Extract the artifact tar into this directory." oneof:"download-out"`
Overwrite bool `flag:"overwrite" desc:"Allow overwriting an existing file or non-empty directory."`
}
TrainJobDownloadFlags configures `baseten train job download`.
type TrainJobDownloadResult ¶ added in v0.4.0
type TrainJobDownloadResult struct {
JobID string `json:"job_id"`
OutFile string `json:"out_file,omitempty"`
OutDir string `json:"out_dir,omitempty"`
}
TrainJobDownloadResult is the JSON output of `baseten train job download`. The API returns presigned URLs rather than files, so the useful result is what landed on disk, which has no generated equivalent. Exactly one of OutFile or OutDir is set, matching whichever flag the caller passed.
type TrainJobListFlags ¶ added in v0.4.0
type TrainJobListFlags struct {
CommandFlags
Project string `flag:"project" desc:"Only list jobs in this training project, by name or ID."`
Status []string `` /* 156-byte string literal not displayed */
Direction string `` /* 130-byte string literal not displayed */
}
TrainJobListFlags configures `baseten train job list`.
type TrainJobLogsFlags ¶ added in v0.4.0
type TrainJobLogsFlags struct {
CommandFlags
TrainJobRefFlags
TrainLogFlags
}
TrainJobLogsFlags configures `baseten train job logs`.
type TrainJobMetricsFlags ¶ added in v0.4.0
type TrainJobMetricsFlags struct {
CommandFlags
TrainJobRefFlags
Start time.Time `` /* 141-byte string literal not displayed */
End time.Time `` /* 153-byte string literal not displayed */
Since time.Duration `` /* 184-byte string literal not displayed */
}
TrainJobMetricsFlags configures `baseten train job metrics`.
type TrainJobRecreateFlags ¶ added in v0.4.0
type TrainJobRecreateFlags struct {
CommandFlags
TrainJobRefFlags
}
TrainJobRecreateFlags configures `baseten train job recreate`.
type TrainJobRefFlags ¶ added in v0.4.0
type TrainJobRefFlags struct {
JobID string `flag:"job-id" desc:"ID of the training job." required:"true"`
}
TrainJobRefFlags identifies a training job. The project is resolved from the job ID, so callers never pass one: every job endpoint is nested under a project, but the search endpoint returns the owning project with the job.
type TrainJobSessionDescribeFlags ¶ added in v0.4.0
type TrainJobSessionDescribeFlags struct {
CommandFlags
TrainJobRefFlags
}
TrainJobSessionDescribeFlags configures `baseten train job session describe`.
type TrainJobStopFlags ¶ added in v0.4.0
type TrainJobStopFlags struct {
CommandFlags
TrainJobRefFlags
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
TrainJobStopFlags configures `baseten train job stop`.
type TrainJobUpdateFlags ¶ added in v0.4.0
type TrainJobUpdateFlags struct {
CommandFlags
TrainJobRefFlags
Priority int `flag:"priority" desc:"New queue priority. Higher values are dequeued first."`
AvailabilityModel string `` /* 239-byte string literal not displayed */
}
TrainJobUpdateFlags configures `baseten train job update`.
type TrainLogFlags ¶ added in v0.4.0
type TrainLogFlags struct {
Tail bool `` /* 244-byte string literal not displayed */
Start time.Time `` /* 278-byte string literal not displayed */
End time.Time `` /* 185-byte string literal not displayed */
Since time.Duration `` /* 203-byte string literal not displayed */
Limit int `` /* 196-byte string literal not displayed */
// PageSize is the per-request fetch size while paging. Hidden; exists so
// tests can force multiple pages without generating a full page of logs.
PageSize int `flag:"page-size" hidden:"true" desc:"Log lines fetched per backend request while paging." default:"1000"`
MinLevel string `flag:"min-level" desc:"Only return logs at or above this severity level." enum:"debug,info,warning,error"`
}
TrainLogFlags is the log-query flag set for `baseten train job logs`. Like Loops, the training logs endpoint supports only the window, limit, and severity filters, so the message and replica filters that model deployment logs accept are not offered here.
type TrainProjectCacheDescribeFlags ¶ added in v0.4.0
type TrainProjectCacheDescribeFlags struct {
CommandFlags
Project string `flag:"project" desc:"Training project to describe, by name or ID." required:"true"`
Sort string `flag:"sort" desc:"Sort the listing by 'size' (largest first) or 'path' (alphabetical)." enum:"size,path" default:"size"`
}
TrainProjectCacheDescribeFlags configures `baseten train project cache describe`.
type TrainProjectListFlags ¶ added in v0.4.0
type TrainProjectListFlags struct {
CommandFlags
}
TrainProjectListFlags configures `baseten train project list`.
type TrainPushFlags ¶ added in v0.4.0
type TrainPushFlags struct {
CommandFlags
TrussAuthFlags
Config string `flag:"config" desc:"Python file defining the training project and its job." required:"true"`
JobName string `flag:"job-name" desc:"Name for the training job. Defaults to a generated name."`
Team string `flag:"team" desc:"Team name or ID that owns the training project. Run 'baseten org team list' to see teams."`
Accelerator string `` /* 183-byte string literal not displayed */
NodeCount int `flag:"node-count" desc:"Number of compute nodes. Overrides the config."`
Entrypoint string `flag:"entrypoint" desc:"Command the job runs. Overrides the config."`
Priority int `flag:"priority" desc:"Queue priority. Higher values are dequeued first."`
Spot bool `flag:"spot" desc:"Run on interruptible spot capacity, overriding the config. Checkpointing your own progress is up to you."`
Interactive string `flag:"interactive" desc:"Start an interactive session on this trigger." enum:"on-startup,on-failure,on-demand"`
InteractiveTimeout time.Duration `` /* 161-byte string literal not displayed */
}
TrainPushFlags configures `baseten train push`.
type TrainWorkstationCreateFlags ¶ added in v0.4.0
type TrainWorkstationCreateFlags struct {
CommandFlags
TrussAuthFlags
Accelerator string `flag:"accelerator" desc:"GPU accelerator type." default:"H100"`
GPUCount int `flag:"gpu-count" desc:"Number of GPUs on a single node, 1 to 8. Mutually exclusive with --node-count."`
NodeCount int `flag:"node-count" desc:"Number of eight-GPU nodes. Mutually exclusive with --gpu-count."`
Image string `flag:"image" desc:"Docker base image the workstation runs."`
Spot bool `flag:"spot" desc:"Run on interruptible spot capacity."`
Project string `flag:"project" desc:"Training project that owns the workstation. Defaults to 'workstation-<accelerator>'."`
Team string `flag:"team" desc:"Team name or ID that owns the training project. Run 'baseten org team list' to see teams."`
Orchestrator string `flag:"orchestrator" desc:"Multi-node orchestrator set up across the nodes." enum:"slurm" default:"slurm"`
EnableCheckpointing bool `flag:"enable-checkpointing" desc:"Attach checkpoint storage to the workstation."`
CheckpointPath string `flag:"checkpoint-path" desc:"Path inside the container where checkpoints are written."`
CheckpointVolumeSize int `flag:"checkpoint-volume-size" desc:"Size of the checkpoint volume in GiB."`
CheckpointFromJob string `flag:"checkpoint-from-job" desc:"Training job whose latest checkpoint the workstation starts from."`
}
TrainWorkstationCreateFlags configures `baseten train workstation create`.
type TrussAuthFlags ¶ added in v0.4.0
type TrussAuthFlags struct {
TrussFlags
TrussNoForwardAuth bool `` /* 243-byte string literal not displayed */
}
TrussAuthFlags is TrussFlags plus control over credential forwarding. Embedded by delegating commands that call the Baseten API through truss; commands that only run truss locally embed TrussFlags instead.
type TrussDelegatedResult ¶ added in v0.4.0
type TrussDelegatedResult struct{}
TrussDelegatedResult is the JSON output of the commands that delegate to the truss CLI. It is empty: truss reports what it did as human-readable text, so there is nothing structured for the CLI to pass on. Fields land here once truss can report its results machine-readably.
type TrussFlags ¶
type TrussFlags struct {
TrussVersion string `` /* 227-byte string literal not displayed */
TrussExecutable string `` /* 301-byte string literal not displayed */
}
TrussFlags selects which truss the CLI runs. Embedded by every command that shells out to the truss CLI.
type TrussPassthroughFlags ¶ added in v0.4.0
type TrussPassthroughFlags struct {
TrussAuthFlags
}
TrussPassthroughFlags configures `baseten truss`. It carries only the shared truss flags: everything else on the command line belongs to truss. Flag parsing is disabled for this command, so these are extracted from the raw arguments rather than by Cobra, and CommandFlags is deliberately absent since --output, --jq and friends are forwarded to truss like any other argument.
type VersionFlags ¶
type VersionFlags struct {
CommandFlags
}
VersionFlags configures `baseten version`.
type VersionResult ¶
type VersionResult struct {
Version string `json:"version"`
}
VersionResult is the JSON output of `baseten version`.
type VolumeCatFlags ¶ added in v1.0.0
type VolumeCatFlags struct {
CommandFlags
VolumeTransferFlags
VolumeHostingFlags
}
type VolumeEntry ¶ added in v1.0.0
type VolumeEntry struct {
// Path is the entry's path within the version, slash-prefixed and with no
// trailing slash, which is the form a ref takes: appending it to the ref
// this listing was asked for names the entry.
Path string `json:"path"`
// Kind is "file", "directory", or "symlink".
Kind string `json:"kind"`
// SizeBytes is a file's length, and zero for the other kinds.
SizeBytes int64 `json:"size_bytes"`
// Mode is the recorded permission bits in octal, as "0644". Absent for a
// directory the version describes only by the paths beneath it.
Mode string `json:"mode,omitempty"`
// Modified is when the entry was last modified, as recorded at push.
// Absent when the version records none.
Modified *time.Time `json:"modified,omitempty"`
// LinkTarget is a symlink's target exactly as recorded, and absent for
// every other kind. It may point outside the volume.
LinkTarget string `json:"link_target,omitempty"`
}
VolumeEntry is one entry of a version's file tree.
There is deliberately no per-entry digest. A version's digest names the whole tree, and what a file carries depends on its size: one small enough to fit a single chunk carries that chunk's digest, which is its content, while a larger one carries the digest of the document listing its chunks, which is not.
type VolumeEntryDetail ¶ added in v1.0.0
type VolumeEntryDetail struct {
// VersionRef is the version the entry was read from, pinned to its digest.
VersionRef string `json:"version_ref"`
VolumeEntry
}
VolumeEntryDetail is the JSON output of `baseten volume stat` for a ref that carries a path.
type VolumeEntryList ¶ added in v1.0.0
type VolumeEntryList struct {
// VersionRef is the version the entries were read from, pinned to its
// digest, so the same listing can be read again.
VersionRef string `json:"version_ref"`
Items []VolumeEntry `json:"items"`
}
VolumeEntryList is the JSON output of `baseten volume ls` for a ref that names a volume or a version.
type VolumeHostingFlags ¶
type VolumeHostingFlags struct {
Hosting string `` /* 266-byte string literal not displayed */
}
VolumeHostingFlags chooses where the volumes a command addresses are stored. The same name in two hostings is two different volumes.
type VolumeList ¶ added in v1.0.0
type VolumeList struct {
Items []managementapi.Volume `json:"items"`
}
VolumeList is the JSON output of `baseten volume ls` for a namespace ref: the namespace's volumes aggregated across all pages.
type VolumeLsFlags ¶ added in v1.0.0
type VolumeLsFlags struct {
CommandFlags
VolumeHostingFlags
Recursive bool `flag:"recursive" short:"R" desc:"List every entry beneath the ref instead of only its immediate children."`
}
type VolumeNamespaceList ¶ added in v1.0.0
type VolumeNamespaceList struct {
Items []string `json:"items"`
}
VolumeNamespaceList is the JSON output of `baseten volume ls` with no ref: the namespaces aggregated across all pages.
type VolumePullFlags ¶ added in v1.0.0
type VolumePullFlags struct {
CommandFlags
VolumeRefFlags
VolumeTransferFlags
VolumeHostingFlags
Overwrite bool `` /* 136-byte string literal not displayed */
Include []string `` /* 287-byte string literal not displayed */
Restart bool `flag:"restart" desc:"Discard a partly downloaded tree from an earlier attempt instead of continuing it."`
StripPrefix bool `` /* 167-byte string literal not displayed */
}
type VolumePullResult ¶ added in v1.0.0
type VolumePullResult struct {
// AverageBytesPerSecond divides transferred payload by the transfer phase
// duration. Zero is reported when no positive duration is available.
AverageBytesPerSecond float64 `json:"average_bytes_per_second"`
// DurationSeconds is total elapsed SDK transfer time, including setup and finalization.
DurationSeconds float64 `json:"duration_seconds"`
// VersionRef is the version that was downloaded, pinned to its digest.
VersionRef string `json:"version_ref"`
DestDir string `json:"dest_dir"`
Files int64 `json:"files"`
Bytes int64 `json:"bytes"`
// SelectedFiles and TotalFiles report what a path or --include narrowed
// to, and are equal when the whole version was downloaded.
SelectedFiles int64 `json:"selected_files"`
TotalFiles int64 `json:"total_files"`
// ChunksFetched counts the chunks this download transferred; ChunksReused
// counts those already on disk from an earlier attempt.
ChunksFetched int64 `json:"chunks_fetched"`
ChunksReused int64 `json:"chunks_reused"`
// Warnings are containment findings that did not stop the download, which
// only volumes published before the containment rule carry.
Warnings []string `json:"warnings"`
}
VolumePullResult is the JSON output of `baseten volume pull`.
type VolumePushFlags ¶ added in v1.0.0
type VolumePushFlags struct {
CommandFlags
VolumeRefFlags
VolumeTransferFlags
VolumeHostingFlags
Tags []string `flag:"tag" desc:"Tag to apply to the new version at commit. May be repeated, and adds to a tag written on REF."`
SourceURI string `` /* 228-byte string literal not displayed */
FileJobs int `flag:"file-jobs" desc:"Number of files processed concurrently. Defaults to 16." group:"transfer"`
}
type VolumePushResult ¶ added in v1.0.0
type VolumePushResult struct {
// AverageBytesPerSecond divides transferred payload by the transfer phase
// duration. Zero is reported when no positive duration is available.
AverageBytesPerSecond float64 `json:"average_bytes_per_second"`
// DurationSeconds is total elapsed SDK transfer time, including setup and finalization.
DurationSeconds float64 `json:"duration_seconds"`
// VersionRef is the published version, pinned to its digest, which is what
// config.yaml takes to mount exactly this tree.
VersionRef string `json:"version_ref"`
Sequence int64 `json:"sequence"`
// HeadUpdated is false when head already pointed at this exact version,
// which is what re-pushing an unchanged tree does. HeadMoveDenied means
// the version was published but head was left where it was, because the
// credential's grants did not cover moving it.
HeadUpdated bool `json:"head_updated"`
HeadMoveDenied bool `json:"head_move_denied"`
TagsApplied []string `json:"tags_applied"`
Files int64 `json:"files"`
Bytes int64 `json:"bytes"`
// Chunks counts every chunk the push accounted for, and the three below
// partition it: ChunksUnique were uploaded, ChunksReused never reached the
// network because a previous version or an earlier file in this push
// already had those bytes, and ChunksExisting were offered and the volume
// already had them.
Chunks int64 `json:"chunks"`
ChunksUnique int64 `json:"chunks_unique"`
ChunksReused int64 `json:"chunks_reused"`
ChunksExisting int64 `json:"chunks_existing"`
}
VolumePushResult is the JSON output of `baseten volume push`.
type VolumeRefFlags ¶ added in v1.0.0
type VolumeRefFlags struct {
FullRef bool `flag:"full-ref" desc:"Write refs with the whole digest instead of shortening it to 12 hex characters."`
}
VolumeRefFlags chooses how wide a ref a command writes in text output. Text output shortens the digest inside a ref so the ref does not crowd out the fields beside it; a shortened ref still names the same version and still parses, and a digest a command writes on its own is never shortened.
type VolumeRestoreFlags ¶ added in v1.0.0
type VolumeRestoreFlags struct {
CommandFlags
VolumeRefFlags
VolumeHostingFlags
}
type VolumeRmFlags ¶ added in v1.0.0
type VolumeRmFlags struct {
CommandFlags
VolumeRefFlags
VolumeHostingFlags
Recursive bool `` /* 138-byte string literal not displayed */
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
type VolumeStatFlags ¶ added in v1.0.0
type VolumeStatFlags struct {
CommandFlags
VolumeRefFlags
VolumeHostingFlags
}
type VolumeSyncIDFlags ¶ added in v1.1.0
type VolumeSyncIDFlags struct {
CommandFlags
SyncID string `flag:"sync-id" desc:"ID of the volume sync operation." required:"true"`
}
type VolumeSyncList ¶ added in v1.1.0
type VolumeSyncList struct {
Items []managementapi.VolumeSync `json:"items"`
}
type VolumeSyncListFlags ¶ added in v1.1.0
type VolumeSyncListFlags struct {
CommandFlags
Destination string `flag:"dest" desc:"Only return syncs whose destination exactly matches this ref."`
}
type VolumeSyncStartFlags ¶ added in v1.1.0
type VolumeSyncStartFlags struct {
CommandFlags
VolumeHostingFlags
Source string `` /* 130-byte string literal not displayed */
Destination string `flag:"dest" desc:"Destination ref as bdn:<namespace>/<volume>, with an optional :<tag>." required:"true"`
Include []string `flag:"include" desc:"Glob selecting source-relative files to include. May be repeated."`
Exclude []string `flag:"exclude" desc:"Glob selecting source-relative files to exclude. May be repeated."`
AuthSecretName string `` /* 169-byte string literal not displayed */
AuthHFOIDCResource string `` /* 234-byte string literal not displayed */
AuthAWSAssumeRoleARN string `` /* 139-byte string literal not displayed */
AuthAWSAssumeRoleRegion string `` /* 140-byte string literal not displayed */
AuthAWSOIDCRoleARN string `` /* 153-byte string literal not displayed */
AuthAWSOIDCRegion string `` /* 130-byte string literal not displayed */
AuthGCPOIDCServiceAccount string `` /* 187-byte string literal not displayed */
AuthGCPOIDCWorkloadIdentityProvider string `` /* 170-byte string literal not displayed */
Wait bool `` /* 126-byte string literal not displayed */
}
type VolumeTagDeleteFlags ¶ added in v1.4.0
type VolumeTagDeleteFlags struct {
CommandFlags
VolumeHostingFlags
VolumeRef string `` /* 137-byte string literal not displayed */
Tag string `flag:"tag" desc:"Tag to delete. May be 'head'." required:"true"`
Yes bool `flag:"yes" desc:"Skip confirmation for 'head'. Required when stdin is not a terminal and --tag is 'head'."`
}
type VolumeTagSetFlags ¶ added in v1.4.0
type VolumeTagSetFlags struct {
CommandFlags
VolumeRefFlags
VolumeHostingFlags
VolumeRef string `` /* 184-byte string literal not displayed */
Tag string `flag:"tag" desc:"Tag to point at the version. May be 'head'." required:"true"`
ExpiresAt string `` /* 280-byte string literal not displayed */
Yes bool `flag:"yes" desc:"Skip confirmation for 'head'. Required when stdin is not a terminal and --tag is 'head'."`
}
type VolumeTransferFlags ¶ added in v1.0.0
type VolumeTransferFlags struct {
ChunkOperations int `` /* 188-byte string literal not displayed */
MaxInFlightMiB int `flag:"max-in-flight-mib" desc:"Cap on the chunk data held in memory, in MiB. Defaults to 2048." group:"transfer"`
}
VolumeTransferFlags bounds the data path of a push, pull, or cat. The limits default to what the transfer picks for itself; set them to cap the load on a shared machine or a metered link.
type VolumeUpdateFlags ¶ added in v1.4.0
type VolumeUpdateFlags struct {
CommandFlags
VolumeHostingFlags
ExpiresAt string `` /* 203-byte string literal not displayed */
ClearExpiresAt bool `flag:"clear-expires-at" desc:"Clear the volume's expiration time." oneof:"expiration"`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
type VolumeVersionsFlags ¶ added in v1.0.0
type VolumeVersionsFlags struct {
CommandFlags
VolumeHostingFlags
IncludeTombstoned bool `flag:"include-tombstoned" desc:"Include deleted versions that are still inside their recovery window."`
}
type WhoamiFlags ¶ added in v0.3.0
type WhoamiFlags struct {
CommandFlags
}
WhoamiFlags configures `baseten whoami`.
Source Files
¶
- command.api.go
- command.auth.go
- command.go
- command.grid.go
- command.grid_machine_user.go
- command.grid_route.go
- command.loops.go
- command.model.go
- command.model_api.go
- command.model_deployment.go
- command.model_deployment_replica.go
- command.model_environment.go
- command.model_environment_autoscaling_schedule.go
- command.model_environment_traffic_rule.go
- command.model_image.go
- command.org.go
- command.org_identity_provider.go
- command.org_role.go
- command.org_role_assignment.go
- command.org_service_account.go
- command.org_trust_rule.go
- command.sandbox.go
- command.sandbox_image.go
- command.sandbox_preview.go
- command.sandbox_process.go
- command.sandbox_volume.go
- command.ssh.go
- command.train.go
- command.truss.go
- command.version.go
- command.volume.go
- command.volume_sync.go
- command.whoami.go
- errors.go
- output.go