Skip to content

Commit f2c8a47

Browse files
authored
Merge pull request #299 from ganesh-bruno/update/cli-docs
add update to bruno cli
2 parents 966c148 + db04c55 commit f2c8a47

File tree

5 files changed

+118
-101
lines changed

5 files changed

+118
-101
lines changed

src/pages/bru-cli/builtInReporters.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,19 @@ bru run request.bru --reporter-json results.json --reporter-junit results.xml --
4545

4646
This command will create three files: results.json, results.xml, and results.html, allowing you to analyze the results in different formats as needed.
4747

48+
## Skipping Specific Headers in the Report
49+
50+
If you want to exclude certain headers from the report, use the `--reporter-skip-headers` option. You can list multiple headers to skip, separated by spaces.
51+
52+
```bash
53+
bru run --reporter-html results.html --reporter-skip-headers "Authorization" "Content-Type" "Date"
54+
```
55+
56+
## Skip All Headers in the Report
57+
58+
To exclude all headers from the report, use the `--reporter-skip-all-headers` option. This will remove all headers from the output report, ensuring a cleaner result.
59+
60+
```bash copy
61+
bru run --reporter-html results.html --reporter-skip-all-headers
62+
```
63+

src/pages/bru-cli/commandOptions.mdx

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,85 @@ bru --version
1111
```
1212
This will display the version number of the Bruno CLI you have installed. It's a helpful command for ensuring you're working with the latest version or for troubleshooting version-specific issues.
1313

14+
## Getting Started
15+
16+
Navigate to the directory where your API collection resides, and run the following command:
17+
18+
```bash copy
19+
bru run
20+
```
21+
22+
This will run all the requests in your collection. If you want to run a single request, specify its filename:
23+
24+
```bash copy
25+
bru run request.bru
26+
```
27+
28+
## Running Requests in a Folder
29+
To run all the requests within a folder, use:
30+
31+
```bash copy
32+
bru run folder
33+
```
34+
35+
## Using Environments
36+
If you need to use a specific environment, you can pass it with the `--env` option:
37+
38+
```bash copy
39+
bru run folder --env Local
40+
```
41+
42+
## Passing Environment Variables
43+
44+
> Variables marked as secrets in Bruno app are not accessible via the CLI. Pass them directly as command-line arguments.
45+
46+
```bash copy
47+
bru run folder --env Local --env-var JWT_TOKEN=1234
48+
```
49+
50+
## Outputting Results
51+
To save the results of your API tests to a file, use the `--output` option:
52+
53+
```bash copy
54+
bru run folder --output results.json
55+
```
56+
## Adding Delay
57+
If you need to add a delay between requests during the execution of your API collection, you can use the `--delay` option.
58+
59+
Example:
60+
```bash copy
61+
bru run --delay 1000
62+
```
63+
## Using Client Certificates for API Requests
64+
65+
If your API requests require client certificates for authentication, you can specify using the `--client-cert-config` option. The configuration should be provided in a JSON file. Here's an example of how to use this option:
66+
67+
```bash copy
68+
bru run folder --client-cert-config /path/to/client-cert-config.json
69+
```
70+
71+
The client-cert-config.json file should contain the following fields:
72+
73+
```json
74+
{
75+
"enabled": true,
76+
"certs": [
77+
{
78+
"domain": "usebruno.com",
79+
"type": "cert",
80+
"certFilePath": "certs/server_1.crt",
81+
"keyFilePath": "private/server_1.key",
82+
"passphrase": "Iu$eBrun0_#Secure!"
83+
},
84+
{
85+
"domain": "the-example.com",
86+
"type": "pfx",
87+
"pfxFilePath": "pfx/server_3.pfx",
88+
"passphrase": "L!ghT_Y@g@mi_2024!"
89+
}
90+
]
91+
}
92+
```
1493

1594
## Options
1695

src/pages/bru-cli/installation.mdx

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,36 @@
11
import { Callout } from 'nextra/components'
2-
2+
import { Tabs } from 'nextra/components'
33

44
# Installation
55

66
<Callout emoji="">
77
Make sure you have Node.js installed on your local system. It is recommended to use the latest LTS version (Node 18 or higher).
88
</Callout>
99

10-
To install the Bruno CLI, use the node package manager of your choice, such as NPM:
11-
```bash copy
12-
npm install -g @usebruno/cli
13-
```
14-
15-
## Getting Started
16-
17-
Navigate to the directory where your API collection resides, and run the following command:
10+
To install the Bruno CLI, use the node package manager of your choice:
1811

19-
```bash copy
20-
bru run
21-
```
22-
23-
This will run all the requests in your collection. If you want to run a single request, specify its filename:
12+
<Tabs items={['pnpm', 'npm', 'yarn']}>
13+
<Tabs.Tab>
14+
### Using pnpm
2415

25-
```bash copy
26-
bru run request.bru
16+
```bash
17+
pnpm install -g @usebruno/cli
2718
```
28-
29-
## Running Requests in a Folder
30-
To run all the requests within a folder, use:
31-
32-
```bash copy
33-
bru run folder
19+
</Tabs.Tab>
20+
<Tabs.Tab>
21+
22+
### Using npm
23+
```bash
24+
npm install -g @usebruno/cli
3425
```
3526

36-
## Using Environments
37-
If you need to use a specific environment, you can pass it with the --env option:
38-
39-
```bash copy
40-
bru run folder --env Local
27+
</Tabs.Tab>
28+
<Tabs.Tab>
29+
30+
### Using yarn
31+
```bash
32+
yarn global add @usebruno/cli
4133
```
42-
43-
## Passing Environment Variables
44-
45-
> Variables marked as secrets in Bruno app are not accessible via the CLI. Pass them directly as command-line arguments.
46-
47-
```bash copy
48-
bru run folder --env Local --env-var JWT_TOKEN=1234
49-
```
50-
34+
</Tabs.Tab>
35+
</Tabs>
36+
For more details, visit the official [NPM Page for Bruno CLI](https://www.npmjs.com/package/@usebruno/cli)

src/pages/bru-cli/overview.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ This makes it easier to test your APIs in different environments, automate your
1111

1212
**2. Generate Test Reports** : Easily create reports in multiple formats, including JSON, JUnit, and HTML, to analyze and share test results.
1313

14-
**3. CI/CD Integration**: Effortlessly integrate with CI/CD pipelines for automated testing and validation.
15-
16-
For more details, visit the official [NPM Page for Bruno CLI](https://www.npmjs.com/package/@usebruno/cli)
14+
**3. CI/CD Integration**: Effortlessly integrate with CI/CD pipelines for automated testing and validation.

src/pages/bru-cli/runCollection.mdx

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -17,65 +17,3 @@ To run a collection using data from a JSON file, provide the file path using the
1717
bru run folder --json-file-path /path/to/json/file.json
1818
```
1919
> This feature requires Bruno CLI version 1.35.0 or higher.
20-
21-
## Outputting Results
22-
To save the results of your API tests to a file, use the --output option:
23-
24-
```bash copy
25-
bru run folder --output results.json
26-
```
27-
28-
## Skipping Specific Headers in the Report
29-
30-
If you want to exclude certain headers from the report, use the `--reporter-skip-headers` option. You can list multiple headers to skip, separated by spaces.
31-
32-
```bash
33-
bru run --reporter-html results.html --reporter-skip-headers "Authorization" "Content-Type" "Date"
34-
```
35-
36-
## Skip All Headers in the Report
37-
38-
To exclude all headers from the report, use the `--reporter-skip-all-headers` option. This will remove all headers from the output report, ensuring a cleaner result.
39-
40-
```bash copy
41-
bru run --reporter-html results.html --reporter-skip-all-headers
42-
```
43-
44-
## Using Client Certificates for API Requests
45-
46-
If your API requests require client certificates for authentication, you can specify using the `--client-cert-config` option. The configuration should be provided in a JSON file. Here's an example of how to use this option:
47-
48-
```bash copy
49-
bru run folder --client-cert-config /path/to/client-cert-config.json
50-
```
51-
52-
The client-cert-config.json file should contain the following fields:
53-
54-
```json
55-
{
56-
"enabled": true,
57-
"certs": [
58-
{
59-
"domain": "usebruno.com",
60-
"type": "cert",
61-
"certFilePath": "certs/server_1.crt",
62-
"keyFilePath": "private/server_1.key",
63-
"passphrase": "Iu$eBrun0_#Secure!"
64-
},
65-
{
66-
"domain": "the-example.com",
67-
"type": "pfx",
68-
"pfxFilePath": "pfx/server_3.pfx",
69-
"passphrase": "L!ghT_Y@g@mi_2024!"
70-
}
71-
]
72-
}
73-
```
74-
## Adding Delay
75-
If you need to add a delay between requests during the execution of your API collection, you can use the `--delay` option.
76-
77-
Example:
78-
```bash copy
79-
bru run . --delay 1000
80-
```
81-

0 commit comments

Comments
 (0)