cmd

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
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

View Source
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,
		commandHarness,
		commandLoops,
		commandModel,
		commandModelAPI,
		commandOrg,
		commandRoute,
		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 APISandboxFlags struct {
	APIFlags
	SandboxURL string `flag:"sandbox-url" desc:"Sandbox URL to target, as shown by 'baseten sandbox describe'" required:"true"`
}

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 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"`
}

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."`
	MaxReplica                  OptionalFlag[int] `flag:"max-replica" desc:"Maximum number of replicas."`
	AutoscalingWindow           OptionalFlag[int] `flag:"autoscaling-window" desc:"Timeframe of traffic considered for autoscaling decisions, in seconds."`
	ScaleDownDelay              OptionalFlag[int] `flag:"scale-down-delay" desc:"Waiting period before scaling down any active replica, in seconds."`
	ConcurrencyTarget           OptionalFlag[int] `flag:"concurrency-target" desc:"Number of requests per replica before scaling up."`
	TargetUtilizationPercentage OptionalFlag[int] `flag:"target-utilization-percentage" desc:"Target utilization percentage for scaling up and down."`
	TargetInFlightTokens        OptionalFlag[int] `flag:"target-in-flight-tokens" desc:"Target number of in-flight tokens for autoscaling decisions. Early access only."`
	MaxScaleDownRate            OptionalFlag[int] `` /* 185-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

type CommandError interface {
	error
	ExitCode() ExitCode
	Meaning() string
}

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.

func NewErrAuth

func NewErrAuth(err error) *ErrAuth

NewErrAuth wraps any error as an ErrAuth.

func (*ErrAuth) ExitCode

func (*ErrAuth) ExitCode() ExitCode

func (*ErrAuth) Meaning

func (*ErrAuth) Meaning() string

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

func NewErrServer(err error) *ErrServer

NewErrServer wraps any error as an ErrServer.

func (*ErrServer) ExitCode

func (*ErrServer) ExitCode() ExitCode

func (*ErrServer) Meaning

func (*ErrServer) Meaning() string

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

func NewErrUsage(err error) *ErrUsage

NewErrUsage wraps any error as an ErrUsage.

func NewErrUsagef

func NewErrUsagef(format string, args ...any) *ErrUsage

NewErrUsagef builds an ErrUsage from a fmt.Errorf-style format string. Supports %w to wrap an underlying error.

func (*ErrUsage) ExitCode

func (*ErrUsage) ExitCode() ExitCode

func (*ErrUsage) Meaning

func (*ErrUsage) Meaning() string

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

type ErrorDesc struct {
	Name    string
	Code    ExitCode
	Meaning string
}

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 HarnessFlags added in v1.1.0

type HarnessFlags struct {
	Harness   []string `flag:"harness" desc:"Harness to apply to. May be repeated." enum:"claude-code,codex,opencode,pi"`
	ConfigDir string   `` /* 129-byte string literal not displayed */
}

HarnessFlags selects the harnesses a command applies to.

type HarnessPlan added in v1.1.0

type HarnessPlan 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"`
}

HarnessPlan is one configuration file that setup or teardown changes. Credentials are never included.

type HarnessPlanList added in v1.1.0

type HarnessPlanList struct {
	Items []HarnessPlan `json:"items"`
	// DeletedAPIKeys lists the prefixes of routes API keys teardown deleted.
	DeletedAPIKeys []string `json:"deleted_api_keys,omitempty"`
}

HarnessPlanList is the JSON output of `baseten harness setup` and `baseten harness teardown`.

type HarnessRoute added in v1.1.0

type HarnessRoute struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

HarnessRoute is a route configured in a harness.

type HarnessSetupFlags added in v1.1.0

type HarnessSetupFlags struct {
	CommandFlags
	HarnessFlags
	Team            string `` /* 142-byte string literal not displayed */
	KeyName         string `` /* 167-byte string literal not displayed */
	Route           string `flag:"route" desc:"Default route. Defaults to the first route the harness lists."`
	BackgroundRoute string `` /* 142-byte string literal not displayed */
	SubagentRoute   string `flag:"subagent-route" desc:"Route for subagents (Claude Code and OpenCode). Defaults to the harness's own setting."`
	FallbackRoute   string `` /* 128-byte string literal not displayed */
	DryRun          bool   `flag:"dry-run" desc:"Preview the configuration without changing files or creating an API key."`
	Yes             bool   `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}

HarnessSetupFlags are the flags for `baseten harness setup`.

type HarnessStatus added in v1.1.0

type HarnessStatus struct {
	Harness         string         `json:"harness"`
	Config          string         `json:"config"`
	Installed       bool           `json:"installed"`
	Version         string         `json:"version"`
	State           string         `json:"state"`
	DefaultRoute    string         `json:"default_route,omitempty"`
	BackgroundRoute string         `json:"background_route,omitempty"`
	Routes          []HarnessRoute `json:"routes,omitempty"`
	ManagedSettings []string       `json:"managed_settings,omitempty"`
}

HarnessStatus is the local integration state of one harness.

type HarnessStatusFlags added in v1.1.0

type HarnessStatusFlags struct {
	CommandFlags
	HarnessFlags
}

HarnessStatusFlags are the flags for `baseten harness status`.

type HarnessStatusList added in v1.1.0

type HarnessStatusList struct {
	Items []HarnessStatus `json:"items"`
}

HarnessStatusList is the JSON output of `baseten harness status`.

type HarnessTeardownFlags added in v1.1.0

type HarnessTeardownFlags struct {
	CommandFlags
	HarnessFlags
	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."`
}

HarnessTeardownFlags are the flags for `baseten harness teardown`.

type HarnessUsageFlags added in v1.1.0

type HarnessUsageFlags struct {
	CommandFlags

	Start time.Time     `` /* 170-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 `` /* 134-byte string literal not displayed */

	RouteUsageQueryFlags
}

HarnessUsageFlags are the flags for `baseten harness usage`.

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

type JSONAny = map[string]any

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` and `baseten model environment metrics`. Both commands 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 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 `flag:"group-by" desc:"Dimension to break usage down by. May be repeated. One of: api-key, user, model. Defaults to model."`

	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."`

	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 */

	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 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 */
	RampUpWhilePromoting     OptionalFlag[bool]   `flag:"ramp-up-while-promoting" desc:"Whether to ramp up traffic while promoting."`
	RampUpDurationSeconds    OptionalFlag[int]    `flag:"ramp-up-duration-seconds" desc:"Duration of the ramp up, in seconds."`

	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."`
	MaxUnavailablePercent    OptionalFlag[int]    `flag:"max-unavailable-percent" desc:"The maximum unavailable 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

type ModelImageBuildResult struct {
	ImageID string `json:"image_id"`
	Tag     string `json:"tag"`
}

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 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." default:"."`

	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}'."`

	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 */

	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]) 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   `` /* 157-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 */
}

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 `` /* 163-byte string literal not displayed */
}

type OrgAuditLogsFlags added in v0.4.0

type OrgAuditLogsFlags struct {
	CommandFlags
	AuditLogFlags
}

OrgAuditLogsFlags configures `baseten org audit-logs`.

type OrgBillingUsageFlags

type OrgBillingUsageFlags struct {
	CommandFlags

	Since time.Duration `` /* 160-byte string literal not displayed */
	Start time.Time     `` /* 216-byte string literal not displayed */
	End   time.Time     `` /* 170-byte string literal not displayed */
}

type OrgDescribeFlags added in v1.0.0

type OrgDescribeFlags struct {
	CommandFlags
}

OrgDescribeFlags configures `baseten org describe`.

type OrgRegionsFlags added in v1.0.0

type OrgRegionsFlags struct {
	CommandFlags

	Team string `` /* 146-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 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 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 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 RouteAPIKeyDeleteFlags added in v1.1.0

type RouteAPIKeyDeleteFlags struct {
	CommandFlags
	Prefix string `flag:"prefix" desc:"Prefix of the key to delete, as shown by route api-key list." oneof:"key"`
	All    bool   `flag:"all" desc:"Delete all your routes API keys, on every machine and team." oneof:"key"`
	Yes    bool   `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}

RouteAPIKeyDeleteFlags are the flags for `baseten route api-key delete`.

type RouteAPIKeyDeleteResult added in v1.1.0

type RouteAPIKeyDeleteResult struct {
	Deleted []string `json:"deleted"`
	Failed  []string `json:"failed"`
}

RouteAPIKeyDeleteResult is the JSON output of `baseten route api-key delete`.

type RouteAPIKeyListFlags added in v1.1.0

type RouteAPIKeyListFlags struct{ CommandFlags }

RouteAPIKeyListFlags are the flags for `baseten route api-key list`.

type RouteCreateFlags added in v1.1.0

type RouteCreateFlags struct {
	CommandFlags
	RouteTargetFlags
	Team        string               `` /* 143-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 RouteDeleteFlags added in v1.1.0

type RouteDeleteFlags struct {
	CommandFlags
	RouteRefFlags
	Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}

type RouteDescribeFlags added in v1.1.0

type RouteDescribeFlags struct {
	CommandFlags
	RouteRefFlags
}

type RouteList added in v1.1.0

type RouteList struct {
	Items []managementapi.Route `json:"items"`
}

RouteList contains the routes aggregated across all pages.

type RouteListFlags added in v1.1.0

type RouteListFlags struct {
	CommandFlags
	Team string `flag:"team" desc:"Team name or ID to scope the listing to. Defaults to all routes you can invoke."`
}

type RouteRefFlags added in v1.1.0

type RouteRefFlags struct {
	ID   string `flag:"id" desc:"Stable route ID." oneof:"route-ref"`
	Name string `flag:"name" desc:"Exact route name, including its organization-owned prefix." oneof:"route-ref"`
}

type RouteTargetFlags added in v1.1.0

type RouteTargetFlags struct {
	TargetType   string `flag:"target-type" desc:"Target type." enum:"baseten-model-api,anthropic,openai,xai" required:"true"`
	TargetModel  string `flag:"target-model" desc:"Model API name or external provider model name." required:"true"`
	TargetSecret string `flag:"target-secret" desc:"Name of an existing secret in the route's team. Required for external targets."`
}

type RouteUpdateFlags added in v1.1.0

type RouteUpdateFlags struct {
	CommandFlags
	RouteRefFlags
	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 RouteUsageFlags added in v1.1.0

type RouteUsageFlags struct {
	CommandFlags

	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 `` /* 137-byte string literal not displayed */

	RouteUsageQueryFlags
}

RouteUsageFlags are the flags for `baseten route usage`.

type RouteUsageQueryFlags added in v1.1.0

type RouteUsageQueryFlags struct {
	GroupBy []string `flag:"group-by" desc:"Dimension to break usage down by. May be repeated." enum:"user,model,provider" default:"model"`

	Models    []string `flag:"model" desc:"Only return usage for these models. May be repeated."`
	Providers []string `` /* 149-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."`
}

RouteUsageQueryFlags are the usage filters and paging flags shared by `baseten route usage` and `baseten harness usage`.

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

	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, which also sets the CPU allocation."`
	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."`
}

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

	ShowSecrets bool `` /* 151-byte string literal not displayed */
}

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.SandboxImageSummary `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 */
	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 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 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

	Label []string `flag:"label" desc:"Label as KEY=VALUE, replacing all of the sandbox's labels. Repeatable."`
}

SandboxUpdateFlags configures 'baseten sandbox 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 `` /* 251-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, 1 to 16. 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
}

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 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

	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

	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 {
	// 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

	Tags []string `` /* 177-byte string literal not displayed */

	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 {
	// 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
}

type VolumeRmFlags added in v1.0.0

type VolumeRmFlags struct {
	CommandFlags
	VolumeRefFlags

	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
}

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

	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 */
	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 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 or a pull. Both default to what the transfer picks for itself; set them to cap the load on a shared machine or a metered link.

type VolumeVersionsFlags added in v1.0.0

type VolumeVersionsFlags struct {
	CommandFlags

	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`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL