Collections & Folders
Mercury has no collection format of its own. A workspace is a folder on disk, its subfolders are collections, and the *.json files are requests.
my-api/ β workspace (the folder you open)
βββ .env β environments: .env* files in the root only
βββ .env.production
βββ auth/ β collection
β βββ login.json
β βββ register.json
βββ users/
β βββ admin/ β collections can nest
β β βββ list-admins.json
β βββ get-user.json
βββ health.json
Opening a workspaceβ
Press β O, choose Open folderβ¦ from the workspace menu, or click Open folderβ¦ in the empty sidebar. Names you type are file names, not paths: / and .. are rejected so nothing is written outside the folder you picked. If the workspace folder is deleted while Mercury has it open, it closes the workspace and keeps whatever you were editing as an unsaved request. Mercury remembers the workspace and reopens it on the next launch.
The sidebar treeβ
- Folders come first, then requests, each sorted by name, ignoring case.
- Only
.jsonfiles are listed. Other files are ignored. - Hidden files and folders (names starting with
.) are skipped. - Each request shows its method. If a
.jsonfile isn't a valid request, it's listed without a method and shows an error when you open it. - Mercury reads a folder the first time you expand it. Clicking a folder expands or collapses it.
Unsaved requests you've sent appear above the tree under Unsaved (up to 50), the latest send at the top. Click one to load it, or click Γ to remove it. The trash icon clears the list, with Undo in the notification. When you save a request, it's removed from the list.
Searchingβ
The filter box at the top of the sidebar narrows the tree by file and folder name. It searches the whole workspace, including folders you have never opened, and matching folders expand while you type. A folder that matches by name shows everything in it. It is case-insensitive; Esc clears it.
To jump straight to a request without touching the tree, press β K and type its name. The command palette searches every request in the workspace, however deeply nested, plus every command Mercury has.
Creating, renaming and deletingβ
Hover a folder and click β―, or right-click it. Clicking a folder also makes it where the next new or saved request goes.
| Action | What it does |
|---|---|
| New Request | Saves the current editor contents as <name>.json in this folder |
| New Folder | Creates a subfolder |
| Rename | Renames the folder in place |
| Delete | Deletes the folder and everything in it, after you confirm. The confirmation counts the requests inside and any other files, such as fixtures or a README, that will go with it. Deleted files skip the Trash. |
| Copy Path | Copies the folder's full path |
Requests have Duplicate, Rename, Delete and Copy Path. See Sidebar actions.
To create a folder directly in the workspace root, use your file manager or a terminal (mkdir users). Mercury picks up the change.
Deleting is permanent. Nothing goes to the trash. If the workspace is in Git, you can restore files with git checkout.
Changes made outside Mercuryβ
Mercury watches the workspace folder. When files are added, removed or renamed, whether by an editor, git pull or a script, the tree and the environment list refresh within about half a second. Changes inside hidden folders such as .git are ignored. If the open request's file changes and you have no unsaved edits, Mercury reloads it, staying on the tab you were on. If you do have unsaved edits, Mercury keeps yours, warns you, and saves over the file.
Sharing with Gitβ
A workspace is just files, so version control works as usual:
cd my-api
git init
git add .
git commit -m "API requests"
Mercury writes headers sorted by name, so diffs stay small. Keep secrets out of the repository. See Environments.