docs Getting started
Quick start
Write a first request file, send it, and bootstrap a project with resterm init.
- Place one or more
.httpor.restfiles in a working directory (or use the samples under_examples/). - Run
resterm --workspace path/to/project. - Use the navigator sidebar to expand a file (
→orSpace), highlight a request, and pressCtrl+Enterto send it (Enterruns,Spacepreviews). - Inspect responses in the Pretty, Raw, Headers, Diff, Compare, or History tabs on the right; press
g+cto run the current request across the global--comparetarget list (or its inline@comparedirective) and review the results without leaving the editor.
A minimal .http file looks like this:
### Fetch Status
# @name health
GET https://httpbin.org/status/204
User-Agent: resterm
Accept: application/json
### Create Resource
# @name create
POST https://httpbin.org/anything
Content-Type: application/json
{
"id": "{{$uuid}}",
"note": "created from Resterm"
}Initializing a Project
The resterm init command creates a starter set of files in a directory so you can begin working with requests immediately.
mkdir my-api && cd my-api
resterm initThis writes files based on the selected template. Two templates are available:
| Template | Files created |
|---|---|
standard (default) |
requests.http, resterm.env.json, resterm.env.example.json, rts/helpers.rts, RESTERM.md |
minimal |
requests.http, resterm.env.json |
Both templates add resterm.env.json to .gitignore so secrets stay out of version control. If you prefer to manage .gitignore yourself, pass --no-gitignore.
Flags
| Flag | Description |
|---|---|
-dir <path> |
Target directory. You can also pass the path as a positional argument, but not both. |
-template <name> |
Template to use (standard or minimal). |
-force |
Overwrite existing files instead of aborting. If any file cannot be written, no files are changed. |
-dry-run |
Print actions without writing anything. |
-no-gitignore |
Skip updating .gitignore. |
-list |
Print available templates and exit. |
Examples
# Create files in a subdirectory
resterm init ./api-tests
# Use the minimal template
resterm init --template minimal
# Preview what would be created
resterm init --dry-run
# Overwrite existing files
resterm init --forceOnce the files are in place, run resterm in the same directory. Press g Shift+M to start the local mock server, then use Ctrl+Enter to try the sample requests. Press Ctrl+E if you want to switch between the local dev and test environments.