hitspec init
Initialize a new hitspec project in the current directory.
What It Creates
Flags
Examples
Generated Config
The generated hitspec.yaml includes:
Generated Example
The generated example.http demonstrates:
- Variable definitions with
@baseUrl
- Request metadata (
@name, @description, @tags)
- Assertion blocks with
>>> / <<<
- Capture blocks with
>>>capture / <<<
- Dependencies with
@depends
Run the Example
The example is self-contained: hitspec mock serves it from its own >>>mock blocks, so it passes without an API of your own. Use two terminals:
hitspec run ignores >>>mock blocks. To test a real API, set baseUrl in hitspec.yaml and replace the requests in example.http.
The line @baseUrl = {{baseUrl}} at the top of example.http makes the file default to the baseUrl of the active environment. See Variables.Last modified on October 19, 2026