Skip to content

CLI Org support #11927

Closed
Closed
@Emyrk

Description

@Emyrk

coder/cli/root.go

Lines 664 to 673 in 993c1a6

// CurrentOrganization returns the currently active organization for the authenticated user.
func CurrentOrganization(inv *clibase.Invocation, client *codersdk.Client) (codersdk.Organization, error) {
orgs, err := client.OrganizationsByUser(inv.Context(), codersdk.Me)
if err != nil {
return codersdk.Organization{}, nil
}
// For now, we won't use the config to set this.
// Eventually, we will support changing using "coder switch <org>"
return orgs[0], nil
}

The current cli only supports 1 org. The comment suggests scoping all cli calls to 1 org. Meaning coder ls will only show the workspaces in the current org.

Metadata

Metadata

Assignees

Labels

design neededRequest for more beautyneeds decisionNeeds a higher-level decision to be unblocked.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions