Skip to content

Converting to Bell

Bell can import your existing API definitions from popular API tools, converting them into runnable .bel files.


From Postman

Step 1: Export your collection

  1. Open Postman and find the collection you want to convert.
  2. Click the menu next to the collection name.
  3. Select ExportCollection v2.1.
  4. Save the JSON file (e.g. my-api.postman_collection.json).

Step 2: Run bell postman

bash
bell postman my-api.postman_collection.json

This creates a bell/ folder with one .bel file per request. Folders in the collection become subdirectories:

bell/
  users/
    get_users.GET.bel
    create_user.POST.bel
  auth/
    login.POST.bel

Use -o to write to a different directory:

bash
bell postman my-api.postman_collection.json -o ./api

What gets converted

PostmanBell
Request URLurl
Path variables{variable} interpolation
Query parametersparam
Request headersheaders { ... }
Request body (JSON)body { ... }
HTTP methodGET, POST, PUT, PATCH, DELETE
Collection foldersSubdirectories
syntax{variables} syntax

INFO

Environment variables and pre-request scripts are not converted automatically. Add them manually after conversion — see Syntax for how to define environments and variables.


From OpenAPI Coming Soon

Coming Soon

bell openapi is not yet available in the current release. It will be included in an upcoming version.

Step 1: Have your spec ready

Bell accepts OpenAPI 3.x specs in JSON or YAML format. Swagger 2.0 is not supported.

Step 2: Run bell openapi

bash
bell openapi my-api.openapi.json

YAML specs work the same way:

bash
bell openapi my-api.yaml -o ./bell

Bell reads the spec and generates one .bel file per operation, grouped by tag (falling back to the first path segment). If the spec defines servers, Bell also generates an env.json:

bell/
  env.json
  users/
    list_users.GET.bel
    create_user.POST.bel
    get_user.GET.bel
  posts/
    list_posts.GET.bel

What gets converted

OpenAPIBell
servers[].urlenv.json + import + path
operationIdFile name (e.g. list_users.GET.bel)
tags[0]Subdirectory name
Path parameters {id}Bell variable declaration + {id} in path
Query parametersparam
Header parametersheader
requestBody schemabody { ... } with example values
Security schemesCommented # header "Authorization" ...
2xx response codeexpect response.status === N

Generated files

Given a spec with two servers and a GET /users/{userId} operation tagged Users:

json
{
  "production": {
    "url": "https://api.example.com"
  },
  "staging": {
    "url": "https://staging.api.example.com"
  }
}
bel
### Get a user

import "../env.json"
env "production" | "staging"

userId = "example"

path "/users/{userId}"

GET

expect response.status === 200

Running bell run users/get_user.GET.bel will prompt you to choose an environment, then make the request against the corresponding base URL.

INFO

After conversion, review each file and replace placeholder values ("example", "YOUR_TOKEN", etc.) with real data. See Syntax for authentication patterns and environment setup.


From a curl command Coming Soon

Coming Soon

bell curl is not yet available in the current release. It will be included in an upcoming version.

Convert a curl command directly to a .bel file — useful for turning API docs examples or clipboard history into runnable Bell files.

bash
bell curl 'curl -X POST https://api.example.com/users \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"name\":\"alice\"}"'

# or pipe from clipboard
pbpaste | bell curl

By default the result is printed to stdout. Use -o to write a file:

bash
bell curl 'curl https://api.example.com/users' -o get_users.GET.bel
curl flagBell output
-X METHODHTTP method line
Positional URLurl
-H "Key: Value"headers { ... }
-d / --databody { ... }
-u user:passheader "Authorization" "Basic ..."

From a HAR file Coming Soon

Coming Soon

bell har is not yet available in the current release. It will be included in an upcoming version.

HAR (HTTP Archive) is the format exported from Chrome or Firefox DevTools → Network tab → Save all as HAR. It captures real traffic, making it the fastest way to turn "I saw this request in DevTools" into a reproducible Bell file.

bash
bell har network-export.har -o ./bell

Bell filters out static assets (images, fonts, CSS, JS), browser-internal URLs, and preflight OPTIONS requests. Cookie headers are stripped by default.

Options:

FlagDescription
--filter <pattern>Keep only URLs matching a substring or regex
--dedupeKeep only the last request per unique method + path
--include-cookiesInclude Cookie headers (stripped by default)

From Insomnia Coming Soon

Coming Soon

bell insomnia is not yet available in the current release. It will be included in an upcoming version.

Bell can convert an Insomnia v4 export to .bel files, preserving folder structure, authentication, and variables.

Step 1: Export your collection

In Insomnia, go to Application menu → Export Data → Export all workspaces and save the JSON file.

Step 2: Run bell insomnia

bash
bell insomnia Insomnia_export.json -o ./bell
InsomniaBell
Request.bel file
Folder (request_group)Subdirectory
syntax{variable} syntax
JSON bodybody { ... }
Bearer authheader "Authorization" "Bearer {token}"
Basic authheader "Authorization" "Basic ..."
API key (header)header "{key}" "{value}"

From a .http file Coming Soon

Coming Soon

bell http is not yet available in the current release. It will be included in an upcoming version.

The REST Client VS Code extension uses .http files that many teams already have in their repos. Bell converts them directly.

bash
bell http requests.http -o ./bell

Each ### block in the file becomes its own .bel file. references are converted to Bell's {variable} syntax, and @variable = value declarations at the top of the file become Bell variables.

http
### Get a user
GET https://api.example.com/users/1
Authorization: Bearer {{token}}

###

### Create a user
POST https://api.example.com/users
Content-Type: application/json

{"name": "alice"}