Skip to content

Commit ef09f75

Browse files
fix format
1 parent 33fd5a2 commit ef09f75

File tree

1 file changed

+123
-112
lines changed

1 file changed

+123
-112
lines changed

fern/docs/pages/references/cli.mdx

Lines changed: 123 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,44 @@ Use `devrev [command] --help` for more information about a command.
1919

2020
## Authentication
2121

22-
To authenticate, run the following command:
22+
<AccordionGroup>
23+
<Accordion title="Authenticate">
24+
To authenticate, run the following command:
2325

24-
```bash
25-
devrev profiles authenticate --org <DevOrg-slug-name> --usr <[email protected]>
26-
```
26+
```bash
27+
devrev profiles authenticate --org <DevOrg-slug-name> --usr <[email protected]>
28+
```
2729

28-
**Arguments**:
30+
**Arguments**:
2931

30-
- `<DevOrg-slug-name>`: The unique slug name of your DevOrg to which you want to log in.
32+
- `<DevOrg-slug-name>`: The unique slug name of your DevOrg to which you want to log in.
3133

32-
- `<[email protected]>`: Your registered user email for profile.
34+
- `<[email protected]>`: Your registered user email for profile.
3335

34-
The browser opens up and asks you to log in to DevRev. Once you log in, a local dev org profile is created and an access token is stored.
36+
The browser opens up and asks you to log in to DevRev. Once you log in, a local dev org profile is created and an access token is stored.
3537

36-
### Alternative
38+
</Accordion>
39+
40+
<Accordion title="Authenticate using dev token">
41+
To set up authentication using the DevRev token, run the following command:
3742

38-
To set up authentication using the DevRev token, run the following command:
43+
<Callout intent="info">
44+
Using DevRev's interface, you can generate a DevRev token.
45+
</Callout>
3946

40-
<Callout intent="info">
41-
Using DevRev's interface, you can generate a DevRev token.
42-
</Callout>
4347

48+
```bash
49+
echo $DevRevToken | devrev profiles set-token --org <dev-org-name> --usr <email>
50+
```
4451

45-
```bash
46-
echo $DevRevToken | devrev profiles set-token --org <dev-org-name> --usr <email>
47-
```
48-
49-
It enables CLI operations on the dev org.
52+
It enables CLI operations on the dev org.
53+
</Accordion>
54+
</AccordionGroup>
5055

5156
## Snap-in package
5257

53-
### Create a snap-in package
54-
58+
<AccordionGroup>
59+
<Accordion title="Create a snap-in package">
5560
To create a snap-in package, run the following command:
5661

5762
```bash
@@ -77,10 +82,10 @@ devrev snap_in_package show | jq .
7782
```
7883

7984
`[id]` is optional. If not provided, it uses the snap-in package ID from the [snap-in context](#snap-in-context).
85+
</Accordion>
8086

81-
### Delete a snap-in package
82-
83-
To delete a snap-in package, run the following command:
87+
<Accordion title="Delete a snap-in package">
88+
To delete a snap-in package, run the following command:
8489

8590
```bash
8691
devrev snap_in_package delete-one [id]
@@ -94,9 +99,10 @@ devrev snap_in_package delete-one | jq .
9499

95100
If `id` isn't provided, it picks up the `snap-in package id` from the [snap-in context](#snap-in-context).
96101

97-
### List the snap-in package
98-
99-
To list the snap-in package, run the following command:
102+
</Accordion>
103+
104+
<Accordion title="List the snap-in package">
105+
To list the snap-in package, run the following command:
100106

101107
```bash
102108
devrev snap_in_package list
@@ -107,55 +113,56 @@ For example:
107113
```bash
108114
devrev snap_in_package list | jq .
109115
```
116+
</Accordion>
117+
<Accordion title="Logs for the snap-in package">
118+
To view the snap-in package logs, run the following command:
110119

111-
### Logs for the snap-in package
120+
```bash
121+
devrev snap_in_package logs
122+
```
112123

113-
To view the snap-in package logs, run the following command:
124+
For example:
114125

115-
```bash
116-
devrev snap_in_package logs
117-
```
126+
```bash
127+
devrev snap_in_package logs | jq .
128+
```
118129

119-
For example:
130+
**Additional flags**:
120131

121-
```bash
122-
devrev snap_in_package logs | jq .
123-
```
124-
125-
**Additional flags**:
126-
127-
- `--after` string timestamp after which to fetch logs. For example, 2023-01-15T10:24:17Z. Defaults to 15 minutes earlier.
128-
- `--before` string timestamp before which to fetch logs. For example, 2023-02-15T10:24:17Z. Defaults to now.
129-
- `--filters` string Filters for the log message as a JSON. For example, `{"level": {"values": ["info"]}, "dev_org": {"exclude": true, "values": ["don:identity:<partition>:devo/<dev-org-id>"]} }`
130-
- `--limit` uint32 Number of logs to fetch.
132+
- `--after` string timestamp after which to fetch logs. For example, 2023-01-15T10:24:17Z. Defaults to 15 minutes earlier.
133+
- `--before` string timestamp before which to fetch logs. For example, 2023-02-15T10:24:17Z. Defaults to now.
134+
- `--filters` string Filters for the log message as a JSON. For example, `{"level": {"values": ["info"]}, "dev_org": {"exclude": true, "values": ["don:identity:<partition>:devo/<dev-org-id>"]} }`
135+
- `--limit` uint32 Number of logs to fetch.
136+
</Accordion>
137+
</AccordionGroup>
131138

132139
## Snap-in version
133140

134-
### Create a snap-in version
135-
136-
To create a snap-in version, run the following command:
137-
138-
```bash
139-
devrev snap_in_version create-one --path <path to the snap-in code>
140-
```
141+
<AccordionGroup>
142+
<Accordion title="Create a snap-in version">
143+
To create a snap-in version, run the following command:
141144

142-
For example:
145+
```bash
146+
devrev snap_in_version create-one --path <path to the snap-in code>
147+
```
143148

144-
```bash
145-
devrev snap_in_version create-one --path ./code
146-
```
149+
For example:
147150

148-
Once the snap_in_version is created, its ID is stored in the snap-in context too.
151+
```bash
152+
devrev snap_in_version create-one --path ./code
153+
```
149154

150-
**Additional flags**:
151-
- `--package <id>` : Optional. If not provided, it uses the id from the [snap-in context](#snap-in-context).
152-
- `--manifest <path>`: specify the path to the manifest.yaml file using this flag.
153-
- `--archive <path>` : specify the path to the archive file (build.tar.gz) using this flag.
154-
- `--create-package`: creates a new snap_in_package in interactive mode and then creates a snap-in version using the newly created snap-in package id.
155+
Once the snap_in_version is created, its ID is stored in the snap-in context too.
155156

156-
### Show the snap-in version
157+
**Additional flags**:
158+
- `--package <id>` : Optional. If not provided, it uses the id from the [snap-in context](#snap-in-context).
159+
- `--manifest <path>`: specify the path to the manifest.yaml file using this flag.
160+
- `--archive <path>` : specify the path to the archive file (build.tar.gz) using this flag.
161+
- `--create-package`: creates a new snap_in_package in interactive mode and then creates a snap-in version using the newly created snap-in package id.
162+
</Accordion>
157163

158-
To show the snap-in version, run the following command:
164+
<Accordion title="Show the snap-in version">
165+
To show the snap-in version, run the following command:
159166

160167
```bash
161168
devrev snap_in_version show [id]
@@ -168,10 +175,10 @@ devrev snap_in_version show | jq .
168175
```
169176

170177
`[id]` is optional. If not provided, it uses the snap_in_version id stored in the [snap-in context](#snap-in-context).
171-
172-
### Delete the snap-in version
173-
174-
To delete a snap-in version, run the following command:
178+
</Accordion>
179+
180+
<Accordion title="Delete the snap-in version">
181+
To delete a snap-in version, run the following command:
175182

176183
```bash
177184
devrev snap_in_version delete-one [id]
@@ -184,29 +191,31 @@ devrev snap_in_version delete-one | jq .
184191
```
185192

186193
`[id]` is optional. If not provided, it uses the id stored in the [snap-in context](#snap-in-context).
194+
</Accordion>
195+
<Accordion title="List the snap-in versions">
196+
To list the snap-in version, run the following command:
187197

188-
### List the snap-in versions
189-
190-
To list the snap-in version, run the following command:
198+
```bash
199+
devrev snap_in_version list
200+
```
191201

192-
```bash
193-
devrev snap_in_version list
194-
```
202+
For example:
195203

196-
For example:
204+
```bash
205+
devrev snap_in_version list | jq .
206+
```
197207

198-
```bash
199-
devrev snap_in_version list | jq .
200-
```
208+
**Additional flags**:
209+
- `--package <id>`: Optional. If not provided, it uses the id from the [snap-in context](#snap-in-context).
201210

202-
**Additional flags**:
203-
- `--package <id>`: Optional. If not provided, it uses the id from the [snap-in context](#snap-in-context).
211+
</Accordion>
212+
</AccordionGroup>
204213

205214
## Snap-in
206215

207-
### Create a snap-in draft
208-
209-
To create a snap-in draft instance, run the following command:
216+
<AccordionGroup>
217+
<Accordion title="Create a snap-in draft">
218+
To create a snap-in draft instance, run the following command:
210219

211220
```bash
212221
devrev snap_in draft --snap_in_version [id]
@@ -222,10 +231,10 @@ devrev snap_in draft | jq .
222231
- `--snap_in_version [id]`: Optional. If not provided, it uses the snap-in version ID from the [snap-in context](#snap-in-context).
223232

224233
Once the snap_in draft command is successful, it also generates the interface link.
234+
</Accordion>
225235

226-
### Update the snap-in with keyrings and inputs
227-
228-
To update the snap-in with keyrings and inputs, run the following command:
236+
<Accordion title="Update the snap-in with keyrings and inputs">
237+
To update the snap-in with keyrings and inputs, run the following command:
229238

230239
```bash
231240
devrev snap_in update [id]
@@ -244,20 +253,19 @@ For non-interactive mode, use the following command with the appropriate values:
244253
```bash
245254
echo '{"connection":[{"name":"github-oauth", "reference":"test 1"},{"name":"github", "reference":"test 2"}], "global":[{"name":"post_message","value":"some-value"},{"name":"put_message","value":"some-value"}]}' | devrev snap_in update
246255
```
247-
248-
### Activate the snap-in
249-
250-
To activate a snap-in, run the following command:
256+
</Accordion>
257+
258+
<Accordion title="Activate the snap-in">
259+
To activate a snap-in, run the following command:
251260

252261
```bash
253262
devrev snap_in activate [id]
254263
```
255264

256265
`[id]` is optional. If not provided, it uses the ID stored in the local profile.
257-
258-
### Deactivate the snap-in
259-
260-
To deactivate a snap-in, run the following command:
266+
</Accordion>
267+
<Accordion title="Deactivate the snap-in">
268+
To deactivate a snap-in, run the following command:
261269

262270
```bash
263271
devrev snap_in deactivate [id] [--force]
@@ -266,20 +274,18 @@ devrev snap_in deactivate [id] [--force]
266274
`[id]` is optional. If not provided, it uses the ID stored in the local profile.
267275

268276
`--force` flag deactivates the snap-in even if the `deactivate` hook fails. If the flag isn't specified, then the snap-in moves to the _Error_ state if the `deactivate` hook fails.
269-
270-
### Show the snap-in details
271-
272-
To show the snap-in details, run the following command:
277+
</Accordion>
278+
<Accordion title="Show the snap-in details">
279+
To show the snap-in details, run the following command:
273280

274281
```bash
275282
devrev snap_in show [id]
276283
```
277284

278285
`[id]` is optional. If not provided, it uses the ID stored in the local profile.
279-
280-
### List the snap-ins
281-
282-
To list the snap-ins, run the following command:
286+
</Accordion>
287+
<Accordion title="List the snap-ins">
288+
To list the snap-ins, run the following command:
283289

284290
```bash
285291
devrev snap_in list
@@ -290,10 +296,9 @@ For example:
290296
```bash
291297
devrev snap_in list | jq .
292298
```
293-
294-
### Delete a snap-in
295-
296-
To delete a snap-in, run the following command:
299+
</Accordion>
300+
<Accordion title="Delete a snap-in">
301+
To delete a snap-in, run the following command:
297302

298303
```bash
299304
devrev snap_in delete-one [id] [--force]
@@ -302,6 +307,8 @@ devrev snap_in delete-one [id] [--force]
302307
`[id]` is optional. If not provided, it uses the id stored in the [snap-in context](#snap-in-context).
303308

304309
The `--force` flag deletes the snap-in even if the `deactivate` hook fails. If the flag isn't specified, then the snap-in moves to the _Error_ state if the `deactivate` hook fails.
310+
</Accordion>
311+
</AccordionGroup>
305312

306313
## Snap-in context
307314

@@ -311,9 +318,9 @@ The CLI persists in the context of the CLI in a [snap-in context](#snap-in-conte
311318
2. The ID of the last created/upgraded snap-in version, if any.
312319
3. The ID of the latest deployed snap-in, if any.
313320

314-
### Show the snap-in context
315-
316-
To show the current snap-in context, run the following command:
321+
<AccordionGroup>
322+
<Accordion title="Show the snap-in context">
323+
To show the current snap-in context, run the following command:
317324

318325
```bash
319326
devrev snap_in_context show
@@ -335,9 +342,10 @@ snap_in_context: <snap-in-context name>
335342
snap_in_version: don:integration:<partition>:devo/<dev-oid>:snap_in_package/<snap-in-package-id>:snap_in_version/<snap-in-version-id>
336343
```
337344

338-
### List the snap-in context
345+
</Accordion>
339346

340-
To list the snap-in context, run the following command:
347+
<Accordion title="List the snap-in context">
348+
To list the snap-in context, run the following command:
341349

342350
```bash
343351
devrev snap_in_context list
@@ -348,10 +356,10 @@ For example:
348356
```bash
349357
devrev snap_in_context list
350358
```
351-
352-
### Checkout a snap-in context
353-
354-
To check a different snap-in context, run the following command:
359+
</Accordion>
360+
361+
<Accordion title="Checkout a snap-in context">
362+
To check a different snap-in context, run the following command:
355363

356364
```bash
357365
devrev snap_in_context checkout <snap_in_context_name>
@@ -362,3 +370,6 @@ For example:
362370
```bash
363371
devrev snap_in_context checkout test_1
364372
```
373+
</Accordion>
374+
</AccordionGroup>
375+

0 commit comments

Comments
 (0)