cli

package
v0.109.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: AGPL-3.0 Imports: 102 Imported by: 2

README

[EXPERIMENTAL] Viam Command Line Interface

This is an experimental feature, so things may change without notice. All feedback on the cli is greatly appreciated.

Getting Started

Enter viam login and follow instructions to authenticate.

Installation

With brew (macOS & linux amd64):

brew tap viamrobotics/brews
brew install viam

As a binary (linux amd64):

sudo curl -o /usr/local/bin/viam https://storage.googleapis.com/packages.viam.com/apps/viam-cli/viam-cli-stable-linux-amd64
sudo chmod a+rx /usr/local/bin/viam

As a binary (linux arm64):

sudo curl -o /usr/local/bin/viam https://storage.googleapis.com/packages.viam.com/apps/viam-cli/viam-cli-stable-linux-arm64
sudo chmod a+rx /usr/local/bin/viam

From source (you must install go first):

go install go.viam.com/rdk/cli/viam@latest
# add go binaries to your path (if you haven't already)
echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc

Development

Building (you must install go first):

go build -o ~/go/bin/viam cli/viam/main.go

Or if you have installed the CLI through homebrew:

go build -o /opt/homebrew/bin/viam cli/viam/main.go

Then afterwards reset your homebrew installation with:

brew unlink viam && brew link --overwrite viam

Documentation

Overview

Package cli contains all business logic needed by the CLI command.

Index

Constants

View Source
const (
	PKCEUnspecified                              pkce = "unspecified"
	PKCERequired                                 pkce = "required"
	PKCENotRequired                              pkce = "not_required"
	PKCENotRequiredWhenUsingClientAuthentication pkce = "not_required_when_using_client_authentication"
)

the valid pkce values.

View Source
const (
	ClientAuthenticationUnspecified              clientAuthentication = "unspecified"
	ClientAuthenticationRequired                 clientAuthentication = "required"
	ClientAuthenticationNotRequired              clientAuthentication = "not_required"
	ClientAuthenticationNotRequiredWhenUsingPKCE clientAuthentication = "not_required_when_using_pkce"
)

the valid client authentication values.

View Source
const (
	URLValidationUnspecified    urlValidation = "unspecified"
	URLValidationExactMatch     urlValidation = "exact_match"
	URLValidationAllowWildcards urlValidation = "allow_wildcards"
)

the accepted url validation values.

View Source
const (
	EnabledGrantUnspecified       enabledGrant = "unspecified"
	EnabledGrantAuthorizationCode enabledGrant = "authorization_code"
	EnabledGrantImplicit          enabledGrant = "implicit"
	EnabledGrantPassword          enabledGrant = "password"
	EnabledGrantRefreshToken      enabledGrant = "refresh_token"
	EnabledGrantDeviceCode        enabledGrant = "device_code"
)

the accepted enabled grant values.

View Source
const (
	ModelTypeUnspecified               = ModelType("unspecified")
	ModelTypeSingleLabelClassification = ModelType("single_label_classification")
	ModelTypeMultiLabelClassification  = ModelType("multi_label_classification")
	ModelTypeObjectDetection           = ModelType("object_detection")
)

ModelType enumeration.

View Source
const (
	ModelFrameworkUnspecified = ModelFramework("unspecified")
	ModelFrameworkTFLite      = ModelFramework("tflite")
	ModelFrameworkTensorFlow  = ModelFramework("tensorflow")
	ModelFrameworkPyTorch     = ModelFramework("pytorch")
	ModelFrameworkONNX        = ModelFramework("onnx")
)

ModelFramework enumeration.

View Source
const (
	PackageTypeUnspecified = PackageType("unspecified")
	PackageTypeArchive     = PackageType("archive")
	PackageTypeMLModel     = PackageType("ml_model")
	PackageTypeModule      = PackageType("module")
	PackageTypeSLAMMap     = PackageType("slam_map")
	PackageTypeMLTraining  = PackageType("ml_training")
)

PackageType enumeration.

Variables

View Source
var (
	StandardDataSourceType   = "standard"
	HotStorageDataSourceType = "hotstorage"
)

dataSourceType constants for data source types.

Functions

func AddProfileAction added in v0.56.0

func AddProfileAction(c *cli.Context, args addOrUpdateProfileArgs) error

AddProfileAction adds a new CLI profile.

func ConnectToApp added in v0.99.0

func ConnectToApp(ctx context.Context, logger logging.Logger) (*appClient.ViamClient, error)

ConnectToApp connects to the Viam app using the cached CLI token.

func ConnectToMachine added in v0.99.0

func ConnectToMachine(ctx context.Context, hostname string, logger logging.Logger) (robot.Robot, error)

ConnectToMachine connects to a Viam machine using the cached CLI token.

func CreateCustomIndexAction added in v0.100.0

func CreateCustomIndexAction(c *cli.Context, args createCustomIndexArgs) error

CreateCustomIndexAction creates a custom index for a specified organization and collection type using the provided index specification file in the arguments.

func CreateMachineAction added in v0.107.0

func CreateMachineAction(c *cli.Context, args createMachineActionArgs) error

CreateMachineAction is the corresponding action for 'machines create'.

func CreateModuleAction added in v0.7.3

func CreateModuleAction(c *cli.Context, args createModuleActionArgs) error

CreateModuleAction is the corresponding Action for 'module create'. It runs the command to create a module. This includes both a gRPC call to register the module on app.viam.com and creating the manifest file.

func CreateOAuthAppAction added in v0.58.0

func CreateOAuthAppAction(c *cli.Context, args createOAuthAppArgs) error

CreateOAuthAppAction is the corresponding action for 'oauth-app create'.

func DataAddToDatasetByFilter added in v0.16.0

func DataAddToDatasetByFilter(c *cli.Context, args dataAddToDatasetByFilterArgs) error

DataAddToDatasetByFilter is the corresponding action for 'dataset data add filter'.

func DataAddToDatasetByIDs added in v0.16.0

func DataAddToDatasetByIDs(c *cli.Context, args dataAddToDatasetByIDsArgs) error

DataAddToDatasetByIDs is the corresponding action for 'dataset data add ids'.

func DataCancelTrainingJob added in v0.11.0

func DataCancelTrainingJob(c *cli.Context, args dataCancelTrainingJobArgs) error

DataCancelTrainingJob is the corresponding action for 'data train cancel'.

func DataConfigureDatabaseUser added in v0.13.0

func DataConfigureDatabaseUser(c *cli.Context, args dataConfigureDatabaseUserArgs) error

DataConfigureDatabaseUser is the corresponding action for 'data database configure'.

func DataConfigureDatabaseUserConfirmation added in v0.39.0

func DataConfigureDatabaseUserConfirmation(c *cli.Context, args dataConfigureDatabaseUserArgs) error

DataConfigureDatabaseUserConfirmation is the Before action for 'data database configure'. it asks for the user to confirm that they are aware that they are changing the authentication credentials of their database.

func DataDeleteBinaryAction added in v0.8.0

func DataDeleteBinaryAction(c *cli.Context, args emptyArgs) error

DataDeleteBinaryAction is the corresponding action for 'data delete'.

func DataDeleteTabularAction added in v0.8.0

func DataDeleteTabularAction(c *cli.Context, args dataDeleteTabularArgs) error

DataDeleteTabularAction is the corresponding action for 'data delete-tabular'.

func DataExportBinaryAction added in v0.56.0

func DataExportBinaryAction(cCtx *cli.Context, args dataExportBinaryArgs) error

DataExportBinaryAction is the corresponding action for 'data export binary'.

func DataExportBinaryIDsAction added in v0.78.2

func DataExportBinaryIDsAction(cCtx *cli.Context, args dataExportBinaryIDsArgs) error

DataExportBinaryIDsAction is the corresponding action for 'data export binary ids'.

func DataExportTabularAction added in v0.56.0

func DataExportTabularAction(cCtx *cli.Context, args dataExportTabularArgs) error

DataExportTabularAction is the corresponding action for 'data export tabular'.

func DataGetDatabaseConnection added in v0.13.0

func DataGetDatabaseConnection(c *cli.Context, args dataGetDatabaseConnectionArgs) error

DataGetDatabaseConnection is the corresponding action for 'data database hostname'.

func DataGetTrainingJob added in v0.11.0

func DataGetTrainingJob(c *cli.Context, args dataGetTrainingJobArgs) error

DataGetTrainingJob is the corresponding action for 'data train get'.

func DataListTrainingJobs added in v0.11.0

func DataListTrainingJobs(c *cli.Context, args dataListTrainingJobsArgs) error

DataListTrainingJobs is the corresponding action for 'data train list'.

func DataRemoveFromDataset added in v0.10.0

func DataRemoveFromDataset(c *cli.Context, args dataRemoveFromDatasetArgs) error

DataRemoveFromDataset is the corresponding action for 'dataset data remove ids'.

func DataRemoveFromDatasetByFilter added in v0.63.0

func DataRemoveFromDatasetByFilter(c *cli.Context, args dataRemoveFromDatasetByFilterArgs) error

DataRemoveFromDatasetByFilter is the corresponding action for 'dataset data remove filter'.

func DataTagActionByFilter added in v0.24.0

func DataTagActionByFilter(c *cli.Context, args dataTagByFilterArgs) error

DataTagActionByFilter is the corresponding action for 'data tag filter'.

func DataTagActionByIDs added in v0.83.0

func DataTagActionByIDs(c *cli.Context, args dataTagByIDsArgs) error

DataTagActionByIDs is the corresponding action for 'data tag'.

func DatapipelineCreateAction added in v0.73.0

func DatapipelineCreateAction(c *cli.Context, args datapipelineCreateArgs) error

DatapipelineCreateAction creates a new data pipeline.

func DatapipelineDeleteAction added in v0.73.0

func DatapipelineDeleteAction(c *cli.Context, args datapipelineDeleteArgs) error

DatapipelineDeleteAction deletes a data pipeline.

func DatapipelineDescribeAction added in v0.73.0

func DatapipelineDescribeAction(c *cli.Context, args datapipelineDescribeArgs) error

DatapipelineDescribeAction describes a data pipeline and its status.

func DatapipelineDisableAction added in v0.73.0

func DatapipelineDisableAction(c *cli.Context, args datapipelineDisableArgs) error

DatapipelineDisableAction disables a data pipeline.

func DatapipelineEnableAction added in v0.73.0

func DatapipelineEnableAction(c *cli.Context, args datapipelineEnableArgs) error

DatapipelineEnableAction enables a data pipeline.

func DatapipelineListAction added in v0.73.0

func DatapipelineListAction(c *cli.Context, args datapipelineListArgs) error

DatapipelineListAction lists all data pipelines for an organization.

func DatapipelineRenameAction added in v0.88.0

func DatapipelineRenameAction(c *cli.Context, args datapipelineRenameArgs) error

DatapipelineRenameAction renames an existing data pipeline.

func DatasetCreateAction added in v0.10.0

func DatasetCreateAction(c *cli.Context, args datasetCreateArgs) error

DatasetCreateAction is the corresponding action for 'dataset create'.

func DatasetDeleteAction added in v0.10.0

func DatasetDeleteAction(c *cli.Context, args datasetDeleteArgs) error

DatasetDeleteAction is the corresponding action for 'dataset delete'.

func DatasetDownloadAction added in v0.33.0

func DatasetDownloadAction(c *cli.Context, args datasetDownloadArgs) error

DatasetDownloadAction is the corresponding action for 'dataset export'.

func DatasetListAction added in v0.10.0

func DatasetListAction(c *cli.Context, args datasetListArgs) error

DatasetListAction is the corresponding action for 'dataset list'.

func DatasetMergeAction added in v0.89.0

func DatasetMergeAction(c *cli.Context, args datasetMergeArgs) error

DatasetMergeAction is the corresponding action for 'dataset merge'.

func DatasetRenameAction added in v0.10.0

func DatasetRenameAction(c *cli.Context, args datasetRenameArgs) error

DatasetRenameAction is the corresponding action for 'dataset rename'.

func DeleteCustomIndexAction added in v0.100.0

func DeleteCustomIndexAction(c *cli.Context, args deleteCustomIndexArgs) error

DeleteCustomIndexAction deletes a custom index for a specified organization and collection type using the provided index name.

func DeleteMachineAction added in v0.107.0

func DeleteMachineAction(c *cli.Context, args deleteMachineActionArgs) error

DeleteMachineAction is the corresponding action for 'machines delete'.

func DeleteOAuthAppAction added in v0.57.0

func DeleteOAuthAppAction(c *cli.Context, args deleteOAuthAppArgs) error

DeleteOAuthAppAction is the corresponding action for 'oauth-app delete'.

func DeleteOAuthAppConfirmation added in v0.57.0

func DeleteOAuthAppConfirmation(c *cli.Context, args deleteOAuthAppArgs) error

DeleteOAuthAppConfirmation is the Before action for 'organizations auth-service oauth-app delete'. It asks for the user to confirm that they want to delete the oauth app.

func DisableAuthServiceAction added in v0.58.0

func DisableAuthServiceAction(cCtx *cli.Context, args disableAuthServiceArgs) error

DisableAuthServiceAction corresponds to 'organizations auth-service disable'.

func DisableAuthServiceConfirmation added in v0.58.0

func DisableAuthServiceConfirmation(c *cli.Context, args disableAuthServiceArgs) error

DisableAuthServiceConfirmation is the Before action for 'organizations auth-service disable'. It asks for the user to confirm that they want to disable the auth service.

func DownloadModuleAction added in v0.42.0

func DownloadModuleAction(c *cli.Context, flags downloadModuleFlags) error

DownloadModuleAction downloads a module.

func EnableAuthServiceAction added in v0.58.0

func EnableAuthServiceAction(cCtx *cli.Context, args enableAuthServiceArgs) error

EnableAuthServiceAction corresponds to 'organizations auth-service enable'.

func Errorf added in v0.7.3

func Errorf(w io.Writer, format string, a ...interface{})

Errorf prints a message prefixed with a bold red "Error: " prefix and exits with 1. It also capitalizes the first letter of the message.

func FTDCParseAction added in v0.89.0

func FTDCParseAction(c *cli.Context, args ftdcArgs) error

FTDCParseAction is the cli action to parse an ftdc file.

func GenerateModuleAction added in v0.47.0

func GenerateModuleAction(cCtx *cli.Context, args generateModuleArgs) error

GenerateModuleAction runs the module generate cli and generates necessary module templates based on user input.

func GetBillingConfigAction added in v0.54.0

func GetBillingConfigAction(cCtx *cli.Context, args getBillingConfigArgs) error

GetBillingConfigAction corresponds to `organizations billing get`.

func ListCustomIndexesAction added in v0.100.0

func ListCustomIndexesAction(c *cli.Context, args listCustomIndexesArgs) error

ListCustomIndexesAction lists all custom indexes for a specified organization and collection type.

func ListLocationsAction added in v0.7.3

func ListLocationsAction(c *cli.Context, args listLocationsArgs) error

ListLocationsAction is the corresponding Action for 'locations list'.

func ListOAuthAppsAction added in v0.58.0

func ListOAuthAppsAction(cCtx *cli.Context, args listOAuthAppsArgs) error

ListOAuthAppsAction corresponds to `organizations auth-service oauth-app list`.

func ListOrganizationsAction added in v0.7.3

func ListOrganizationsAction(cCtx *cli.Context, args emptyArgs) error

ListOrganizationsAction is the corresponding Action for 'organizations list'.

func ListProfilesAction added in v0.56.0

func ListProfilesAction(c *cli.Context, args emptyArgs) error

ListProfilesAction lists all currently supported profiles.

func ListRobotsAction added in v0.7.3

func ListRobotsAction(c *cli.Context, args listRobotsActionArgs) error

ListRobotsAction is the corresponding Action for 'machines list'.

func LocalAppTestingAction added in v0.84.0

func LocalAppTestingAction(ctx *cli.Context, args localAppTestingArgs) error

LocalAppTestingAction is the action for the local-app-testing command.

func LocationAPIKeyCreateAction added in v0.11.0

func LocationAPIKeyCreateAction(cCtx *cli.Context, args locationAPIKeyCreateArgs) error

LocationAPIKeyCreateAction corresponds to `location api-key create`.

func LoginAction added in v0.7.3

func LoginAction(cCtx *cli.Context, args loginActionArgs) error

LoginAction is the corresponding Action for 'login'.

func LoginWithAPIKeyAction added in v0.9.0

func LoginWithAPIKeyAction(cCtx *cli.Context, args loginWithAPIKeyArgs) error

LoginWithAPIKeyAction is the corresponding Action for `login api-key`.

func LogoutAction added in v0.7.3

func LogoutAction(cCtx *cli.Context, args emptyArgs) error

LogoutAction is the corresponding Action for 'logout'.

func MLGetTrainingJobLogs added in v0.40.0

func MLGetTrainingJobLogs(c *cli.Context, args mlGetTrainingJobLogsArgs) error

MLGetTrainingJobLogs is the corresponding action for 'data train logs'.

func MLInferenceInferAction added in v0.62.0

func MLInferenceInferAction(c *cli.Context, args mlInferenceInferArgs) error

MLInferenceInferAction is the corresponding action for 'inference infer'.

func MLListContainers added in v0.104.0

func MLListContainers(c *cli.Context, args mlListContainersArgs) error

MLListContainers is the corresponding action for 'train containers'.

func MLSubmitCustomTrainingJob added in v0.27.0

func MLSubmitCustomTrainingJob(c *cli.Context, args mlSubmitCustomTrainingJobArgs) error

MLSubmitCustomTrainingJob is the corresponding action for 'train submit-custom'.

func MLSubmitCustomTrainingJobWithUpload added in v0.28.0

func MLSubmitCustomTrainingJobWithUpload(c *cli.Context, args mlSubmitCustomTrainingJobWithUploadArgs) error

MLSubmitCustomTrainingJobWithUpload is the corresponding action for 'train submit-custom'.

func MLSubmitTrainingJob added in v0.27.0

func MLSubmitTrainingJob(c *cli.Context, args mlSubmitTrainingJobArgs) error

MLSubmitTrainingJob is the corresponding action for 'train submit'.

func MLTrainingScriptTestLocalAction added in v0.106.0

func MLTrainingScriptTestLocalAction(c *cli.Context, args mlTrainingScriptTestLocalArgs) error

MLTrainingScriptTestLocalAction runs training locally in a Docker container.

func MLTrainingUpdateAction added in v0.29.0

func MLTrainingUpdateAction(c *cli.Context, args mlTrainingUpdateArgs) error

MLTrainingUpdateAction updates the visibility of training scripts.

func MLTrainingUploadAction added in v0.26.0

func MLTrainingUploadAction(c *cli.Context, args mlTrainingUploadArgs) error

MLTrainingUploadAction uploads a new custom training script.

func MachinesPartCopyFilesAction added in v0.27.0

func MachinesPartCopyFilesAction(c *cli.Context, args machinesPartCopyFilesArgs) error

MachinesPartCopyFilesAction is the corresponding Action for 'machines part cp'.

func MachinesPartGetFTDCAction added in v0.78.0

func MachinesPartGetFTDCAction(c *cli.Context, args machinesPartGetFTDCArgs) error

MachinesPartGetFTDCAction is the corresponding Action for 'machines part get-ftdc'.

func MachinesPartListAction added in v0.63.0

func MachinesPartListAction(c *cli.Context, args machinesPartListArgs) error

MachinesPartListAction is the corresponding Action for 'machines part list'.

func MachinesPartRunAction added in v0.59.0

func MachinesPartRunAction(c *cli.Context, args machinesPartRunArgs) error

MachinesPartRunAction is the corresponding Action for 'machines part run'.

func MetadataReadAction added in v0.85.0

func MetadataReadAction(ctx *cli.Context, args metadataReadArgs) error

MetadataReadAction is the action for the CLI command "viam metadata read".

func ModuleBuildLinkRepoAction added in v0.40.0

func ModuleBuildLinkRepoAction(c *cli.Context, args moduleBuildLinkRepoArgs) error

ModuleBuildLinkRepoAction links a github repo to your module.

func ModuleBuildListAction added in v0.17.0

func ModuleBuildListAction(cCtx *cli.Context, args moduleBuildListArgs) error

ModuleBuildListAction lists the module's build jobs.

func ModuleBuildLocalAction added in v0.15.0

func ModuleBuildLocalAction(cCtx *cli.Context, args moduleBuildLocalArgs) error

ModuleBuildLocalAction runs the module's build commands locally.

func ModuleBuildLogsAction added in v0.17.0

func ModuleBuildLogsAction(c *cli.Context, args moduleBuildLogsArgs) error

ModuleBuildLogsAction retrieves the logs for a specific build step.

func ModuleBuildStartAction added in v0.17.0

func ModuleBuildStartAction(cCtx *cli.Context, args moduleBuildStartArgs) error

ModuleBuildStartAction starts a cloud build.

func ModuleRestartAction added in v0.98.0

func ModuleRestartAction(c *cli.Context, args moduleRestartArgs) error

ModuleRestartAction triggers a restart of the requested module.

func NewApp added in v0.7.3

func NewApp(out, errOut io.Writer) *cli.App

NewApp returns a new app with the CLI API, Writer set to out, and ErrWriter set to errOut.

func OrganizationDisableBillingServiceAction added in v0.55.0

func OrganizationDisableBillingServiceAction(cCtx *cli.Context, args organizationDisableBillingServiceArgs) error

OrganizationDisableBillingServiceAction corresponds to `organizations billing disable`.

func OrganizationEnableBillingServiceAction added in v0.56.0

func OrganizationEnableBillingServiceAction(cCtx *cli.Context, args organizationEnableBillingServiceArgs) error

OrganizationEnableBillingServiceAction corresponds to `organizations billing enable`.

func OrganizationLogoSetAction added in v0.55.0

func OrganizationLogoSetAction(cCtx *cli.Context, args organizationsLogoSetArgs) error

OrganizationLogoSetAction corresponds to `organizations logo set`.

func OrganizationsAPIKeyCreateAction added in v0.9.0

func OrganizationsAPIKeyCreateAction(cCtx *cli.Context, args organizationsAPIKeyCreateArgs) error

OrganizationsAPIKeyCreateAction corresponds to `organizations api-key create`.

func OrganizationsLogoGetAction added in v0.55.0

func OrganizationsLogoGetAction(cCtx *cli.Context, args organizationsLogoGetArgs) error

OrganizationsLogoGetAction corresponds to `organizations logo get`.

func OrganizationsSupportEmailGetAction added in v0.54.0

func OrganizationsSupportEmailGetAction(cCtx *cli.Context, args organizationsSupportEmailGetArgs) error

OrganizationsSupportEmailGetAction corresponds to `organizations support-email get`.

func OrganizationsSupportEmailSetAction added in v0.54.0

func OrganizationsSupportEmailSetAction(cCtx *cli.Context, args organizationsSupportEmailSetArgs) error

OrganizationsSupportEmailSetAction corresponds to `organizations support-email set`.

func PackageExportAction added in v0.26.0

func PackageExportAction(c *cli.Context, args packageExportArgs) error

PackageExportAction is the corresponding action for 'package export'.

func PackageUploadAction added in v0.28.0

func PackageUploadAction(c *cli.Context, args packageUploadArgs) error

PackageUploadAction is the corresponding action for "packages upload".

func ParseFileType added in v0.37.0

func ParseFileType(raw string) string

ParseFileType parses output from the `file` command. Returns a platform string like "linux/amd64". Empty string means failed to parse.

func PrintAccessTokenAction added in v0.7.3

func PrintAccessTokenAction(cCtx *cli.Context, args emptyArgs) error

PrintAccessTokenAction is the corresponding Action for 'print-access-token'.

func ReadOAuthAppAction added in v0.58.0

func ReadOAuthAppAction(c *cli.Context, args readOAuthAppArgs) error

ReadOAuthAppAction is the corresponding action for 'organizations auth-service oauth-app read'.

func ReloadModuleAction added in v0.26.0

func ReloadModuleAction(c *cli.Context, args reloadModuleArgs) error

ReloadModuleAction builds a module, configures it on a robot, and starts or restarts it.

func ReloadModuleLocalAction added in v0.98.0

func ReloadModuleLocalAction(c *cli.Context, args reloadModuleArgs) error

ReloadModuleLocalAction builds a module locally, configures it on a robot, and starts or restarts it.

func RemoveProfileAction added in v0.56.0

func RemoveProfileAction(c *cli.Context, args removeProfileArgs) error

RemoveProfileAction removes a CLI profile.

func RobotAPIKeyCreateAction added in v0.11.0

func RobotAPIKeyCreateAction(cCtx *cli.Context, args robotAPIKeyCreateArgs) error

RobotAPIKeyCreateAction corresponds to `machine api-key create`.

func RobotsLogsAction added in v0.9.0

func RobotsLogsAction(c *cli.Context, args robotsLogsArgs) error

RobotsLogsAction is the corresponding Action for 'machines logs'.

func RobotsPartLogsAction added in v0.9.0

func RobotsPartLogsAction(c *cli.Context, args robotsPartLogsArgs) error

RobotsPartLogsAction is the corresponding Action for 'machines part logs'.

func RobotsPartRestartAction added in v0.38.0

func RobotsPartRestartAction(c *cli.Context, args robotsPartRestartArgs) error

RobotsPartRestartAction is the corresponding Action for 'machines part restart'.

func RobotsPartShellAction added in v0.9.0

func RobotsPartShellAction(c *cli.Context, args robotsPartShellArgs) error

RobotsPartShellAction is the corresponding Action for 'machines part shell'.

func RobotsPartStatusAction added in v0.9.0

func RobotsPartStatusAction(c *cli.Context, args robotsPartStatusArgs) error

RobotsPartStatusAction is the corresponding Action for 'machines part status'.

func RobotsPartTunnelAction added in v0.61.0

func RobotsPartTunnelAction(c *cli.Context, args robotsPartTunnelArgs) error

RobotsPartTunnelAction is the corresponding Action for 'machines part tunnel'.

func RobotsStatusAction added in v0.9.0

func RobotsStatusAction(c *cli.Context, args robotsStatusArgs) error

RobotsStatusAction is the corresponding Action for 'machines status'.

func UpdateBillingServiceAction added in v0.55.0

func UpdateBillingServiceAction(cCtx *cli.Context, args updateBillingServiceArgs) error

UpdateBillingServiceAction corresponds to `organizations billing-service update`.

func UpdateCLIAction added in v0.108.0

func UpdateCLIAction(c *cli.Context, args emptyArgs) error

UpdateCLIAction updates the CLI to the latest version.

func UpdateMachineAction added in v0.107.0

func UpdateMachineAction(c *cli.Context, args updateMachineActionArgs) error

UpdateMachineAction is the corresponding action for 'machines move'.

func UpdateModelsAction added in v0.12.0

func UpdateModelsAction(c *cli.Context, args updateModelsArgs) error

UpdateModelsAction figures out the models that a module supports and updates it's metadata file.

func UpdateModuleAction added in v0.7.3

func UpdateModuleAction(c *cli.Context, args updateModuleArgs) error

UpdateModuleAction is the corresponding Action for 'module update'. It runs the command to update a module. This includes updating the meta.json to include the public namespace (if set on the org).

func UpdateOAuthAppAction added in v0.58.0

func UpdateOAuthAppAction(c *cli.Context, args updateOAuthAppArgs) error

UpdateOAuthAppAction is the corresponding action for 'oauth-app update'.

func UpdateProfileAction added in v0.56.0

func UpdateProfileAction(c *cli.Context, args addOrUpdateProfileArgs) error

UpdateProfileAction updates an existing CLI profile, or adds it if it doesn't already exist.

func UploadModuleAction added in v0.7.3

func UploadModuleAction(c *cli.Context, args uploadModuleArgs) error

UploadModuleAction is the corresponding action for 'module upload'.

func VersionAction added in v0.7.3

func VersionAction(c *cli.Context, args emptyArgs) error

VersionAction is the corresponding Action for 'version'.

func WhoAmIAction added in v0.7.3

func WhoAmIAction(cCtx *cli.Context, args emptyArgs) error

WhoAmIAction is the corresponding Action for 'whoami'.

Types

type AliasStringFlag added in v0.17.0

type AliasStringFlag struct {
	cli.StringFlag
}

AliasStringFlag returns f.Name as the last member of Names(), and hides aliases from the String representation of the flag. This is useful for decluttering error messages and help text when aliases shouldn't be exposed to the user. Otherwise it is the same as cli.StringFlag.

func (AliasStringFlag) Names added in v0.17.0

func (f AliasStringFlag) Names() []string

Names have to be overwritten to prevent required flag errors from using aliases in its message. This returns f.Name as the last member of Names(), which is what the required flag error uses in its message.

func (*AliasStringFlag) String added in v0.63.0

func (f *AliasStringFlag) String() string

String has to be overwritten to avoid cluttering help text with all aliases for a flag, (e.g., `--organization, --org-id, --org-name, --org`). Instead, the string representation includes just the expected, canonical flag name.

type Annotation added in v0.33.0

type Annotation struct {
	AnnotationLabel string `json:"annotation_label"`
}

Annotation holds the label associated with the image.

type AppComponent added in v0.67.0

type AppComponent struct {
	Name           string             `json:"name"`
	Type           string             `json:"type"`
	Entrypoint     string             `json:"entrypoint"`
	FragmentIDs    []string           `json:"fragmentIds,omitempty"`
	LogoPath       string             `json:"logoPath,omitempty"`
	Customizations *AppCustomizations `json:"customizations,omitempty"`
}

AppComponent represents metadata used to distinguish and describe an app.

type AppCustomizations added in v0.82.0

type AppCustomizations struct {
	MachinePicker *MachinePickerCustomizations `json:"machinePicker,omitempty"`
}

AppCustomizations holds customizations for different app UI components.

type BBoxAnnotation added in v0.33.0

type BBoxAnnotation struct {
	AnnotationLabel string  `json:"annotation_label"`
	XMinNormalized  float64 `json:"x_min_normalized"`
	XMaxNormalized  float64 `json:"x_max_normalized"`
	YMinNormalized  float64 `json:"y_min_normalized"`
	YMaxNormalized  float64 `json:"y_max_normalized"`
}

BBoxAnnotation holds the information associated with each bounding box.

type Config

type Config struct {
	BaseURL         string     `json:"base_url"`
	Auth            authMethod `json:"auth"`
	LastUpdateCheck string     `json:"last_update_check"`
	LatestVersion   string     `json:"latest_version"`

	DefaultOrg      string `json:"default_org"`
	DefaultLocation string `json:"default_location"`
	// contains filtered or unexported fields
}

Config is the schema for saved CLI credentials.

func ConfigFromCache added in v0.29.0

func ConfigFromCache(c *cli.Context) (*Config, error)

ConfigFromCache parses the cached json into a Config. Removes the config from cache on any error. TODO(RSDK-7812): maybe move shared code to common location.

func (*Config) DialOptions added in v0.29.0

func (conf *Config) DialOptions() ([]rpc.DialOption, error)

DialOptions constructs an rpc.DialOption slice from config.

type ImageMetadata added in v0.33.0

type ImageMetadata struct {
	ImagePath                 string           `json:"image_path"`
	ClassificationAnnotations []Annotation     `json:"classification_annotations"`
	BBoxAnnotations           []BBoxAnnotation `json:"bounding_box_annotations"`
	Timestamp                 string           `json:"timestamp"`
	BinaryDataID              string           `json:"binary_data_id,omitempty"`
	OrganizationID            string           `json:"organization_id,omitempty"`
	RobotID                   string           `json:"robot_id,omitempty"`
	LocationID                string           `json:"location_id,omitempty"`
	PartID                    string           `json:"part_id,omitempty"`
	ComponentName             string           `json:"component_name,omitempty"`
}

ImageMetadata defines the format of the data in jsonlines for custom training.

type MLMetadata added in v0.26.0

type MLMetadata struct {
	Draft     bool
	ModelType string
	Framework string
	URL       string
}

MLMetadata struct stores package info for ML training packages.

type MachinePickerCustomizations added in v0.82.0

type MachinePickerCustomizations struct {
	Heading    string `json:"heading,omitempty"`
	Subheading string `json:"subheading,omitempty"`
}

MachinePickerCustomizations holds custom branding text for the machine picker UI.

type ModelFramework added in v0.26.0

type ModelFramework string

ModelFramework refers to the backend framework of the model.

type ModelType added in v0.26.0

type ModelType string

ModelType refers to the type of the model.

type ModuleComponent added in v0.5.0

type ModuleComponent struct {
	API          string  `json:"api"`
	Model        string  `json:"model"`
	Description  *string `json:"short_description,omitempty"`
	MarkdownLink *string `json:"markdown_link,omitempty"`
}

ModuleComponent represents an api - model pair.

type ModuleManifest added in v0.5.0

type ModuleManifest struct {
	Schema       string            `json:"$schema"`
	ModuleID     string            `json:"module_id"`
	Visibility   string            `json:"visibility"`
	URL          string            `json:"url"`
	Description  string            `json:"description"`
	Models       []ModuleComponent `json:"models,omitempty"`
	Apps         []AppComponent    `json:"applications"`
	MarkdownLink *string           `json:"markdown_link,omitempty"`
	// JsonManifest provides fields shared with RDK proper.
	modconfig.JSONManifest
	Build *manifestBuildInfo `json:"build,omitempty"`
}

ModuleManifest is used to create & parse manifest.json. Detailed user-facing docs for this are in module.schema.json.

type ModuleMap added in v0.26.0

type ModuleMap map[string]any

ModuleMap is a type alias to indicate where a map represents a module config. We don't convert to rdkConfig.Module because it can get out of date with what's in the db. Using maps directly also saves a lot of high-maintenance ser/des work.

type PackageType added in v0.26.0

type PackageType string

PackageType refers to the type of the package.

type ProgressManager added in v0.100.0

type ProgressManager struct {
	// contains filtered or unexported fields
}

ProgressManager manages a sequence of steps with spinners (sequential display).

func NewProgressManager added in v0.100.0

func NewProgressManager(steps []*Step, opts ...ProgressManagerOption) *ProgressManager

NewProgressManager creates a new ProgressManager with all steps registered upfront.

func (*ProgressManager) Complete added in v0.100.0

func (pm *ProgressManager) Complete(stepID string) error

Complete marks a step as completed with a success message.

func (*ProgressManager) CompleteWithMessage added in v0.100.0

func (pm *ProgressManager) CompleteWithMessage(stepID, message string) error

CompleteWithMessage marks a step as completed with a custom message.

func (*ProgressManager) Fail added in v0.100.0

func (pm *ProgressManager) Fail(stepID string, err error) error

Fail marks a step as failed with an error message.

func (*ProgressManager) FailWithMessage added in v0.100.0

func (pm *ProgressManager) FailWithMessage(stepID, message string) error

FailWithMessage marks a step as failed with a custom message.

func (*ProgressManager) Start added in v0.100.0

func (pm *ProgressManager) Start(stepID string) error

Start begins animating the spinner for the given step ID.

func (*ProgressManager) Stop added in v0.100.0

func (pm *ProgressManager) Stop()

Stop stops any active spinner.

func (*ProgressManager) UpdateText added in v0.100.0

func (pm *ProgressManager) UpdateText(text string)

UpdateText updates the text of the currently active spinner (for progress updates).

type ProgressManagerOption added in v0.100.0

type ProgressManagerOption func(*ProgressManager)

ProgressManagerOption allows customizing ProgressManager behavior at creation time.

func WithProgressOutput added in v0.100.0

func WithProgressOutput(enabled bool) ProgressManagerOption

WithProgressOutput enables or disables terminal output for a ProgressManager.

type ResourceMap added in v0.90.0

type ResourceMap map[string]any

ResourceMap is the same kind of thing as ModuleMap (see above), a map representing a single resource.

type Step added in v0.100.0

type Step struct {
	ID           string
	Message      string
	Status       StepStatus
	CompletedMsg string // Optional: Custom message when completed
	FailedMsg    string // Optional: Custom message when failed
	IndentLevel  int    // 0 = root, 1 = child (→), 2 = nested child, etc.
	// contains filtered or unexported fields
}

Step represents a single progress step.

type StepStatus added in v0.100.0

type StepStatus int

StepStatus represents the state of a progress step.

const (
	// StepPending indicates a step has not yet started.
	StepPending StepStatus = iota
	// StepRunning indicates a step is currently in progress.
	StepRunning
	// StepCompleted indicates a step finished successfully.
	StepCompleted
	// StepFailed indicates a step encountered an error.
	StepFailed
)

Directories

Path Synopsis
internal
cli_lint command
Package main is the CLI-specific linter itself.
Package main is the CLI-specific linter itself.
module_generate
modulegen
Package modulegen contains defined types used for module generation
Package modulegen contains defined types used for module generation
scripts
Package scripts contains scripts that generate method stubs for modules
Package scripts contains scripts that generate method stubs for modules
Package main is the CLI command itself.
Package main is the CLI command itself.

Jump to

Keyboard shortcuts

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