Skip to content

Commit 4f96209

Browse files
BWDC (#2264)
Co-authored-by: Adam Thomas Jagger Bramley <[email protected]>
1 parent ebb2f63 commit 4f96209

File tree

1 file changed

+215
-0
lines changed

1 file changed

+215
-0
lines changed

src/bwdc.ts

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
const bwLogo32x32 = "https://bitwarden.com/images/icon_32x32.png";
2+
const completionSpec: Fig.Spec = {
3+
name: "bwdc",
4+
description: "Bitwarden Directory Connector",
5+
subcommands: [
6+
{
7+
name: "login",
8+
icon: bwLogo32x32,
9+
description: "Log in to Directory Connector",
10+
args: [
11+
{
12+
name: "client_id",
13+
description: "Organisation API client_id",
14+
isOptional: true,
15+
},
16+
{
17+
name: "client_secret",
18+
description: "Organisation API client_secret",
19+
isOptional: true,
20+
},
21+
],
22+
options: [
23+
{
24+
name: "--help",
25+
},
26+
],
27+
},
28+
{
29+
name: "logout",
30+
icon: bwLogo32x32,
31+
description: "Log out of Directory Connector",
32+
33+
options: [
34+
{
35+
name: "--help",
36+
},
37+
],
38+
},
39+
{
40+
name: "test",
41+
icon: bwLogo32x32,
42+
description:
43+
"Prints a JSON formatted array of groups and users that would be synced to your Bitwarden organization",
44+
45+
options: [
46+
{
47+
name: "--last",
48+
description: "Test only the changes since the last successful sync",
49+
},
50+
{
51+
name: "--help",
52+
},
53+
],
54+
},
55+
{
56+
name: "sync",
57+
icon: bwLogo32x32,
58+
description:
59+
"Run a live sync operation and push data to your Bitwarden organization",
60+
61+
options: [
62+
{
63+
name: "--help",
64+
},
65+
],
66+
},
67+
{
68+
name: "last-sync",
69+
icon: bwLogo32x32,
70+
description:
71+
"The last-sync command returns an ISO 8601 timestamp for the last sync operation that was performed for users or groups. You must specify either users or groups as an <object> to run the command against- Returns an empty response if no sync has been performed for the given object",
72+
args: {
73+
name: "Object",
74+
description:
75+
"You must specify either users or groups as an <object> to run the command against",
76+
},
77+
78+
options: [
79+
{
80+
name: "--help",
81+
},
82+
],
83+
},
84+
85+
{
86+
name: "config",
87+
icon: bwLogo32x32,
88+
description:
89+
"The config command allows you to specify your directory settings",
90+
args: [
91+
{
92+
name: "setting",
93+
description: "Specify the setting to configure",
94+
},
95+
{
96+
name: "value",
97+
description: "Specify the value assigned to the setting",
98+
},
99+
],
100+
101+
subcommands: [
102+
{
103+
name: "server",
104+
description:
105+
"URL of your self-hosted installation (e.g. https://my.url.com) or https://vault.bitwarden.eu",
106+
args: {
107+
name: "server-url",
108+
description: "Specify the server URL",
109+
},
110+
},
111+
{
112+
name: "directory",
113+
description: "Type of directory to use",
114+
args: {
115+
name: "directory-type",
116+
description: `Active Directory/LDAP : 0
117+
Azure Active Directory : 1
118+
Google Workspace/GSuite : 2
119+
Okta : 3
120+
OneLogin : 4`,
121+
suggestions: [
122+
{ name: "0", description: "Active Directory/LDAP" },
123+
{ name: "1", description: "Azure Active Directory" },
124+
{ name: "2", description: "Google Workspace/GSuite" },
125+
{ name: "3", description: "Okta" },
126+
{ name: "4", description: "OneLogin" },
127+
],
128+
},
129+
},
130+
{
131+
name: "ldap.password",
132+
description: "Password for connection to the LDAP server",
133+
args: {
134+
name: "password",
135+
description: "Specify the password",
136+
},
137+
},
138+
{
139+
name: "azure.key",
140+
description: "Azure AD secret key",
141+
args: {
142+
name: "key",
143+
description: "Specify the AD secret key",
144+
},
145+
},
146+
{
147+
name: "gsuite.key",
148+
description: "Google Workspace/GSuite private key",
149+
args: {
150+
name: "key",
151+
description: "Specify the Google Workspace/GSuite private key",
152+
},
153+
},
154+
{
155+
name: "okta.token",
156+
description: "Okta token",
157+
args: {
158+
name: "token",
159+
description: "Specify the Okta token",
160+
},
161+
},
162+
{
163+
name: "onelogin.secret",
164+
description: "OneLogin client secret",
165+
args: {
166+
name: "secret",
167+
description: "Specify the OneLogin client secret",
168+
},
169+
},
170+
],
171+
options: [
172+
{
173+
name: "--help",
174+
},
175+
],
176+
},
177+
{
178+
name: "data-file",
179+
icon: bwLogo32x32,
180+
description: "Path to data.json database file",
181+
182+
options: [
183+
{
184+
name: "--help",
185+
},
186+
],
187+
},
188+
{
189+
name: "clear-cache",
190+
icon: bwLogo32x32,
191+
description:
192+
"The clear-cache command allows you to clear cached data that the application stores while performing sync operations",
193+
options: [
194+
{
195+
name: "--help",
196+
},
197+
],
198+
},
199+
{
200+
name: "update",
201+
icon: bwLogo32x32,
202+
description:
203+
"The update command allows you to check if your Directory Connector CLI is up-to-date",
204+
},
205+
],
206+
options: [
207+
{
208+
name: "--help",
209+
description: "Show help for bwdc",
210+
},
211+
],
212+
// Only uncomment if bwdc takes an argument
213+
// args: {}
214+
};
215+
export default completionSpec;

0 commit comments

Comments
 (0)