Skip to content

chore: unhide multi-organization cli commands #14693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cli/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func (r *RootCmd) organizations() *serpent.Command {
Use: "organizations [subcommand]",
Short: "Organization related commands",
Aliases: []string{"organization", "org", "orgs"},
Hidden: true, // Hidden until these commands are complete.
Handler: func(inv *serpent.Invocation) error {
return inv.Command.HelpHandler(inv)
},
Expand Down
2 changes: 0 additions & 2 deletions cli/organizationmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ func (r *RootCmd) createOrganization() *serpent.Command {
cmd := &serpent.Command{
Use: "create <organization name>",
Short: "Create a new organization.",
// This action is currently irreversible, so it's hidden until we have a way to delete organizations.
Hidden: true,
Middleware: serpent.Chain(
r.InitClient(client),
serpent.RequireNArgs(1),
Expand Down
1 change: 0 additions & 1 deletion cli/organizationroles.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func (r *RootCmd) organizationRoles(orgContext *OrganizationContext) *serpent.Co
Handler: func(inv *serpent.Invocation) error {
return inv.Command.HelpHandler(inv)
},
Hidden: true,
Children: []*serpent.Command{
r.showOrganizationRoles(orgContext),
r.editOrganizationRole(orgContext),
Expand Down
1 change: 1 addition & 0 deletions cli/testdata/coder_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SUBCOMMANDS:
netcheck Print network debug information for DERP and STUN
notifications Manage Coder notifications
open Open a workspace
organizations Organization related commands
ping Ping a workspace
port-forward Forward ports from a workspace to the local machine. For
reverse port forwarding, use "coder ssh -R".
Expand Down
23 changes: 23 additions & 0 deletions cli/testdata/coder_organizations_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
coder v0.0.0-devel

USAGE:
coder organizations [flags] [subcommand]

Organization related commands

Aliases: organization, org, orgs

SUBCOMMANDS:
create Create a new organization.
members Manage organization members
roles Manage organization roles.
show Show the organization. Using "selected" will show the selected
organization from the "--org" flag. Using "me" will show all
organizations you are a member of.

OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

———
Run `coder --help` for a list of global options.
13 changes: 13 additions & 0 deletions cli/testdata/coder_organizations_create_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
coder v0.0.0-devel

USAGE:
coder organizations create [flags] <organization name>

Create a new organization.

OPTIONS:
-y, --yes bool
Bypass prompts.

———
Run `coder --help` for a list of global options.
17 changes: 17 additions & 0 deletions cli/testdata/coder_organizations_members_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
coder v0.0.0-devel

USAGE:
coder organizations members

Manage organization members

Aliases: member

SUBCOMMANDS:
add Add a new member to the current organization
edit-roles Edit organization member's roles
list List all organization members
remove Remove a new member to the current organization

———
Run `coder --help` for a list of global options.
9 changes: 9 additions & 0 deletions cli/testdata/coder_organizations_members_add_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coder v0.0.0-devel

USAGE:
coder organizations members add <username | user_id>

Add a new member to the current organization

———
Run `coder --help` for a list of global options.
11 changes: 11 additions & 0 deletions cli/testdata/coder_organizations_members_edit-roles_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coder v0.0.0-devel

USAGE:
coder organizations members edit-roles <username | user_id> [roles...]

Edit organization member's roles

Aliases: edit-role

———
Run `coder --help` for a list of global options.
16 changes: 16 additions & 0 deletions cli/testdata/coder_organizations_members_list_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
coder v0.0.0-devel

USAGE:
coder organizations members list [flags]

List all organization members

OPTIONS:
-c, --column [username|name|user id|organization id|created at|updated at|organization roles] (default: username,organization roles)
Columns to display in table output.

-o, --output table|json (default: table)
Output format.

———
Run `coder --help` for a list of global options.
11 changes: 11 additions & 0 deletions cli/testdata/coder_organizations_members_remove_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coder v0.0.0-devel

USAGE:
coder organizations members remove <username | user_id>

Remove a new member to the current organization

Aliases: rm

———
Run `coder --help` for a list of global options.
15 changes: 15 additions & 0 deletions cli/testdata/coder_organizations_roles_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coder v0.0.0-devel

USAGE:
coder organizations roles

Manage organization roles.

Aliases: role

SUBCOMMANDS:
edit Edit an organization custom role
show Show role(s)

———
Run `coder --help` for a list of global options.
29 changes: 29 additions & 0 deletions cli/testdata/coder_organizations_roles_edit_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
coder v0.0.0-devel

USAGE:
coder organizations roles edit [flags] <role_name>

Edit an organization custom role

- Run with an input.json file:

$ coder roles edit --stdin < role.json

OPTIONS:
-c, --column [name|display name|organization id|site permissions|organization permissions|user permissions] (default: name,display name,site permissions,organization permissions,user permissions)
Columns to display in table output.

--dry-run bool
Does all the work, but does not submit the final updated role.

-o, --output table|json (default: table)
Output format.

--stdin bool
Reads stdin for the json role definition to upload.

-y, --yes bool
Bypass prompts.

———
Run `coder --help` for a list of global options.
16 changes: 16 additions & 0 deletions cli/testdata/coder_organizations_roles_show_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
coder v0.0.0-devel

USAGE:
coder organizations roles show [flags] [role_names ...]

Show role(s)

OPTIONS:
-c, --column [name|display name|organization id|site permissions|organization permissions|user permissions] (default: name,display name,site permissions,organization permissions,user permissions)
Columns to display in table output.

-o, --output table|json (default: table)
Output format.

———
Run `coder --help` for a list of global options.
38 changes: 38 additions & 0 deletions cli/testdata/coder_organizations_show_--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
coder v0.0.0-devel

USAGE:
coder organizations show [flags] ["selected"|"me"|uuid|org_name]

Show the organization. Using "selected" will show the selected organization
from the "--org" flag. Using "me" will show all organizations you are a member
of.

- coder org show selected:

$ Shows the organizations selected with '--org=<org_name>'. This
organization is the organization used by the cli.

- coder org show me:

$ List of all organizations you are a member of.

- coder org show developers:

$ Show organization with name 'developers'

- coder org show 90ee1875-3db5-43b3-828e-af3687522e43:

$ Show organization with the given ID.

OPTIONS:
-c, --column [id|name|display name|icon|description|created at|updated at|default] (default: id,name,default)
Columns to display in table output.

--only-id bool
Only print the organization ID.

-o, --output text|table|json (default: text)
Output format.

———
Run `coder --help` for a list of global options.
75 changes: 75 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,61 @@
"description": "Open a workspace in VS Code Desktop",
"path": "reference/cli/open_vscode.md"
},
{
"title": "organizations",
"description": "Organization related commands",
"path": "reference/cli/organizations.md"
},
{
"title": "organizations create",
"description": "Create a new organization.",
"path": "reference/cli/organizations_create.md"
},
{
"title": "organizations members",
"description": "Manage organization members",
"path": "reference/cli/organizations_members.md"
},
{
"title": "organizations members add",
"description": "Add a new member to the current organization",
"path": "reference/cli/organizations_members_add.md"
},
{
"title": "organizations members edit-roles",
"description": "Edit organization member's roles",
"path": "reference/cli/organizations_members_edit-roles.md"
},
{
"title": "organizations members list",
"description": "List all organization members",
"path": "reference/cli/organizations_members_list.md"
},
{
"title": "organizations members remove",
"description": "Remove a new member to the current organization",
"path": "reference/cli/organizations_members_remove.md"
},
{
"title": "organizations roles",
"description": "Manage organization roles.",
"path": "reference/cli/organizations_roles.md"
},
{
"title": "organizations roles edit",
"description": "Edit an organization custom role",
"path": "reference/cli/organizations_roles_edit.md"
},
{
"title": "organizations roles show",
"description": "Show role(s)",
"path": "reference/cli/organizations_roles_show.md"
},
{
"title": "organizations show",
"description": "Show the organization. Using \"selected\" will show the selected organization from the \"--org\" flag. Using \"me\" will show all organizations you are a member of.",
"path": "reference/cli/organizations_show.md"
},
{
"title": "ping",
"description": "Ping a workspace",
Expand All @@ -822,6 +877,26 @@
"description": "Manage provisioner daemons",
"path": "reference/cli/provisionerd.md"
},
{
"title": "provisionerd keys",
"description": "Manage provisioner keys",
"path": "reference/cli/provisionerd_keys.md"
},
{
"title": "provisionerd keys create",
"description": "Create a new provisioner key",
"path": "reference/cli/provisionerd_keys_create.md"
},
{
"title": "provisionerd keys delete",
"description": "Delete a provisioner key",
"path": "reference/cli/provisionerd_keys_delete.md"
},
{
"title": "provisionerd keys list",
"description": "List provisioner keys in an organization",
"path": "reference/cli/provisionerd_keys_list.md"
},
{
"title": "provisionerd start",
"description": "Run a provisioner daemon",
Expand Down
1 change: 1 addition & 0 deletions docs/reference/cli/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions docs/reference/cli/organizations.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions docs/reference/cli/organizations_create.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading