lacspace-http
Terminal API client + .http runner with assertions.
npx lacspace-http https://httpbin.org/getEverything, in one command
lacspace-http does two jobs from one binary. Ad-hoc, it sends an HTTP request and pretty-prints the JSON with status, timing and size — with bearer/basic auth, query params, JSON/form bodies, redirect and size caps, and a --curl printer that masks secrets. As a runner, it parses the well-known .http format (the VS Code REST Client / JetBrains one), resolves {{variables}} from env files and captured values, chains a token from one response into the next, and checks @assert conditions on status, JSON body, headers and timing. Everything is built on the global fetch and Node built-ins — no dependencies, no account, no telemetry.
What's inside
Ad-hoc requests
GET/POST/… with headers, query, JSON (-j k=v, k:=raw), forms, bearer & basic auth.
.http / .rest runner
Run a whole file of named requests in order, or one via --name.
Capture & chaining
# @capture token = body.$.access_token, reused as {{token}} downstream.
Assertions = CI tests
Assert on status, JSON-path body, headers, time; a failure exits non-zero.
Variables & env files
{{var}} from http-client.env.json / .env / --var, plus system vars.
Nice output
Coloured status, pretty JSON, timing/size; --json machine record; NO_COLOR and pipe-safe.
--curl printer
Copy-pasteable curl with credentials masked by default.
Copy, paste, done
Real commands and snippets — from a one-liner to the typed library.
npx lacspace-http https://httpbin.org/getPretty-prints JSON with status, timing and size.
npx lacspace-http POST https://httpbin.org/post -j name=Ada -j admin:=true-j is a string field; k:=v is a raw JSON value.
npx lacspace-http https://api.example.com/me -b "$TOKEN" --curlPrints the equivalent curl; the token is masked.
npx lacspace-http run api.http --env devCaptures a login token, chains it, asserts responses.
npx lacspace-http run smoke.http --var host=http://localhost:3000Exit code is non-zero if any assertion fails.
What people build with it
✓ Poke an API quickly without opening Postman
✓ Smoke/contract tests in CI from a versioned .http file
✓ Auth flows that need a captured token
✓ Share a runnable request collection in the repo
Run lacspace-http today
Free, open-source, no API keys. It's a CLI and a typed library.
npx lacspace-http https://httpbin.org/get