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:

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

  1. Install Plainwire from the latest .vsix release (install steps).
  2. 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-tests folder in the workspace, with counts such as “2 collections, 41 requests, 1 environment”.
  3. 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 .json or a .db file, or Choose a folder…. Plainwire writes .http files into the workspace under http/<collection>/; they appear in the sidebar straight away.
  4. 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 ClientIn a .http file
CollectionA .http file (or a folder of them)
FolderA 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, urlRequest line: POST {{baseUrl}}/orders
paramsQuery string on the URL, or ?a=1 / &b=2 continuation lines
headersName: value lines under the request line
Auth: BearerAuthorization: Bearer {{token}}
Auth: BasicAuthorization: Basic <base64 of user:password>
Body: JSON / text / XMLBody after a blank line, with the matching Content-Type
Body: form-encodedContent-Type: application/x-www-form-urlencoded and a=1&b=2
EnvironmentAn entry in http-client.env.json
Secret environment valueshttp-client.private.env.json (gitignored)
{{variable}}Unchanged: {{variable}}
TestsCommon checks (status, time, body, headers, JSON values, counts, types) become # @assert lines (0.2+); others are listed as warnings
Pre/post scriptsNot 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

Related: why and how to switch from Thunder Client, and the .http syntax cheat sheet.