Skip to content

Add fglatch set-workspace tool #25

@msto

Description

@msto

Summary

This tool should accept a single argument, a workspace ID or name.

If the argument is numeric (str.isdigit()), assume it is a workspace ID. Otherwise, assume it is a workspace name (or substring), and search for the (lowercased) name in the available workspaces.

Use user_config.update_workspace() to set the workspace.
https://github.com/latchbio/latch/blob/e0e83673bb418f03d6e221acb4ae7ae829d8f8e9/src/latch_cli/services/workspace.py#L42

Use latch.utils.get_workspaces() to get the available workspaces. (It returns a mapping of workspace IDs to workspace names)
https://github.com/latchbio/latch/blob/e0e83673bb418f03d6e221acb4ae7ae829d8f8e9/src/latch_cli/services/register/register.py#L385

If the provided argument is not an exact match for a workspace ID or a fuzzy match for a workspace name, raise an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions