Skip to main content

Overview

The Bru language is Bruno’s domain-specific language for defining HTTP requests, collections, and environments. Files use the .bru extension and follow a block-based syntax that is both human-readable and machine-parsable.

File Types

There are three types of .bru files:
  1. Request files - Define HTTP/GraphQL/gRPC requests
  2. Collection files - Configure collection-level settings (collection.bru)
  3. Environment files - Define environment variables (env.bru or named environments)

Basic Syntax

Block Structure

Bru files consist of blocks that define different aspects of a request or collection:

Block Types

There are three types of blocks:
Key-value pairs enclosed in curly braces:
Free-form text content for bodies and scripts:
Array of items in square brackets:

Dictionary Syntax

Basic Key-Value Pairs

Quoted Keys

Use quotes for keys with special characters:

Disabled Items

Prefix with ~ to disable a key-value pair:

Multiline Values

Use triple quotes for multiline values:

Content Type Annotations

For multipart forms and file uploads:

HTTP Methods

Supported HTTP method blocks:
Other supported methods: options, head, connect, trace

Custom HTTP Methods

Request Metadata

string
required
Display name of the request
string
required
Request type: http, graphql, grpc, or ws
number
Sequence number for ordering requests
array
List of tags for organizing requests

Query Parameters

Path Parameters

Headers

Request Bodies

JSON Body

Text Body

XML Body

GraphQL Query

GraphQL Variables

SPARQL Query

Form URL Encoded

Multipart Form

File Upload

Authentication

No Authentication

Basic Auth

Bearer Token

API Key

string
Where to place the API key: header or query

Digest Auth

AWS Signature v4

OAuth 2.0

Authorization Code

Client Credentials

Password Grant

Variables

Pre-Request Variables

Variables prefixed with @ are local and not saved to the file.

Post-Response Variables

Assertions

Scripts

Pre-Request Script

Post-Response Script

Tests

Documentation

Settings

number
Request timeout in milliseconds (0 = no timeout)
boolean
Whether to follow HTTP redirects
number
Maximum number of redirects to follow
boolean
Whether to encode URL parameters
number
Keep-alive interval in seconds for WebSocket connections

Variable Interpolation

Use double curly braces to reference variables:

Built-in Variables

  • {{$uuid}} - Generate a random UUID
  • {{$timestamp}} - Current Unix timestamp
  • {{$isoTimestamp}} - Current ISO 8601 timestamp
  • {{$randomInt}} - Random integer
  • {{$randomEmail}} - Random email address

Comments

Bru does not support inline comments. Use the docs block for documentation.

Complete Example

See Also

Request Format

Detailed request file format specification

Collection Format

Collection and environment file formats