bruq
Convert and execute Bruno .bru files as curl commands, or create new .bru files.
Execute Requests
CRITICAL: File paths must be on a single line with no line breaks inside quotes.
bash
BRU_FILE='<path-to-file.bru>' eval "$(bruq "$BRU_FILE" -e <environment>)"
Options
- •
-e, --env <NAME>- Load variables fromenvironments/<NAME>.bruat collection root - •
-v, --verbose- Curl verbose output - •
-s, --silent- Curl silent mode
Collection Structure
Bruno collections have this structure - environments are always at the collection root (same level as bruno.json):
code
collection-root/
├── bruno.json # Collection marker - find this first!
├── environments/ # Environments are HERE, not in subfolders
│ ├── LOCAL.bru
│ ├── Dev.bru
│ └── Prod.bru
└── requests/ # Requests can be nested anywhere
└── subfolder/
└── request.bru
Finding Files Efficiently
- •Find collection root: Look for
bruno.jsonby traversing up from the .bru file - •Environments: Always at
<collection-root>/environments/<NAME>.bru - •List available environments:
ls <collection-root>/environments/
Create .bru Files
For full syntax reference, see references/bru-syntax.md.
Quick Reference
GET request:
code
meta {
name: Get Users
type: http
}
get {
url: {{BASE_URL}}/users
}
POST with JSON:
code
meta {
name: Create User
type: http
}
post {
url: {{BASE_URL}}/users
body: json
}
headers {
Authorization: Bearer {{TOKEN}}
}
body:json {
{
"name": "John",
"email": "john@example.com"
}
}
Environment file (environments/Local.bru):
code
vars {
BASE_URL: https://api.example.com
TOKEN: your-token
}