Bruno
Collections Commands
Create, organize, and share API collections using Bruno's Bru markup language.
9 commands
Pro Tips
Collections live in your repo - no cloud sync needed
Commands
Initialize collection
$ bru init my-api
Create new Bruno collection.
Bru file structure
$ meta {
name: Get Users
type: http
seq: 1
}
get {
url: {{baseUrl}}/users
}
assert {
res.status: eq 200
}
Example .bru request file.
Import from Postman
$ bru import postman collection.json
Import Postman collection.
POST with JSON body
$ post {
url: {{baseUrl}}/users
body: json
}
body:json {
{
"name": "John",
"email": "john@example.com"
}
}
POST request with JSON body payload.
Form data upload
$ post {
url: {{baseUrl}}/upload
body: multipart-form
}
body:multipart-form {
file: @file(/path/to/image.png)
description: Profile photo
}
Upload file using multipart form data.
GraphQL request
$ post {
url: {{baseUrl}}/graphql
body: graphql
}
body:graphql {
query {
users {
id
name
email
}
}
}
Send a GraphQL query request.
Set request headers
$ get {
url: {{baseUrl}}/users
}
headers {
Authorization: Bearer {{authToken}}
Content-Type: application/json
X-Request-Id: {{$guid}}
}
Add custom headers to a request.
Query parameters
$ get {
url: {{baseUrl}}/users
}
params:query {
page: 1
limit: 20
sort: created_at
}
Set URL query parameters on a request.
Collection folder structure
$ my-api/
bruno.json
environments/
dev.bru
staging.bru
users/
Get Users.bru
Create User.bru
auth/
Login.bru
Standard collection directory layout.