github unkn0wn-root/resterm v1.8.2

5 hours ago

v1.8.2

You can now choose which requests get recorded, exported requests and mocks are named after their method and path instead of a number, and the recorder is visible in the header and status bar.

Skip and only filters

resterm record --upstream https://api.example.com --out captured.http \
  --skip "GET /health" --skip "/assets/{path...}" --only "/api/{rest...}"

Rules are [METHOD ]path. The method is optional. The path uses the same syntax as # @mock routes, so /users/{id} and /assets/{path...} work the same way.

  • Both flags can be repeated.
  • With --only, a request has to match at least one rule to be recorded.
  • --skip wins when both match.
  • Filtered requests are still forwarded to the upstream. They are not counted as skipped captures, so they do not change the exit status. You can see them in summary Recorded 14 exchanges. Filtered 2.
  • A rule that does not parse is rejected before the listener starts, with exit status 2.

The same flags work in the TUI with :record start, and :record status now shows the filtered count.

Exports named from the request

A captured GET /users/42 used to be exported as record-000002. It is now get-users-42, and its mock is get-users-42-mock. That makes --request get-users-42 and X-Resterm-Mock: get-users-42-mock a bit more readable.

  • Names are built from the method and path (lowercased). Anything that is not a letter, digit, dot, or underscore becomes a dash.
  • Long names are cut at 56 characters.
  • When two captures produce the same name, the second becomes get-users-42-2, and so on.

Each request now carries a description and a status assertion:

### get-users-42
# @name get-users-42
# @description Record 2, 200 in 12ms at 2026-09-18 20:04:15
# @assert response.statusCode == 200
GET {{recordedBaseUrl}}/users/42

Redirects get no assertion, because resterm run follows them and the check would fail on replay. Everything else asserts the status that was recorded, including 4xx and 5xx. So a recorded 404 is expected to stay a 404.

One thing to expect when you replay against the real upstream: requests whose credentials were replaced with REDACTED will fail with 401. That is the redaction from 1.8.1 working as intended. Swap those values for variables first. Replaying against resterm mock is not affected, since mocks do not match on headers or form bodies.

Recorder in the header and status bar

While a recording session exists, the header shows a rec cell with the upstream host, and the status bar shows the listen address and the number of recordings. After :record stop the segment reads stopped until you :record clear. Once a capture limit is reached, the segment switches to the warn colours and shows !.

Available to theming is now segment with [status_bar.record]:

[status_bar.record]
foreground = "#FDF4FF"
background = "#701A75"

Don't miss a new resterm release

NewReleases is sending notifications on new releases.