---
name: bruno
description: "Create and manage Bruno API collections in the Bru Lang (.bru) format - adding a request, creating an environment, writing pre/post scripts, or scaffolding a collection. Triggers: 'add Bruno request', 'Bruno collection', 'write a .bru', 'Bru Lang'."
title: bruno
canonical_url: https://skilld.dev/gh/jd-solanki/ai/bruno
last_updated: 2026-09-29T01:56:58.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [AUTH.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/AUTH.md), [GRAPHQL.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/GRAPHQL.md), [VARIABLES.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/VARIABLES.md).
>
> If the user asked to install this Skill, run `npx skilld install jd-solanki/ai/bruno`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/bruno`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jd-solanki/ai/bruno) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/bruno`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/bruno --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/bruno --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Bruno

## Quick start — fetch docs first

Use **WebFetch** directly (context7 does not index Bruno docs).

This project uses the **Bru Lang** (`.bru`) format, NOT OpenCollection YAML. The
Bruno desktop app and VS Code extension fully support `.bru` and validate a
collection by the presence of a `bruno.json` at its root; OpenCollection's
`opencollection.yml` alone is not reliably recognised (see usebruno/bruno#7379).

| Topic | URL |
|---|---|
| Bru Lang overview | `https://docs.usebruno.com/bru-lang/overview` |
| Tag reference (request blocks) | `https://docs.usebruno.com/bru-lang/tag-reference` |
| Language design | `https://docs.usebruno.com/bru-lang/language` |
| Samples | `https://docs.usebruno.com/bru-lang/samples` |
| Variables | `https://docs.usebruno.com/variables/overview` |
| Auth | `https://docs.usebruno.com/auth/overview` |
| Secrets / .env | `https://docs.usebruno.com/secrets-management/dotenv-file` |
| Full doc index | `https://docs.usebruno.com/llms.txt` |

Read existing requests before writing new ones: `find api -name "*.bru" | head -10`

## Project layout

Group requests by resource under an `api/` directory whose tree **mirrors the
API's URL path**, so a URL maps predictably to a file. Name each request
`<verb>-<noun>.bru`.

`POST /api/webhook/orders` → `bruno/api/webhook/create-order.bru`

```
bruno/
├── bruno.json                       # Collection config (JSON) — the file the app validates
├── collection.bru                   # Collection-level settings (headers/auth/scripts/vars)
├── .env.example                     # var names only, no values (.env is gitignored)
├── environments/
│   └── <env>.bru
└── api/                             # mirrors the URL path under /api
    └── <resource>/
        ├── create-<noun>.bru
        ├── get-<noun>.bru
        └── delete-<noun>.bru
```

**`bruno.json`:**
```json
{
  "version": "1",
  "name": "<collection-name>",
  "type": "collection",
  "ignore": ["node_modules", ".git", ".env"]
}
```

**`collection.bru`** (collection-level settings; keep minimal unless there are
shared headers/auth/scripts):
```
meta {
  type: collection
}
```

## Request templates

**GET with path param** (see [AUTH.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/AUTH.md) for auth options):
```
meta {
  name: Get Deal by ID
  type: http
  seq: 1
}

get {
  url: {{baseUrl}}/crm/v3/objects/deals/:dealId
  auth: bearer
}

params:path {
  dealId: 60074085675
}

auth:bearer {
  token: {{hubspotToken}}
}
```

**POST with JSON body + API key + assertions**:
```
meta {
  name: Create Order
  type: http
  seq: 1
}

post {
  url: {{baseUrl}}/api/webhook/orders
  body: json
  auth: apikey
}

headers {
  Content-Type: application/json
}

auth:apikey {
  key: x-api-key
  value: {{apiKey}}
  placement: header
}

body:json {
  {
    "orderNumber": "W60523"
  }
}

assert {
  $res.status: 200
  $res.body.orderNumber: W60523
}
```

→ GraphQL requests: see [GRAPHQL.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/GRAPHQL.md)
→ All auth types: see [AUTH.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/AUTH.md)
→ Variable types & when to use: see [VARIABLES.md](https://skilld.dev/api/skills-raw/jd-solanki/ai/bruno/VARIABLES.md)

## Body types

The method block declares `body: <type>`, and the body lives in its own
`body:<type> { ... }` block.

| Use case | method `body:` | Block |
|---|---|---|
| JSON payload | `json` | `body:json { <raw json> }` |
| URL-encoded form | `form-urlencoded` | `body:form-urlencoded { key: value }` |
| Multipart / file | `multipart-form` | `body:multipart-form { key: value }` / `file: @file(path/to/f) @contentType(type)` |
| Plain text | `text` | `body:text { ... }` |
| XML | `xml` | `body:xml { ... }` |

## Assertions & tests

Prefer the declarative `assert {}` block for status/body checks — no operator
means equals:
```
assert {
  $res.status: 200
  $res.body.ingested: true
  ~$res.body.note: skipped        # a leading ~ disables an assertion
}
```
For JavaScript assertions, use a `tests {}` block:
```
tests {
  function onResponse(request, response) {
    expect(response.status).to.equal(200);
  }
}
```

## Key rules

- **No `enabled:` field** — a leading `~` DISABLES a line (header, param, var,
  assert). Everything else is enabled.
- Auth is per-request: name the mode in the method block (`auth: bearer`) and add
  the matching `auth:<type> {}` block. For API keys use `auth:apikey { key /
  value / placement }`, or just put the key in `headers {}`.
- Environments are `.bru` files under `environments/`. Bruno reads them when the
  collection is OPENED; it does NOT hot-detect files written to disk while it is
  open — re-open the collection (or create the env via the UI) to pick up a new one.
- Cross-request values: `vars:post-response { TOKEN: $res.body.token }` sets a
  session-wide runtime var for later requests. Do NOT put it in the environment.
- File names: `<verb>-<noun>.bru` in kebab-case; `seq` = next number in the folder.
