Documentation
¶
Index ¶
- Variables
- func CheckForUpdates(currentVersion string)
- func CleanTemplate(dir string)
- func CloneTemplateWithSpinner(opts TemplateOptions, templates Templates, noTTY bool, errorPrefix string, ...) error
- func DocCmd() *cobra.Command
- func EditBlaxelTomlInCurrentDir(resourceType string, resourceName string, resourcePath string) error
- func ErrorHandler(request *http.Request, kind string, name string, body string) error
- func Execute(releaseVersion string, releaseCommit string, releaseDate string) error
- func GetAppURL() string
- func GetBaseURL() string
- func GetClient() *sdk.ClientWithResponses
- func GetCommand(name string) *cobra.Command
- func GetCommandSecrets() []string
- func GetCommit() string
- func GetDate() string
- func GetDependencyManager(language, directory string) (string, string)
- func GetEnvFiles() []string
- func GetHuhTheme() *huh.Theme
- func GetOutputFormat() string
- func GetRegistryURL() string
- func GetRunURL() string
- func GetVerbose() bool
- func GetVersion() string
- func GetWorkspace() string
- func HasGoEntryFile(directory string) bool
- func HasPythonEntryFile(directory string) bool
- func HasTypeScriptEntryFile(directory string) bool
- func IsCIEnvironment() bool
- func IsInteractiveMode() bool
- func IsTerminalInteractive() bool
- func IsVolumeTemplate(resourceType string) bool
- func LoadCommandSecrets(commandSecrets []string)
- func LookupSecret(name string) string
- func ModuleLanguage(directory string) string
- func Output(resource Resource, slices []interface{}, outputFormat string)
- func Pluralize(word string) string
- func Print(message string)
- func PrintError(operation string, err error)
- func PrintInfo(message string)
- func PrintSuccess(message string)
- func PrintWarning(message string)
- func PromptForDeploymentType() string
- func ReadConfigToml(folder string, setDefaultType bool)
- func ReadSecrets(folder string, envFiles []string)
- func RegisterCommand(name string, cmdFunc func() *cobra.Command)
- func RunCreateFlow(dirArg string, templateNameFlag string, cfg CreateFlowConfig, ...)
- func RunInstallationWithTea(t Template, opts TemplateOptions) error
- func SeedCache(cwd string) error
- func SetCommandSecrets(secrets []string)
- func SetConfigType(t string)
- func SetEnvs()
- func SetInteractiveMode(interactive bool)
- func SetWorkspace(ws string)
- func Slugify(s string) string
- type CommandEnv
- type Config
- type CreateFlowConfig
- type Entrypoints
- type Env
- type Envs
- type ErrorModel
- type IgnoreDir
- type IgnoreFile
- type Model
- type NameRetriever
- type Operations
- type Package
- type Resource
- type Result
- type ResultMetadata
- type Secrets
- type Status
- type Step
- type Template
- type TemplateOptions
- type Templates
Constants ¶
This section is empty.
Variables ¶
var APP_URL = "https://app.blaxel.ai"
var BASE_URL = "https://api.blaxel.ai/v0"
var GITHUB_RELEASES_URL = "https://api.github.com/repos/blaxel-ai/toolkit/releases"
var REGISTRY_URL = "https://us.registry.blaxel.ai"
var RUN_URL = "https://run.blaxel.ai"
var UPDATE_CLI_DOC_URL = "https://docs.blaxel.ai/cli-reference/introduction#update"
Functions ¶
func CheckForUpdates ¶
func CheckForUpdates(currentVersion string)
func CleanTemplate ¶ added in v0.1.34
func CleanTemplate(dir string)
func CloneTemplateWithSpinner ¶ added in v0.1.34
func CloneTemplateWithSpinner(opts TemplateOptions, templates Templates, noTTY bool, errorPrefix string, spinnerTitle string) error
CloneTemplateWithSpinner clones a template with optional spinner based on noTTY flag
func EditBlaxelTomlInCurrentDir ¶ added in v0.1.34
func EditBlaxelTomlInCurrentDir(resourceType string, resourceName string, resourcePath string) error
editBlaxelTomlInCurrentDir checks if blaxel.toml exists in the current working directory and appends text to it. If the file doesn't exist, it returns without error.
func ErrorHandler ¶
func GetBaseURL ¶
func GetBaseURL() string
func GetCommand ¶
GetCommand returns a registered command
func GetCommandSecrets ¶
func GetCommandSecrets() []string
func GetDependencyManager ¶ added in v0.1.34
GetDependencyManager returns the dependency manager and version for a given language
func GetEnvFiles ¶
func GetEnvFiles() []string
func GetHuhTheme ¶
getTheme returns a custom theme configuration for the CLI interface using the Dracula color scheme. It customizes various UI elements like buttons, text inputs, and selection indicators.
func GetOutputFormat ¶
func GetOutputFormat() string
GetOutputFormat returns the current output format
func GetRegistryURL ¶
func GetRegistryURL() string
func GetVerbose ¶ added in v0.1.57
func GetVerbose() bool
func GetVersion ¶
func GetVersion() string
func HasGoEntryFile ¶ added in v0.1.59
HasGoEntryFile checks if common Go entry files exist in the given directory
func HasPythonEntryFile ¶ added in v0.1.59
HasPythonEntryFile checks if common Python entry files exist in the given directory
func HasTypeScriptEntryFile ¶ added in v0.1.59
HasTypeScriptEntryFile checks if common TypeScript/JavaScript entry files exist in the given directory or if package.json has a start script defined
func IsCIEnvironment ¶ added in v0.1.44
func IsCIEnvironment() bool
IsCIEnvironment returns true when running in a known CI environment. It checks common CI environment variables used by providers like GitHub and GitLab.
func IsInteractiveMode ¶ added in v0.1.44
func IsInteractiveMode() bool
func IsTerminalInteractive ¶ added in v0.1.44
func IsTerminalInteractive() bool
IsTerminalInteractive returns true if both stdin and stdout are terminals (TTY).
func IsVolumeTemplate ¶ added in v0.1.46
func LoadCommandSecrets ¶
func LoadCommandSecrets(commandSecrets []string)
func LookupSecret ¶ added in v0.1.33
func ModuleLanguage ¶
func PrintError ¶ added in v0.1.34
PrintError prints a formatted error message with colors
func PrintSuccess ¶ added in v0.1.34
func PrintSuccess(message string)
PrintSuccess prints a formatted success message with colors
func PrintWarning ¶ added in v0.1.34
func PrintWarning(message string)
PrintWarning prints a formatted warning message with colors
func PromptForDeploymentType ¶ added in v0.1.59
func PromptForDeploymentType() string
promptForDeploymentType prompts the user to select what they want to deploy when no blaxel.toml file is found
func ReadConfigToml ¶
func ReadSecrets ¶
func RegisterCommand ¶
RegisterCommand allows commands to register themselves
func RunCreateFlow ¶ added in v0.1.39
func RunCreateFlow( dirArg string, templateNameFlag string, cfg CreateFlowConfig, promptFunc func(directory string, templates Templates) TemplateOptions, successFunc func(opts TemplateOptions), )
RunCreateFlow centralizes the common steps for all create-* commands while preserving each command's specific behavior via the config and callbacks.
Parameters: - dirArg: optional directory argument provided on CLI - templateNameFlag: optional template name provided via --template - promptFunc: called to interactively collect TemplateOptions when needed - successFunc: called at the end to print any command-specific instructions
func RunInstallationWithTea ¶ added in v0.1.34
func RunInstallationWithTea(t Template, opts TemplateOptions) error
RunInstallationWithTea runs the installation process with Bubble Tea UI
func SetCommandSecrets ¶
func SetCommandSecrets(secrets []string)
func SetConfigType ¶ added in v0.1.59
func SetConfigType(t string)
SetConfigType sets the config type
func SetInteractiveMode ¶ added in v0.1.44
func SetInteractiveMode(interactive bool)
Types ¶
type CommandEnv ¶
func (*CommandEnv) AddClientEnv ¶
func (c *CommandEnv) AddClientEnv()
func (*CommandEnv) Set ¶
func (c *CommandEnv) Set(key, value string)
func (*CommandEnv) ToEnv ¶
func (c *CommandEnv) ToEnv() []string
type Config ¶
type Config struct {
Name string `toml:"name"`
Workspace string `toml:"workspace"`
Type string `toml:"type"`
Protocol string `toml:"protocol"`
Functions []string `toml:"functions"`
Models []string `toml:"models"`
Agents []string `toml:"agents"`
Entrypoint Entrypoints `toml:"entrypoint"`
Env Envs `toml:"env"`
Function map[string]Package `toml:"function"`
Agent map[string]Package `toml:"agent"`
Job map[string]Package `toml:"job"`
SkipRoot bool `toml:"skipRoot"`
Runtime *map[string]interface{} `toml:"runtime"`
Triggers *[]map[string]interface{} `toml:"triggers"`
Volumes *[]map[string]interface{} `toml:"volumes,omitempty"`
Policies []string `toml:"policies,omitempty"`
DefaultSize *int `toml:"defaultSize,omitempty"`
Directory string `toml:"directory,omitempty"`
Region string `toml:"region,omitempty"`
}
readConfigToml reads the config.toml file and upgrade config according to content
type CreateFlowConfig ¶ added in v0.1.39
type CreateFlowConfig struct {
// Template topic used to filter templates: e.g., "agent", "job", "mcp", "sandbox".
TemplateType string
// Non-interactive flag; true means skip TTY UI and use defaults.
NoTTY bool
// Name used for progress/error messages, like "Agent creation".
ErrorPrefix string
// One-line spinner title while cloning, like "Creating your blaxel agent app...".
SpinnerTitle string
// Optional: when set, append a section to blaxel.toml with this resource type (e.g., "agent" or "function").
BlaxelTomlResourceType string
}
CreateFlowConfig captures the knobs that differ between create commands.
type Entrypoints ¶
type Env ¶
func GetUniqueEnvs ¶
func GetUniqueEnvs() []Env
type ErrorModel ¶
type IgnoreFile ¶
type Model ¶ added in v0.1.34
type Model struct {
// contains filtered or unexported fields
}
Model holds the state of our installation UI
func NewInstallationModel ¶ added in v0.1.34
func NewInstallationModel() Model
NewInstallationModel creates a new installation progress model
func (*Model) CompleteStep ¶ added in v0.1.34
type NameRetriever ¶
type NameRetriever struct {
Metadata struct {
Name string `yaml:"name"`
} `yaml:"metadata"`
}
type Operations ¶
func (*Operations) CliCommand ¶
func (o *Operations) CliCommand(ctx context.Context, operationId string, fn interface{})
type Resource ¶
type Resource struct {
Kind string
Short string
Plural string
Singular string
Aliases []string
SpecType reflect.Type
List interface{}
Get interface{}
Delete interface{}
Put interface{}
Post interface{}
AdditionalFields map[string]string // map[columnName]fieldPath - e.g., "STATUS": "status", "IMAGE": "spec.runtime.image"
}
type Result ¶
type Result struct {
ApiVersion string `yaml:"apiVersion" json:"apiVersion"`
Kind string `yaml:"kind" json:"kind"`
Metadata interface{} `yaml:"metadata" json:"metadata"`
Spec interface{} `yaml:"spec" json:"spec"`
Status string `yaml:"status,omitempty" json:"status,omitempty"`
}
func GetResults ¶
GetResults is a public wrapper for getResults
type ResultMetadata ¶
type TemplateOptions ¶
type TemplateOptions struct {
Directory string // Target directory for the new agent app
ProjectName string // Name of the project
ProjectPrompt string // Description of the project
Language string // Language to use for the project
TemplateName string // Name of the template to use for the project
Author string // Author of the project
}
func CreateDefaultTemplateOptions ¶
func CreateDefaultTemplateOptions(directory, templateName string, templates Templates) TemplateOptions
CreateDefaultTemplateOptions creates default options when template is specified via flag
func PromptTemplateOptions ¶ added in v0.1.39
func PromptTemplateOptions(directory string, templates Templates, resource string, includeLanguage bool, templateHeight int) TemplateOptions
PromptTemplateOptions presents a unified interactive form to collect TemplateOptions. It can optionally include a language selector and will always include a template selector. The name field is included only when directory is empty. resource is used in messages, e.g. "agent app", "job", "mcp server".
type Templates ¶
type Templates []Template
func RetrieveTemplates ¶
func RetrieveTemplatesWithSpinner ¶ added in v0.1.34
func RetrieveTemplatesWithSpinner(templateType string, noTTY bool, errorPrefix string) (Templates, error)
RetrieveTemplatesWithSpinner retrieves templates with optional spinner based on noTTY flag