wasper-cli 0.1.0 → 0.3.0

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.
Files changed (5) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -0
  3. package/dist/cli.js +2536 -931
  4. package/dist/index.js +2134 -685
  5. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nischal Dahal
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 ADDED
@@ -0,0 +1,118 @@
1
+ # wasper-cli
2
+
3
+ A local CLI proxy and AI agent for your OpenAPI specs. Explore, test, and automate any REST API without leaving your terminal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i -g wasper-cli
9
+ # or
10
+ bun add -g wasper-cli
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```bash
16
+ # Start with an OpenAPI spec URL
17
+ wasper --url https://petstore3.swagger.io/api/v3/openapi.json
18
+
19
+ # Start in background
20
+ wasper --url <spec-url> --background
21
+
22
+ # Resume last used spec
23
+ wasper
24
+
25
+ # List saved specs
26
+ wasper ls
27
+
28
+ # Switch to a saved spec (by number from `wasper ls`)
29
+ wasper use 2
30
+
31
+ # Remove a spec from history
32
+ wasper rm 2
33
+ ```
34
+
35
+ Then open [Wasper Studio](https://wasper.site) in your browser.
36
+
37
+ ## Options
38
+
39
+ ```
40
+ wasper [--url <spec>] [--port 3388] Start in foreground
41
+ wasper start --background Start in background
42
+ wasper stop Stop background server
43
+ wasper status Show server status
44
+ wasper reload Hot-reload the spec
45
+ wasper ls List saved specs
46
+ wasper use <number|url> Start with a saved spec
47
+ wasper rm <number|url> Remove a spec from history
48
+
49
+ --url, -u OpenAPI spec URL or local file path
50
+ --port Port to listen on (default: 3388, env: WASPER_PORT)
51
+ --host Bind address (default: 0.0.0.0, env: WASPER_HOST)
52
+ --origin Public URL (env: WASPER_ORIGIN) — for self-hosting
53
+ --token Require bearer token on every request (env: WASPER_TOKEN)
54
+ --no-mcp Disable MCP endpoint
55
+ --no-proxy Disable HTTP proxy
56
+ --no-ai Disable AI chat endpoint
57
+ --readonly Block all non-GET upstream requests
58
+ --background,-b Start detached in background
59
+ ```
60
+
61
+ ## Authentication
62
+
63
+ wasper supports multiple auth schemes — configure them in Wasper Studio under **Authentication**:
64
+
65
+ | Type | Description |
66
+ |------|-------------|
67
+ | Bearer | Static bearer token |
68
+ | Basic | Username + password |
69
+ | API Key | Header, query param, or cookie |
70
+ | OAuth2 Client Credentials | Server-side token fetch with caching |
71
+ | OIDC | OpenID Connect discovery |
72
+ | Custom Headers | Any key/value headers |
73
+
74
+ Profiles let you save multiple auth configurations and switch between them with:
75
+
76
+ ```bash
77
+ # In the interactive REPL
78
+ /auth use <profile-name>
79
+ ```
80
+
81
+ ## Self-hosting
82
+
83
+ Run wasper on a remote server and connect your studio to it:
84
+
85
+ ```bash
86
+ wasper --url <spec> --origin https://api.example.com --token <secret> --background
87
+ ```
88
+
89
+ Then in the studio, click **Change CLI URL** and enter `https://api.example.com` with the token.
90
+
91
+ ## AI Agent
92
+
93
+ The AI chat (`/ai` in the studio, or the `wasper` MCP server) uses the spec to answer questions, search endpoints, and execute API calls on your behalf.
94
+
95
+ Add wasper as an MCP server in Claude Code:
96
+
97
+ ```bash
98
+ claude mcp add wasper -- wasper --port 3388
99
+ ```
100
+
101
+ ## Environment variables
102
+
103
+ | Variable | Description |
104
+ |----------|-------------|
105
+ | `WASPER_PORT` | Server port (default: 3388) |
106
+ | `WASPER_HOST` | Bind address (default: 0.0.0.0) |
107
+ | `WASPER_ORIGIN` | Public URL for self-hosted deployments |
108
+ | `WASPER_TOKEN` | Access token gate |
109
+ | `WASPER_SPEC_URL` | Default spec URL |
110
+ | `WASPER_DATA_DIR` | Override data directory (default: ~/.wasper/data) |
111
+
112
+ ## Data
113
+
114
+ wasper stores its database at `~/.wasper/data/wasper.db`. This includes request logs, saved specs, auth profiles, and settings. If you have an existing `~/.openapi-agent/data` directory, wasper will use it automatically.
115
+
116
+ ## License
117
+
118
+ MIT — see [LICENSE](./LICENSE).