Skip to content

Commit be516f9

Browse files
authored
chore: unhide multi-organization cli commands (#14693)
* chore: unhide multi-organization cli commands Multi-org is going into GA, unhide cli commands
1 parent 370f0b9 commit be516f9

38 files changed

+725
-7
lines changed

cli/organization.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func (r *RootCmd) organizations() *serpent.Command {
1818
Use: "organizations [subcommand]",
1919
Short: "Organization related commands",
2020
Aliases: []string{"organization", "org", "orgs"},
21-
Hidden: true, // Hidden until these commands are complete.
2221
Handler: func(inv *serpent.Invocation) error {
2322
return inv.Command.HelpHandler(inv)
2423
},

cli/organizationmanage.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ func (r *RootCmd) createOrganization() *serpent.Command {
1818
cmd := &serpent.Command{
1919
Use: "create <organization name>",
2020
Short: "Create a new organization.",
21-
// This action is currently irreversible, so it's hidden until we have a way to delete organizations.
22-
Hidden: true,
2321
Middleware: serpent.Chain(
2422
r.InitClient(client),
2523
serpent.RequireNArgs(1),

cli/organizationroles.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func (r *RootCmd) organizationRoles(orgContext *OrganizationContext) *serpent.Co
2424
Handler: func(inv *serpent.Invocation) error {
2525
return inv.Command.HelpHandler(inv)
2626
},
27-
Hidden: true,
2827
Children: []*serpent.Command{
2928
r.showOrganizationRoles(orgContext),
3029
r.editOrganizationRole(orgContext),

cli/testdata/coder_--help.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SUBCOMMANDS:
3131
netcheck Print network debug information for DERP and STUN
3232
notifications Manage Coder notifications
3333
open Open a workspace
34+
organizations Organization related commands
3435
ping Ping a workspace
3536
port-forward Forward ports from a workspace to the local machine. For
3637
reverse port forwarding, use "coder ssh -R".
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations [flags] [subcommand]
5+
6+
Organization related commands
7+
8+
Aliases: organization, org, orgs
9+
10+
SUBCOMMANDS:
11+
create Create a new organization.
12+
members Manage organization members
13+
roles Manage organization roles.
14+
show Show the organization. Using "selected" will show the selected
15+
organization from the "--org" flag. Using "me" will show all
16+
organizations you are a member of.
17+
18+
OPTIONS:
19+
-O, --org string, $CODER_ORGANIZATION
20+
Select which organization (uuid or name) to use.
21+
22+
———
23+
Run `coder --help` for a list of global options.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations create [flags] <organization name>
5+
6+
Create a new organization.
7+
8+
OPTIONS:
9+
-y, --yes bool
10+
Bypass prompts.
11+
12+
———
13+
Run `coder --help` for a list of global options.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations members
5+
6+
Manage organization members
7+
8+
Aliases: member
9+
10+
SUBCOMMANDS:
11+
add Add a new member to the current organization
12+
edit-roles Edit organization member's roles
13+
list List all organization members
14+
remove Remove a new member to the current organization
15+
16+
———
17+
Run `coder --help` for a list of global options.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations members add <username | user_id>
5+
6+
Add a new member to the current organization
7+
8+
———
9+
Run `coder --help` for a list of global options.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations members edit-roles <username | user_id> [roles...]
5+
6+
Edit organization member's roles
7+
8+
Aliases: edit-role
9+
10+
———
11+
Run `coder --help` for a list of global options.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations members list [flags]
5+
6+
List all organization members
7+
8+
OPTIONS:
9+
-c, --column [username|name|user id|organization id|created at|updated at|organization roles] (default: username,organization roles)
10+
Columns to display in table output.
11+
12+
-o, --output table|json (default: table)
13+
Output format.
14+
15+
———
16+
Run `coder --help` for a list of global options.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations members remove <username | user_id>
5+
6+
Remove a new member to the current organization
7+
8+
Aliases: rm
9+
10+
———
11+
Run `coder --help` for a list of global options.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations roles
5+
6+
Manage organization roles.
7+
8+
Aliases: role
9+
10+
SUBCOMMANDS:
11+
edit Edit an organization custom role
12+
show Show role(s)
13+
14+
———
15+
Run `coder --help` for a list of global options.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations roles edit [flags] <role_name>
5+
6+
Edit an organization custom role
7+
8+
- Run with an input.json file:
9+
10+
$ coder roles edit --stdin < role.json
11+
12+
OPTIONS:
13+
-c, --column [name|display name|organization id|site permissions|organization permissions|user permissions] (default: name,display name,site permissions,organization permissions,user permissions)
14+
Columns to display in table output.
15+
16+
--dry-run bool
17+
Does all the work, but does not submit the final updated role.
18+
19+
-o, --output table|json (default: table)
20+
Output format.
21+
22+
--stdin bool
23+
Reads stdin for the json role definition to upload.
24+
25+
-y, --yes bool
26+
Bypass prompts.
27+
28+
———
29+
Run `coder --help` for a list of global options.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations roles show [flags] [role_names ...]
5+
6+
Show role(s)
7+
8+
OPTIONS:
9+
-c, --column [name|display name|organization id|site permissions|organization permissions|user permissions] (default: name,display name,site permissions,organization permissions,user permissions)
10+
Columns to display in table output.
11+
12+
-o, --output table|json (default: table)
13+
Output format.
14+
15+
———
16+
Run `coder --help` for a list of global options.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder organizations show [flags] ["selected"|"me"|uuid|org_name]
5+
6+
Show the organization. Using "selected" will show the selected organization
7+
from the "--org" flag. Using "me" will show all organizations you are a member
8+
of.
9+
10+
- coder org show selected:
11+
12+
$ Shows the organizations selected with '--org=<org_name>'. This
13+
organization is the organization used by the cli.
14+
15+
- coder org show me:
16+
17+
$ List of all organizations you are a member of.
18+
19+
- coder org show developers:
20+
21+
$ Show organization with name 'developers'
22+
23+
- coder org show 90ee1875-3db5-43b3-828e-af3687522e43:
24+
25+
$ Show organization with the given ID.
26+
27+
OPTIONS:
28+
-c, --column [id|name|display name|icon|description|created at|updated at|default] (default: id,name,default)
29+
Columns to display in table output.
30+
31+
--only-id bool
32+
Only print the organization ID.
33+
34+
-o, --output text|table|json (default: text)
35+
Output format.
36+
37+
———
38+
Run `coder --help` for a list of global options.

docs/manifest.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,61 @@
807807
"description": "Open a workspace in VS Code Desktop",
808808
"path": "reference/cli/open_vscode.md"
809809
},
810+
{
811+
"title": "organizations",
812+
"description": "Organization related commands",
813+
"path": "reference/cli/organizations.md"
814+
},
815+
{
816+
"title": "organizations create",
817+
"description": "Create a new organization.",
818+
"path": "reference/cli/organizations_create.md"
819+
},
820+
{
821+
"title": "organizations members",
822+
"description": "Manage organization members",
823+
"path": "reference/cli/organizations_members.md"
824+
},
825+
{
826+
"title": "organizations members add",
827+
"description": "Add a new member to the current organization",
828+
"path": "reference/cli/organizations_members_add.md"
829+
},
830+
{
831+
"title": "organizations members edit-roles",
832+
"description": "Edit organization member's roles",
833+
"path": "reference/cli/organizations_members_edit-roles.md"
834+
},
835+
{
836+
"title": "organizations members list",
837+
"description": "List all organization members",
838+
"path": "reference/cli/organizations_members_list.md"
839+
},
840+
{
841+
"title": "organizations members remove",
842+
"description": "Remove a new member to the current organization",
843+
"path": "reference/cli/organizations_members_remove.md"
844+
},
845+
{
846+
"title": "organizations roles",
847+
"description": "Manage organization roles.",
848+
"path": "reference/cli/organizations_roles.md"
849+
},
850+
{
851+
"title": "organizations roles edit",
852+
"description": "Edit an organization custom role",
853+
"path": "reference/cli/organizations_roles_edit.md"
854+
},
855+
{
856+
"title": "organizations roles show",
857+
"description": "Show role(s)",
858+
"path": "reference/cli/organizations_roles_show.md"
859+
},
860+
{
861+
"title": "organizations show",
862+
"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.",
863+
"path": "reference/cli/organizations_show.md"
864+
},
810865
{
811866
"title": "ping",
812867
"description": "Ping a workspace",
@@ -822,6 +877,26 @@
822877
"description": "Manage provisioner daemons",
823878
"path": "reference/cli/provisionerd.md"
824879
},
880+
{
881+
"title": "provisionerd keys",
882+
"description": "Manage provisioner keys",
883+
"path": "reference/cli/provisionerd_keys.md"
884+
},
885+
{
886+
"title": "provisionerd keys create",
887+
"description": "Create a new provisioner key",
888+
"path": "reference/cli/provisionerd_keys_create.md"
889+
},
890+
{
891+
"title": "provisionerd keys delete",
892+
"description": "Delete a provisioner key",
893+
"path": "reference/cli/provisionerd_keys_delete.md"
894+
},
895+
{
896+
"title": "provisionerd keys list",
897+
"description": "List provisioner keys in an organization",
898+
"path": "reference/cli/provisionerd_keys_list.md"
899+
},
825900
{
826901
"title": "provisionerd start",
827902
"description": "Run a provisioner daemon",

docs/reference/cli/README.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cli/organizations.md

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cli/organizations_create.md

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)