Documentation
¶
Index ¶
- Constants
- Variables
- type APIFlags
- type APIInferenceFlags
- type APIManagementFlags
- type AuthLoginFlags
- type AuthLoginResult
- type AuthLogoutFlags
- type AuthLogoutResult
- type AuthStatusFlags
- type AuthStatusResult
- type AuthSwitchFlags
- type AuthSwitchResult
- type Command
- type CommandError
- type CommandErrorMeta
- type CommandExample
- type CommandFlag
- type CommandFlags
- type CommandOutput
- func (o *CommandOutput[JSONT]) ExampleList() []CommandExample
- func (o *CommandOutput[JSONT]) JQ() CommandExample
- func (o *CommandOutput[JSONT]) JSON() string
- func (o *CommandOutput[JSONT]) JSONArrayStreamedBool() bool
- func (*CommandOutput[JSONT]) JSONOutputType() reflect.Type
- func (o *CommandOutput[JSONT]) JSONOutputUnimportantBool() bool
- func (o *CommandOutput[JSONT]) Text() string
- type CommandOutputSpec
- type ErrAuth
- type ErrGeneric
- type ErrNotFound
- type ErrServer
- type ErrUsage
- type ErrValidation
- type ErrorDesc
- type ExitCode
- type InferenceClientFlags
- type JSONAny
- type JSONUndefined
- type LogFlags
- type MetricsFlags
- type ModelAPIDescribeFlags
- type ModelAPIList
- type ModelAPIListFlags
- type ModelAPIPredictFlags
- type ModelDeleteFlags
- type ModelDeploymentActivateFlags
- type ModelDeploymentConfigFlags
- type ModelDeploymentDeactivateFlags
- type ModelDeploymentDeleteFlags
- type ModelDeploymentDescribeFlags
- type ModelDeploymentDownloadFlags
- type ModelDeploymentDownloadResult
- type ModelDeploymentIDFlags
- type ModelDeploymentListFlags
- type ModelDeploymentLogsFlags
- type ModelDeploymentMetricsFlags
- type ModelDeploymentPromoteFlags
- type ModelDeploymentReplicaIDFlags
- type ModelDeploymentReplicaTerminateFlags
- type ModelDescribeFlags
- type ModelEnvironmentActivateFlags
- type ModelEnvironmentDeactivateFlags
- type ModelEnvironmentDescribeFlags
- type ModelEnvironmentFlags
- type ModelEnvironmentListFlags
- type ModelEnvironmentLogsFlags
- type ModelEnvironmentMetricsFlags
- type ModelListFlags
- type ModelPredictFlags
- type ModelPushFlags
- type ModelPushResult
- type ModelRefFlags
- type ModelWatchFlags
- type OrgAPIKeyCreateFlags
- type OrgAPIKeyDeleteFlags
- type OrgAPIKeyListFlags
- type OrgBillingUsageFlags
- type OrgSecretDeleteFlags
- type OrgSecretListFlags
- type OrgSecretSetFlags
- type OrgTeamDescribeFlags
- type OrgTeamListFlags
- type OrgUserDescribeFlags
- type OrgUserList
- type OrgUserListFlags
- type SSHProxyFlags
- type SSHSetupFlags
- type SSHSetupResult
- type SSHSignFlags
- type TrussFlags
- type VersionFlags
- type VersionResult
- type WhoamiFlags
Constants ¶
const ( // DefaultFlagGroup is the group name applied to a flag with no `group:` tag. DefaultFlagGroup = "command" // DefaultFlagGroupPri is the rendering priority for a group whose flags // declare no `group-pri:` tag. DefaultFlagGroupPri = 100 // FlagAnnotationGroup names the pflag.Flag annotation key that carries the // declarative `group` tag onto the bound flag, where the help renderer reads it. FlagAnnotationGroup = "baseten/group" // FlagAnnotationGroupPri names the pflag.Flag annotation key that carries the // declarative `group-pri` tag onto the bound flag, where the help renderer reads it. FlagAnnotationGroupPri = "baseten/group-pri" )
Flag group defaults and pflag annotation keys.
Variables ¶
var Root = Command{ Name: "baseten", Summary: "Baseten CLI", Description: "Command-line interface for managing Baseten resources.\n\n" + "Authentication is via 'baseten auth login' or the BASETEN_API_KEY environment variable.\n\n" + "The CLI never prompts interactively when stdin is not a terminal; commands that need " + "input must be supplied via flags or stdin redirection or they fail fast.", Children: []Command{ commandAPI, commandAuth, commandModel, commandModelAPI, commandOrg, commandSSH, commandTruss, commandVersion, commandWhoami, }, }
Root is the top-level baseten command.
Functions ¶
This section is empty.
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 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 Command ¶
type Command struct {
Name string
Summary string
Description string
Flags any // nil, or struct value with flag tags
Children []Command
// ArgsUsage is appended to the command name in help output (e.g. "[path]").
ArgsUsage string
// ExactArgs requires exactly this many positional arguments. Mutually
// exclusive with MaxArgs.
ExactArgs int
// MaxArgs is the maximum number of positional arguments. 0 means no args
// (the default), -1 means unlimited. Mutually exclusive with ExactArgs.
MaxArgs int
// DisableFlagParsing disables all flag parsing; everything after the command
// name is passed as raw args. MaxArgs is ignored and assumed -1.
DisableFlagParsing bool
// Output declares the leaf command's stdout shape, text-mode behavior, and
// examples. Required on every leaf (a command with no Children); must be
// nil on commands with Children. Typically a *[CommandOutput][T].
Output CommandOutputSpec
// Errors lists command-declared typed errors. Each entry is built via
// [ErrorDescOf] and documents one extra exit code surfaced by this leaf
// beyond the standard set. Rendered in --help-output.
Errors []ErrorDesc
// Hidden keeps the command out of help listings and completion. The command
// is still fully runnable.
Hidden bool
}
Command defines a CLI command declaratively. The tree structure is built via Children. Flags is a struct value whose fields use struct tags to define CLI flags.
func (Command) LoadFlags ¶
func (c Command) LoadFlags() []CommandFlag
LoadFlags parses the Flags struct tags and returns the flag metadata. Returns nil if Flags is nil.
type CommandError ¶
CommandError is implemented by typed errors a command may return. The framework calls errors.As on the returned error to discover a CommandError implementation and uses its ExitCode and [Meaning] to classify the failure and populate the JSON error envelope.
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
}
CommandExample documents one usage of a command.
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
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. 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 }
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]) JSONArrayStreamedBool ¶
func (o *CommandOutput[JSONT]) JSONArrayStreamedBool() bool
func (*CommandOutput[JSONT]) JSONOutputType ¶
func (*CommandOutput[JSONT]) JSONOutputType() reflect.Type
func (*CommandOutput[JSONT]) JSONOutputUnimportantBool ¶
func (o *CommandOutput[JSONT]) JSONOutputUnimportantBool() bool
func (*CommandOutput[JSONT]) Text ¶
func (o *CommandOutput[JSONT]) Text() string
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
}
CommandOutputSpec is the type-erased view of a leaf command's CommandOutput. Every leaf Command must declare an Output value implementing this interface (concretely a *CommandOutput[JSONT] for some T).
type ErrAuth ¶
type ErrAuth struct{ CommandErrorMeta }
ErrAuth signals an authentication or authorization failure (typically HTTP 401/403). Surfaces ExitAuth.
type ErrGeneric ¶
type ErrGeneric struct{ CommandErrorMeta }
ErrGeneric is the catch-all typed error for failures with no more specific classification. Surfaces ExitGeneric.
func NewErrGeneric ¶
func NewErrGeneric(err error) *ErrGeneric
NewErrGeneric wraps any error as an ErrGeneric. Returns nil if err is nil.
func (*ErrGeneric) ExitCode ¶
func (*ErrGeneric) ExitCode() ExitCode
func (*ErrGeneric) Meaning ¶
func (*ErrGeneric) Meaning() string
type ErrNotFound ¶
type ErrNotFound struct{ CommandErrorMeta }
ErrNotFound signals that a referenced resource does not exist (typically HTTP 404). Surfaces ExitNotFound.
func NewErrNotFound ¶
func NewErrNotFound(err error) *ErrNotFound
NewErrNotFound wraps any error as an ErrNotFound.
func (*ErrNotFound) ExitCode ¶
func (*ErrNotFound) ExitCode() ExitCode
func (*ErrNotFound) Meaning ¶
func (*ErrNotFound) Meaning() string
type ErrServer ¶
type ErrServer struct{ CommandErrorMeta }
ErrServer signals a server-side failure (typically HTTP 5xx). Surfaces ExitServer.
func NewErrServer ¶
NewErrServer wraps any error as an ErrServer.
type ErrUsage ¶
type ErrUsage struct{ CommandErrorMeta }
ErrUsage signals invalid command invocation (bad flags, missing required input, mutually exclusive options). Surfaces ExitUsage and tells the framework to display the command's usage line alongside the error.
func NewErrUsage ¶
NewErrUsage wraps any error as an ErrUsage.
func NewErrUsagef ¶
NewErrUsagef builds an ErrUsage from a fmt.Errorf-style format string. Supports %w to wrap an underlying error.
type ErrValidation ¶
type ErrValidation struct{ CommandErrorMeta }
ErrValidation signals a request rejected by server-side validation (typically HTTP 4xx other than 401/403/404). Surfaces ExitValidation.
func NewErrValidation ¶
func NewErrValidation(err error) *ErrValidation
NewErrValidation wraps any error as an ErrValidation.
func (*ErrValidation) ExitCode ¶
func (*ErrValidation) ExitCode() ExitCode
func (*ErrValidation) Meaning ¶
func (*ErrValidation) Meaning() string
type ErrorDesc ¶
ErrorDesc documents one command-declared error: its Go type name, the ExitCode it surfaces, and the static CommandError.Meaning. Listed in Command.Errors and rendered in --help-output.
func ErrorDescOf ¶
func ErrorDescOf[PT CommandError]() ErrorDesc
ErrorDescOf builds an ErrorDesc from a typed command error. Call as ErrorDescOf[*ErrFoo](). Panics if the error reports ExitCode == 0 (success), which is meaningless for an error.
func StandardErrors ¶
func StandardErrors() []ErrorDesc
StandardErrors enumerates the framework-provided typed [CommandError]s in the order the root command's --help-output should render them. Each leaf command inherits these implicitly; per-leaf Command.Errors only lists errors *beyond* this standard set.
type ExitCode ¶
type ExitCode int
ExitCode is the process exit code the CLI returns. The standard set below is what the framework emits automatically; commands may declare additional codes by implementing CommandError on a typed error and listing it in Command.Errors. The enum is open: codes beyond ExitServer are reserved for command-declared errors.
const ( ExitSuccess ExitCode = 0 ExitGeneric ExitCode = 1 ExitUsage ExitCode = 2 ExitAuth ExitCode = 3 ExitNotFound ExitCode = 4 ExitValidation ExitCode = 5 ExitServer ExitCode = 6 // ExitInterrupted is returned when the command's context is cancelled // (Ctrl-C / SIGTERM). 128 + SIGINT(2), the conventional shell convention. ExitInterrupted ExitCode = 130 )
type InferenceClientFlags ¶
type InferenceClientFlags struct {
ModelID string `flag:"model-id" desc:"Model ID to target"`
ChainID string `flag:"chain-id" desc:"Chain ID to target"`
Environment string `flag:"environment" desc:"Environment name (e.g. production)"`
}
InferenceClientFlags are the flags needed to target an inference endpoint. Embedded by any command that needs to create an inference client.
type JSONAny ¶
JSONAny is the JSONT for leaf commands whose stdout JSON is valid JSON but whose shape is user- or runtime-determined. --help-output renders it as "any JSON object" rather than a concrete schema.
type 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 `` /* 206-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 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 `` /* 201-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 ¶
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 ¶
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 ¶
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 ¶
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 `flag:"data" desc:"Inline request body, sent verbatim." oneof:"predict-input"`
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 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 ¶
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 Truss as an uncompressed tar file at this path." oneof:"download-out"`
OutDir string `flag:"out-dir" desc:"Extract the Truss 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 ¶
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"`
OverrideEnvInstanceType bool `flag:"override-env-instance-type" desc:"Use this deployment's instance type instead of preserving the target environment's."`
Yes bool `flag:"yes" desc:"Skip the interactive confirmation prompt. Required when stdin is not a terminal."`
}
ModelDeploymentPromoteFlags configures `baseten model deployment promote`.
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 ModelDescribeFlags ¶
type ModelDescribeFlags struct {
CommandFlags
ModelRefFlags
}
ModelDescribeFlags configures `baseten model describe`.
type ModelEnvironmentActivateFlags ¶
type ModelEnvironmentActivateFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentActivateFlags configures `baseten model environment activate`.
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 ¶
type ModelEnvironmentDescribeFlags struct {
CommandFlags
ModelEnvironmentFlags
}
ModelEnvironmentDescribeFlags configures `baseten model environment describe`.
type ModelEnvironmentFlags ¶
type ModelEnvironmentFlags struct {
ModelRefFlags
Environment string `flag:"environment" desc:"Name of the environment (e.g. production)." required:"true"`
}
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 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 `` /* 179-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 `flag:"data" desc:"Inline JSON request body." oneof:"predict-input"`
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."`
DeploymentName string `flag:"deployment-name" desc:"Human-readable name for the new deployment."`
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 Go duration (e.g. 30m, 1h); allowed range 10m to 24h."`
OverrideName string `` /* 129-byte string literal not displayed */
OverrideEnvInstanceType bool `` /* 173-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 ModelWatchFlags ¶
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 OrgAPIKeyCreateFlags ¶
type OrgAPIKeyCreateFlags struct {
CommandFlags
Type string `` /* 131-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 `flag:"team" desc:"Team name or ID to create the key in. Defaults to the organization's default team."`
}
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 OrgBillingUsageFlags ¶
type OrgSecretDeleteFlags ¶
type OrgSecretDeleteFlags struct {
CommandFlags
Name string `flag:"name" desc:"Name of the secret to delete." required:"true"`
Team string `flag:"team" desc:"Team name or ID the secret belongs to. Defaults to the organization's default team."`
}
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 `flag:"team" desc:"Team name or ID the secret belongs to. Defaults to the organization's default team."`
}
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 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 TrussFlags ¶
type TrussFlags struct{}
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 WhoamiFlags ¶ added in v0.3.0
type WhoamiFlags struct {
CommandFlags
}
WhoamiFlags configures `baseten whoami`.