Convert Thunder Client collections to .http files
Thunder Client stores collections as JSON in its own format. A .http file holds the same information as readable text that lives in your repository and runs in Plainwire, REST Client and JetBrains IDEs. This guide shows the one-click route with Plainwire and, for anyone who prefers to do it by hand, exactly how each Thunder Client field maps to the format.
No export or login needed (new in 0.17). Thunder Client keeps your collections, environments and history as files on your computer. Run Plainwire: Import from Thunder Client… and pick the data folder it finds (VS Code, Cursor, Windsurf, VSCodium and more), or run plainwire import --thunder in a terminal. Plainwire reads the files locally; nothing is sent anywhere. Where Thunder Client stores its data, and how the import works.
Prefer the browser? Choose your Thunder Client export, thunder-tests JSON files or a thunderclient.db file in the online Thunder Client to .http converter. Nothing is uploaded.
Step 1: find your Thunder Client data
Any of these works; you do not have to export anything:
- Thunder Client’s storage folder (easiest). Thunder Client saves everything under
globalStorage/rangav.vscode-thunder-clientin your editor’s settings folder. Plainwire finds it on its own; the paths per system and editor are listed in where Thunder Client stores its data. - An exported collection, if you already have one. In the Thunder Client sidebar, open Collections, click the … menu next to the collection and choose Export. Repeat for each collection. Export environments from the Env tab the same way.
- A
thunder-testsfolder. Projects that used Thunder Client’s save-to-workspace or Git Sync option have athunder-testsfolder in the repository that already contains collections and environments as JSON. Plainwire can import that folder as a whole.
An exported collection looks roughly like this (shortened; real exports contain more fields, and the layout varies between Thunder Client versions):
{
"clientName": "Thunder Client",
"collectionName": "Shop API",
"folders": [
{ "_id": "f1", "name": "Orders", "containerId": "" }
],
"requests": [
{
"_id": "r1",
"containerId": "f1",
"name": "Create order",
"method": "POST",
"url": "{{baseUrl}}/orders?dryRun=false",
"params": [ { "name": "dryRun", "value": "false" } ],
"headers": [ { "name": "Accept", "value": "application/json" } ],
"auth": { "type": "bearer", "bearer": "{{token}}" },
"body": { "type": "json", "raw": "{\"sku\":\"TSHIRT-M\",\"quantity\":2}" },
"tests": [ { "type": "res-code", "custom": "", "action": "equal", "value": "201" } ]
}
]
}
Step 2: import with Plainwire
- Install Plainwire from the latest
.vsixrelease (install steps). - Open the folder where the requests should live, then run Plainwire: Import from Thunder Client… from the Command Palette (or the button in the Plainwire sidebar). It lists the Thunder Client data it found on this computer, including a
thunder-testsfolder in the workspace, with counts such as “2 collections, 41 requests, 1 environment”. - Pick a data folder (and, if it has history, whether to import that too), or use Choose exported or data file(s)… for an exported
.jsonor a.dbfile, or Choose a folder…. Plainwire writes.httpfiles into the workspace underhttp/<collection>/; they appear in the sidebar straight away. - Open a file, check a request or two with Send Request, and commit.
The request above comes out along these lines (exact header order and formatting may differ):
### Create order
# @name createOrder
POST {{baseUrl}}/orders?dryRun=false
Accept: application/json
Authorization: Bearer {{token}}
Content-Type: application/json
{"sku":"TSHIRT-M","quantity":2}
Field-by-field mapping
Use this table to convert by hand or to check an import.
| Thunder Client | In a .http file |
|---|---|
| Collection | A .http file (or a folder of them) |
| Folder | A separate .http file; a folder inside a folder becomes a subfolder (Orders/Refunds.http). Plainwire’s sidebar shows the folders, and you can drag requests between files to reorganise them |
Request name | ### Create order title line |
method, url | Request line: POST {{baseUrl}}/orders |
params | Query string on the URL, or ?a=1 / &b=2 continuation lines |
headers | Name: value lines under the request line |
| Auth: Bearer | Authorization: Bearer {{token}} |
| Auth: Basic | Authorization: Basic <base64 of user:password> |
| Body: JSON / text / XML | Body after a blank line, with the matching Content-Type |
| Body: form-encoded | Content-Type: application/x-www-form-urlencoded and a=1&b=2 |
| Environment | An entry in http-client.env.json |
| Secret environment values | http-client.private.env.json (gitignored) |
{{variable}} | Unchanged: {{variable}} |
| Tests | Common checks (status, time, body, headers, JSON values, counts, types) become # @assert lines (0.2+); others are listed as warnings |
| Pre/post scripts | Not imported (Thunder Client’s script API is not supported; Plainwire runs JetBrains-style scripts) |
System variables
Thunder Client writes its dynamic values with a # prefix; the .http format uses $. After importing, search your files for {{# and replace any that remain:
| Thunder Client | .http |
|---|---|
{{#guid}} | {{$guid}} |
{{#timestamp}} | {{$timestamp}} |
{{#dateISO}} | {{$datetime iso8601}} |
| Random number | {{$randomInt 0 1000}} |
Environments
A Thunder Client environment is a named list of variables. In the .http world, all environments live in one http-client.env.json next to your requests, keyed by name:
{
"local": { "baseUrl": "http://localhost:3000" },
"staging": { "baseUrl": "https://staging.example.com" }
}
Put secrets in http-client.private.env.json with the same environment names, and keep that file out of git:
{
"local": { "token": "dev-token" },
"staging": { "token": "replace-me" }
}
# .gitignore http-client.private.env.json
Converting by hand
For a handful of requests you can also copy them over manually. A layout that works well:
api/ orders.http one file per Thunder Client folder auth.http http-client.env.json shared, committed http-client.private.env.json secrets, gitignored
Write each request with a ### title, add # @name to any request whose response you reuse (for example a login that returns a token), and replace Thunder Client’s “set env from response” steps with request chaining:
### Log in
# @name login
POST {{baseUrl}}/auth/login
Content-Type: application/json
{ "email": "{{user}}", "password": "{{password}}" }
### Create order
POST {{baseUrl}}/orders
Authorization: Bearer {{login.response.body.$.token}}
Content-Type: application/json
{ "sku": "TSHIRT-M", "quantity": 2 }
After the import: checklist
- Search for
{{#and replace leftover Thunder Client system variables. - Move tokens and passwords out of
http-client.env.jsoninto the private file. - Note which requests had scripts or tests listed as warnings; rewrite the ones you need as
# @assertlines or> {% %}handlers. - Send one request per environment to confirm the values resolve.
Related: why and how to switch from Thunder Client, and the .http syntax cheat sheet.