httpman-app 0.0.0-stage → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +143 -2
- package/bin/httpman.js +54 -0
- package/package.json +38 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 httpman contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,144 @@
|
|
|
1
|
-
#
|
|
1
|
+
# httpman
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A local HTTP client for Postman collections, in the spirit of the Postman app from years ago. It's a fast native desktop app and a newman-style command-line runner. It has no accounts, no sync, no cloud and no AI. Nothing leaves your machine except the requests you send.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install -g httpman-app
|
|
7
|
+
httpman # start the desktop app
|
|
8
|
+
httpman run my.postman_collection.json -e dev.postman_environment.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Windows is the primary platform. macOS and Linux are supported too.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
**Postman compatibility**
|
|
16
|
+
- Imports and exports **Collection v2.1 and v2.0**, and imports legacy **v1** collections and Postman **data dumps**.
|
|
17
|
+
- Environments and globals in Postman's file format.
|
|
18
|
+
- Unknown fields are kept when you save, so a collection stays usable in Postman.
|
|
19
|
+
- Postman's own semantics are matched where it matters: URLs are built from parsed parts, `protocolProfileBehavior` (redirects, SSL) is honored, CSV data files are parsed the way newman parses them, and environment files can be UTF-8/UTF-16 with a BOM.
|
|
20
|
+
- Imports **cURL** commands. Exports code snippets for cURL (bash/cmd), PowerShell, fetch, Python requests, HTTPie and raw HTTP.
|
|
21
|
+
|
|
22
|
+
**Requests**
|
|
23
|
+
- All methods. Query/path params are synced with the URL. `{{variables}}` are highlighted, and you can hover to see the resolved value.
|
|
24
|
+
- Bodies: raw (JSON/XML/HTML/JS/text), form-data with files, x-www-form-urlencoded, binary file, GraphQL.
|
|
25
|
+
- Auth: Basic, Bearer, API Key, Digest, OAuth 1.0, OAuth 2.0 (token), Hawk, AWS Signature v4. Auth is inherited from folders and collections.
|
|
26
|
+
- Variable scopes work like Postman's: global → collection → environment → data → local. Dynamic variables (`{{$guid}}`, `{{$timestamp}}`, `{{$randomEmail}}`, …) are supported.
|
|
27
|
+
- Cookie jar with a cookie manager. Redirect, SSL and proxy settings. Timings (DNS/TCP/TLS/TTFB). Response preview for HTML, images and PDF.
|
|
28
|
+
- History, a console with request/response details, and light/dark themes.
|
|
29
|
+
|
|
30
|
+
**Scripts and tests**
|
|
31
|
+
- Pre-request and test scripts run at collection, folder and request level, in Postman's order.
|
|
32
|
+
- The `pm.*` API is supported: `pm.test`, `pm.expect` (Chai), `pm.response.to.have.status/header/jsonBody/jsonSchema…`, `pm.environment/globals/collectionVariables/variables/iterationData`, `pm.request` mutation, `pm.sendRequest` (callback or `await`), `pm.cookies.jar()`, `pm.execution.setNextRequest/skipRequest`, and `pm.visualizer`.
|
|
33
|
+
- The legacy API works too: `tests["…"]`, `responseBody`, `responseCode`, `postman.setEnvironmentVariable`, `postman.setNextRequest`, `xml2Json`, …
|
|
34
|
+
- Bundled libraries: Sugar.js 1.4 prototype extensions (`responseBody.has(…)`), `lodash` (`_`), `moment`, `crypto-js` (`CryptoJS`), `uuid`, `chai`, `ajv` (v6, like Postman), `tv4`, `cheerio`, `xml2js`, `csv-parse/lib/sync`, plus Node shims (`buffer`, `url`, `querystring`, `path`, `util`, `events`, `assert`, `timers`).
|
|
35
|
+
- `setTimeout`, promises and `async`/`await` work, and so does top-level `return`.
|
|
36
|
+
|
|
37
|
+
**Compatibility testing:** httpman is checked against newman's integration fixtures, run against a local postman-echo stand-in. All fixtures pass except a few:
|
|
38
|
+
|
|
39
|
+
- Hosts that can't be reached offline.
|
|
40
|
+
- Echo endpoints the stand-in doesn't implement.
|
|
41
|
+
- `Content-Length: 0` on custom HTTP methods with a disabled body. Go's HTTP client doesn't send it.
|
|
42
|
+
|
|
43
|
+
NTLM and Akamai EdgeGrid auth aren't implemented. Their settings are kept in the collection.
|
|
44
|
+
|
|
45
|
+
**Collection runner**
|
|
46
|
+
- Run a collection or folder for N iterations, with a CSV/JSON data file and an optional delay. You can pick which requests to run, stop on the first failure, and keep variable changes.
|
|
47
|
+
|
|
48
|
+
## Command line
|
|
49
|
+
|
|
50
|
+
`httpman run` takes newman's flags:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
httpman run <collection-file | workspace collection name/id> [options]
|
|
54
|
+
|
|
55
|
+
-e, --environment <file|name> -g, --globals <file>
|
|
56
|
+
-d, --iteration-data <file> -n, --iteration-count <n>
|
|
57
|
+
--folder <name> --env-var key=value --global-var key=value
|
|
58
|
+
--delay-request <ms> --timeout-request <ms> --timeout-script <ms>
|
|
59
|
+
-k, --insecure --ignore-redirects --bail
|
|
60
|
+
-r, --reporters cli,json,junit --reporter-json-export <file>
|
|
61
|
+
--reporter-junit-export <file> --export-environment <file>
|
|
62
|
+
--export-globals <file> --export-collection <file>
|
|
63
|
+
--working-dir <dir> --no-color --silent --verbose
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The exit code is non-zero when any request, assertion or script fails. That makes it a drop-in for `newman run` in CI. Other commands:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
httpman import <file>... # add collections/environments to the desktop workspace
|
|
70
|
+
httpman list # list workspace collections and environments
|
|
71
|
+
httpman version
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Where data lives
|
|
75
|
+
|
|
76
|
+
Everything is stored as plain files in the workspace folder:
|
|
77
|
+
|
|
78
|
+
- **Windows:** `%AppData%\httpman`
|
|
79
|
+
- **macOS:** `~/Library/Application Support/httpman`
|
|
80
|
+
- **Linux:** `~/.config/httpman`
|
|
81
|
+
|
|
82
|
+
You can override the location with the `HTTPMAN_HOME` environment variable or `httpman --workspace <dir>`.
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
collections/<id>.postman_collection.json
|
|
86
|
+
environments/<id>.postman_environment.json
|
|
87
|
+
globals.postman_globals.json
|
|
88
|
+
history.json cookies.json settings.json state.json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Collections and environments are ordinary Postman exports, so you can keep a workspace in git.
|
|
92
|
+
|
|
93
|
+
## Requirements
|
|
94
|
+
|
|
95
|
+
- **Windows 10/11:** uses the Microsoft Edge **WebView2** runtime, which is preinstalled on current Windows.
|
|
96
|
+
- **macOS 11+.**
|
|
97
|
+
- **Linux:** GTK 3 and WebKitGTK 4.1 (`libwebkit2gtk-4.1-0`). The CLI has no runtime dependencies.
|
|
98
|
+
|
|
99
|
+
The npm package is a small launcher plus one prebuilt binary for your platform (`httpman-app-<os>-<arch>`), installed as an optional dependency. Nothing is downloaded at install time.
|
|
100
|
+
|
|
101
|
+
If the desktop app doesn't start when launched through npm, run it with `HTTPMAN_FOREGROUND=1 httpman` to see its error output.
|
|
102
|
+
|
|
103
|
+
## Building from source
|
|
104
|
+
|
|
105
|
+
Requirements: Go 1.26+ and Node.js 18+. On Linux you also need `libgtk-3-dev libwebkit2gtk-4.1-dev`. On macOS you need the Xcode command-line tools.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
node scripts/build.mjs # desktop app for this machine → dist/bin/<os>-<arch>/
|
|
109
|
+
node scripts/build.mjs --nogui # CLI-only build, no CGO or WebView needed
|
|
110
|
+
node scripts/build.mjs --target windows/amd64 # cross-compile the Windows app from any OS
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The Windows build doesn't need CGO, so you can cross-compile it from Linux or macOS.
|
|
114
|
+
|
|
115
|
+
Development with live reload uses the [Wails CLI](https://wails.io) (`go install github.com/wailsapp/wails/v2/cmd/wails@latest`): run `wails dev`. On Linux, add `-tags webkit2_41`.
|
|
116
|
+
|
|
117
|
+
Project layout:
|
|
118
|
+
|
|
119
|
+
| Path | |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `main.go`, `gui.go` | entry point: CLI dispatch and the Wails desktop shell |
|
|
122
|
+
| `internal/collection` | Postman collection model, v1/v2.0/v2.1 parsing |
|
|
123
|
+
| `internal/vars` | variable scopes, `{{var}}` substitution, dynamic variables, environments |
|
|
124
|
+
| `internal/httpclient` | HTTP engine: bodies, auth (basic/digest/oauth1/awsv4/…), redirects, timings |
|
|
125
|
+
| `internal/script` | goja-based script sandbox; `sandbox/` holds the JavaScript `pm` API and libraries, bundled into `internal/script/sandbox.bundle.js` |
|
|
126
|
+
| `internal/runner` | request execution (script chain, auth inheritance) and the collection runner |
|
|
127
|
+
| `internal/cli` | `httpman run` and its reporters |
|
|
128
|
+
| `internal/app` | backend for the desktop UI |
|
|
129
|
+
| `frontend/` | React + TypeScript UI |
|
|
130
|
+
| `npm/`, `scripts/` | npm launcher and packaging/build scripts |
|
|
131
|
+
|
|
132
|
+
Tests: `go test ./...` and `cd frontend && npm run typecheck`. After changing `sandbox/src`, run `cd sandbox && npm ci && npm run build` and commit the regenerated bundle.
|
|
133
|
+
|
|
134
|
+
## Releasing
|
|
135
|
+
|
|
136
|
+
Push a tag `vX.Y.Z`. The release workflow does the following:
|
|
137
|
+
|
|
138
|
+
1. Builds the binaries on Windows, macOS and Linux.
|
|
139
|
+
2. Attaches them to a GitHub release.
|
|
140
|
+
3. Publishes the npm packages. This needs an `NPM_TOKEN` repository secret.
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
MIT
|
package/bin/httpman.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the native httpman binary, which is installed as a
|
|
3
|
+
// platform-specific optional dependency (httpman-app-<platform>-<arch>,
|
|
4
|
+
// with "windows" in place of "win32").
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const { spawn, spawnSync } = require('child_process');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
const PKG = 'httpman-app';
|
|
12
|
+
const exe = process.platform === 'win32' ? 'httpman.exe' : 'httpman';
|
|
13
|
+
|
|
14
|
+
function findBinary() {
|
|
15
|
+
if (process.env.HTTPMAN_BINARY) return process.env.HTTPMAN_BINARY;
|
|
16
|
+
const platform = process.platform === 'win32' ? 'windows' : process.platform;
|
|
17
|
+
const name = `${PKG}-${platform}-${process.arch}`;
|
|
18
|
+
try {
|
|
19
|
+
return require.resolve(`${name}/bin/${exe}`);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
// Fall back to a binary placed next to this script (manual installs).
|
|
22
|
+
const local = path.join(__dirname, exe);
|
|
23
|
+
if (fs.existsSync(local)) return local;
|
|
24
|
+
console.error(
|
|
25
|
+
`httpman: no prebuilt binary for ${process.platform}-${process.arch}.\n` +
|
|
26
|
+
`The optional dependency "${name}" was not installed. Reinstall without --no-optional / --omit=optional,\n` +
|
|
27
|
+
`or build from source: https://github.com/bnuprst/httpman#building-from-source`
|
|
28
|
+
);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const bin = findBinary();
|
|
34
|
+
const args = process.argv.slice(2);
|
|
35
|
+
const CLI_COMMANDS = new Set(['run', 'import', 'list', 'version', '--version', '-v', 'help', '--help', '-h']);
|
|
36
|
+
const isCLI = args.length > 0 && CLI_COMMANDS.has(args[0]);
|
|
37
|
+
|
|
38
|
+
if (isCLI || process.env.HTTPMAN_FOREGROUND) {
|
|
39
|
+
// Command-line use: run in the foreground and forward the exit code.
|
|
40
|
+
const res = spawnSync(bin, args, { stdio: 'inherit', windowsHide: false });
|
|
41
|
+
if (res.error) {
|
|
42
|
+
console.error('httpman:', res.error.message);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
process.exit(res.status === null ? 1 : res.status);
|
|
46
|
+
} else {
|
|
47
|
+
// Desktop app: detach so the terminal is released immediately.
|
|
48
|
+
const child = spawn(bin, args, { detached: true, stdio: 'ignore', windowsHide: false });
|
|
49
|
+
child.on('error', (e) => {
|
|
50
|
+
console.error('httpman:', e.message);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|
|
53
|
+
child.unref();
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "httpman-app",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "A local, offline HTTP client compatible with Postman collections — desktop app and newman-style CLI. No accounts, no sync.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"http",
|
|
7
|
+
"rest",
|
|
8
|
+
"api",
|
|
9
|
+
"postman",
|
|
10
|
+
"newman",
|
|
11
|
+
"collection",
|
|
12
|
+
"client",
|
|
13
|
+
"testing",
|
|
14
|
+
"desktop"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"homepage": "https://github.com/bnuprst/httpman",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/bnuprst/httpman.git"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"httpman": "bin/httpman.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/httpman.js",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=16"
|
|
31
|
+
},
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"httpman-app-windows-x64": "0.0.3",
|
|
34
|
+
"httpman-app-windows-arm64": "0.0.3",
|
|
35
|
+
"httpman-app-darwin-x64": "0.0.3",
|
|
36
|
+
"httpman-app-darwin-arm64": "0.0.3",
|
|
37
|
+
"httpman-app-linux-x64": "0.0.3",
|
|
38
|
+
"httpman-app-linux-arm64": "0.0.3"
|
|
39
|
+
}
|
|
40
|
+
}
|