What's New
Collection export/import
This release introduces a full collection export/import. When you export a workspace, Resterm scans .http and .rest files and automatically resolves every referenced dependency and writes everything into a bundle directory.
If your workspace has a resterm.env.example.json, it gets included as-is. If only resterm.env.json exists, Resterm generates the example file automatically and replaces all values with REPLACE_ME placeholders.
Export a workspace into a bundle directory:
resterm collection export \
--workspace ./my-api \
--out ./shared/my-api-bundle \
--recursive \
--name "my-api-v1"
Import a bundle into a local workspace:
resterm collection import \
--in ./shared/my-api-bundle \
--workspace ./my-local-api
Preview what import would do before it writes anything:
resterm collection import \
--in ./shared/my-api-bundle \
--workspace ./my-local-api \
--dry-run
If you need to share a single file instead of a directory, pack the bundle into a zip archive:
resterm collection pack \
--in ./shared/my-api-bundle \
--out ./shared/my-api-bundle.zip
And unpack it on the other end:
resterm collection unpack \
--in ./shared/my-api-bundle.zip \
--out ./shared/my-api-bundle
Both pack and unpack validate manifest checksums and reject unsafe paths (directory traversal, symlink escapes).
Shared environment variables ($shared) - thanks to @jaceCallihoo
You can define a $shared key in your resterm.env.json to set variables that apply to every environment. This is useful for values that stay the same across diffrent env. Things like API versions, token URLs, or default client IDs. Any environment specific value takes precedence when a name collides, so you can still override per env. as needed.
{
"$shared": {
"api": { "version": "v2" },
"auth": { "clientId": "demo-client" }
},
"dev": {
"base": { "url": "https://dev.example.com" }
},
"prod": {
"base": { "url": "https://prod.example.com" },
"auth": { "clientId": "prod-client" }
}
}
In this example, dev inherits auth.clientId=demo-client from $shared, while prod overrides it with prod-client. Both environments get api.version=v2. You reference these variables in your .http files exactly like you always do:
GET {{base.url}}/{{api.version}}/users
Authorization: Bearer {{auth.clientId}}
The $shared key never shows up in the environment selector and you never reference it directly.