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
- Open Postman and find the collection you want to convert.
- Click the … menu next to the collection name.
- Select Export → Collection v2.1.
- Save the JSON file (e.g.
my-api.postman_collection.json).
Step 2: Run bell postman
bell postman my-api.postman_collection.jsonThis 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.belUse -o to write to a different directory:
bell postman my-api.postman_collection.json -o ./apiWhat gets converted
| Postman | Bell |
|---|---|
| Request URL | url |
| Path variables | {variable} interpolation |
| Query parameters | param |
| Request headers | headers { ... } |
| Request body (JSON) | body { ... } |
| HTTP method | GET, POST, PUT, PATCH, DELETE |
| Collection folders | Subdirectories |
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
bell openapi my-api.openapi.jsonYAML specs work the same way:
bell openapi my-api.yaml -o ./bellBell 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.belWhat gets converted
| OpenAPI | Bell |
|---|---|
servers[].url | env.json + import + path |
operationId | File name (e.g. list_users.GET.bel) |
tags[0] | Subdirectory name |
Path parameters {id} | Bell variable declaration + {id} in path |
| Query parameters | param |
| Header parameters | header |
requestBody schema | body { ... } with example values |
| Security schemes | Commented # header "Authorization" ... |
| 2xx response code | expect response.status === N |
Generated files
Given a spec with two servers and a GET /users/{userId} operation tagged Users:
{
"production": {
"url": "https://api.example.com"
},
"staging": {
"url": "https://staging.api.example.com"
}
}### Get a user
import "../env.json"
env "production" | "staging"
userId = "example"
path "/users/{userId}"
GET
expect response.status === 200Running 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.
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 curlBy default the result is printed to stdout. Use -o to write a file:
bell curl 'curl https://api.example.com/users' -o get_users.GET.bel| curl flag | Bell output |
|---|---|
-X METHOD | HTTP method line |
| Positional URL | url |
-H "Key: Value" | headers { ... } |
-d / --data | body { ... } |
-u user:pass | header "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.
bell har network-export.har -o ./bellBell filters out static assets (images, fonts, CSS, JS), browser-internal URLs, and preflight OPTIONS requests. Cookie headers are stripped by default.
Options:
| Flag | Description |
|---|---|
--filter <pattern> | Keep only URLs matching a substring or regex |
--dedupe | Keep only the last request per unique method + path |
--include-cookies | Include 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
bell insomnia Insomnia_export.json -o ./bell| Insomnia | Bell |
|---|---|
| Request | .bel file |
Folder (request_group) | Subdirectory |
syntax | {variable} syntax |
| JSON body | body { ... } |
| Bearer auth | header "Authorization" "Bearer {token}" |
| Basic auth | header "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.
bell http requests.http -o ./bellEach ### 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.
### 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"}