[GH-ISSUE #5770] [bug]: CLI script does not save environment varaible #2255

Closed
opened 2026-03-16 23:45:22 +03:00 by kerem · 0 comments
Owner

Originally created by @billmartensson on GitHub (Jan 13, 2026).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5770

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Desktop App

Browser

Chrome

Operating System

macOS

Bug Description

Have auth request that use post-request script to set environment session variable to be used in other requests.
Example from AWS cognito but not limited to that:
var jsonData = pw.response.body
pw.env.set("cognitoIdToken", jsonData.AuthenticationResult.IdToken);

Works in desktop. Can set header in other requests:
Authorization: Bearer <>

Does not work in CLI. Set variable does not update environment file.
Tried run local of type:
hopp test -e stageenv.json TestRun.json

In CLI variable is not set in requests after setting it but works in desktop.
In our use case it would work if variable wasnt actually written to file. Could just be updated in memory and cleared after run.

Deployment Type

Hoppscotch Cloud

Version

No response

Originally created by @billmartensson on GitHub (Jan 13, 2026). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5770 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Desktop App ### Browser Chrome ### Operating System macOS ### Bug Description Have auth request that use post-request script to set environment session variable to be used in other requests. Example from AWS cognito but not limited to that: var jsonData = pw.response.body pw.env.set("cognitoIdToken", jsonData.AuthenticationResult.IdToken); Works in desktop. Can set header in other requests: Authorization: Bearer <<cognitoIdToken>> Does not work in CLI. Set variable does not update environment file. Tried run local of type: hopp test -e stageenv.json TestRun.json In CLI variable is not set in requests after setting it but works in desktop. In our use case it would work if variable wasnt actually written to file. Could just be updated in memory and cleared after run. ### Deployment Type Hoppscotch Cloud ### Version _No response_
kerem 2026-03-16 23:45:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2255
No description provided.