@qverisai/cli 0.5.0 → 0.6.1

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/README.md CHANGED
@@ -2,57 +2,81 @@
2
2
 
3
3
  Discover, inspect, and call 10,000+ API capabilities from your terminal.
4
4
 
5
+ New users can run the guided first-call wizard:
6
+
7
+ ```bash
8
+ qveris init
9
+ ```
10
+
5
11
  ```
6
12
  $ qveris discover "weather forecast API"
7
13
  Found 5 capabilities matching your query
8
14
 
9
- 1. gridpoint_forecast by Weather.gov
10
- weather_gov.gridpoints.forecast.retrieve.v1
11
- Returns a textual forecast for a 2.5km grid area
12
- relevance: 95% · success: 99.8% · latency: ~180ms · billing: 3 credits / request
15
+ 1. icons
16
+ weather_gov.icons.retrieve.v3.ad0b4d80
17
+ Returns a forecast icon. Icon services in API are deprecated.
18
+ relevance: 99% · success: 100.0% · latency: ~325ms · billing: Charged 5.75 credits per call
13
19
 
14
- 2. current_weather by OpenWeather
15
- openweathermap.weather.current.v1
16
- Get current weather data for any location
17
- relevance: 87% · success: 99.5% · latency: ~200ms · billing: 2 credits / request
20
+ 2. Weather Information Retrieve
21
+ amap_webservice.weather.weatherinfo.retrieve.v3
22
+ Query current (base) or future (all) weather information for a specified city using adcode.
23
+ relevance: 96% · success: 83.0% · latency: ~467ms · billing: Charged 5.75 credits per call
18
24
 
19
25
  $ qveris inspect 1
20
- gridpoint_forecast
21
- Returns a textual forecast for a 2.5km grid area
26
+ icons
27
+ weather_gov.icons.retrieve.v3.ad0b4d80
28
+ Returns a forecast icon. Icon services in API are deprecated.
22
29
 
23
- Provider: Weather.gov
24
- Latency: ~180ms
25
- Success: 99.8%
26
- Billing: 3 credits / request
30
+ Provider: weather.gov
31
+ Region: global
32
+ Latency: ~325ms
33
+ Success: 100.0%
34
+ Billing: Charged 5.75 credits per call
27
35
 
28
36
  Parameters:
29
- wfo string required
30
- Forecast office ID
31
- values: "LWX", "OKX", "LAX", ...
32
- x integer required
33
- Forecast grid X coordinate
34
- y integer required
35
- Forecast grid Y coordinate
37
+ set string required
38
+ .
39
+ timeOfDay string required The time of day for which to retrieve data (e.g., "morning", "afternoon")
40
+
41
+ first string required The first record to retrieve (index or ID)
42
+
43
+ size string optional
44
+ Font size
45
+ fontsize integer optional
46
+ Font size
36
47
 
37
48
  Example:
38
- {"wfo": "LWX", "x": 90, "y": 90}
49
+ {"set":"land","first":"sct","timeOfDay":"day"}
39
50
 
40
- $ qveris call 1 --params '{"wfo":"LWX","x":90,"y":90}'
41
- ✓ success · 523ms · 10 credits pre-settlement · (1368087.93 remaining)
42
- tool: weather_gov... · id: 7ebcaf9d-...
51
+ $ qveris call 1 --params '{"set":"land","first":"sct","timeOfDay":"day"}'
52
+ ✓ success · 311ms · 5.75 credits pre-settlement · (1078.15 remaining)
53
+ tool: amap_webservice.weather.weatherinfo.retrieve.v3 · id: d79cd15b-2f36-4ce1-bb3c-6ea28b5ecfa2
43
54
 
44
55
  Billing:
45
- 10 credits per successful request
46
- Pre-settlement: 10 credits
56
+ Total estimated pre-settlement charge: 5.75 credits
57
+ Pre-settlement: 5.75 credits
58
+ Final charge status: qveris usage --mode search --execution-id d79cd15b-2f36-4ce1-bb3c-6ea28b5ecfa2
47
59
 
48
60
  {
49
- "type": "Feature",
50
- "properties": {
51
- "periods": [
52
- { "name": "Today", "temperature": 79, "shortForecast": "Partly Sunny" },
53
- ...
54
- ]
55
- }
61
+ "status": "1",
62
+ "count": "1",
63
+ "info": "OK",
64
+ "infocode": "10000",
65
+ "lives": [
66
+ {
67
+ "province": "北京",
68
+ "city": "东城区",
69
+ "adcode": "110101",
70
+ "weather": "多云",
71
+ "temperature": "31",
72
+ "winddirection": "西南",
73
+ "windpower": "≤3",
74
+ "humidity": "50",
75
+ "reporttime": "2026-05-13 13:33:58",
76
+ "temperature_float": "31.0",
77
+ "humidity_float": "50.0"
78
+ }
79
+ ]
56
80
  }
57
81
  ```
58
82
 
@@ -61,12 +85,16 @@ Billing:
61
85
  **One-liner (recommended):**
62
86
 
63
87
  ```bash
88
+ # Linux / macOS
64
89
  curl -fsSL https://qveris.ai/cli/install | bash
90
+
91
+ # Windows (PowerShell)
92
+ irm https://qveris.ai/cli/install.ps1 | iex
65
93
  ```
66
94
 
67
95
  **Or via npm:**
68
96
 
69
- ```bash
97
+ ```sh
70
98
  npm install -g @qverisai/cli
71
99
  ```
72
100
 
@@ -81,6 +109,10 @@ Requires Node.js 18+.
81
109
  ## Quick Start
82
110
 
83
111
  ```bash
112
+ # Guided path: auth → discover → inspect → call → usage/ledger guidance
113
+ qveris init
114
+
115
+ # Manual path
84
116
  # 1. Authenticate
85
117
  qveris login
86
118
 
@@ -91,7 +123,7 @@ qveris discover "weather forecast"
91
123
  qveris inspect 1
92
124
 
93
125
  # 4. Call it
94
- qveris call 1 --params '{"wfo": "LWX", "x": 90, "y": 90}'
126
+ qveris call 1 --params '{"set":"land","first":"sct","timeOfDay":"day"}'
95
127
  ```
96
128
 
97
129
  ## Commands
@@ -100,7 +132,8 @@ qveris call 1 --params '{"wfo": "LWX", "x": 90, "y": 90}'
100
132
 
101
133
  | Command | Description |
102
134
  |---------|-------------|
103
- | `qveris discover <query>` | Find capabilities by natural language. Shows tool ID, provider, description, relevance, success rate, latency, and billing rule when available. |
135
+ | `qveris init` | Guided first-call wizard: auth, discover, inspect, call, and usage/ledger reconciliation guidance. |
136
+ | `qveris discover <query>` | Find capabilities by natural language. Shows tool ID, description, relevance, success rate, latency, billing rule, provider, tags, and region when available. |
104
137
  | `qveris inspect <id\|index>` | View full tool details: parameters (type, required, description, enum values), example, provider info, execution history. |
105
138
  | `qveris call <id\|index>` | Execute a capability. Shows result data, execution time, pre-settlement billing, and remaining credits. |
106
139
 
@@ -122,10 +155,26 @@ qveris call 1 --params '{"wfo": "LWX", "x": 90, "y": 90}'
122
155
  | `qveris interactive` | Launch REPL mode (discover/inspect/call/codegen in one session) |
123
156
  | `qveris doctor` | Self-check: Node.js version, API key, region, connectivity |
124
157
  | `qveris config <subcommand>` | Manage CLI settings (set, get, list, reset, path) |
158
+ | `qveris mcp configure` | Generate MCP client config for Cursor, Claude Desktop, OpenCode, OpenClaw, or generic stdio; generate a `claude mcp add` command for Claude Code |
159
+ | `qveris mcp validate` | Validate an MCP config file, with optional live stdio tool probing |
125
160
  | `qveris completions <shell>` | Generate shell completions (bash/zsh/fish) |
126
161
 
127
162
  ## Usage
128
163
 
164
+ ### Init
165
+
166
+ Run the guided first-call wizard:
167
+
168
+ ```bash
169
+ qveris init
170
+ qveris init --query "weather forecast API"
171
+ qveris init --dry-run
172
+ qveris init --resume --params '{"city": "London"}'
173
+ qveris init --json
174
+ ```
175
+
176
+ `init` discovers a capability, inspects the selected result, calls it with sample parameters when available, and ends with exact `usage` / `ledger` commands so you can reconcile final billing. Use `--resume` after recoverable parameter or provider failures to reuse the last discovery session.
177
+
129
178
  ### Discover
130
179
 
131
180
  Search for capabilities using natural language. Each result shows the tool name, provider, tool ID, description, and quality metrics to help you choose.
@@ -190,7 +239,8 @@ Response truncated (32KB → 4KB preview)
190
239
 
191
240
  Full content (valid 120 min):
192
241
  https://qveris-tool-results-cache-bj.oss-cn-beijing...
193
- Download: curl -o result.json '<url>'
242
+ Download: curl -o result.json '<url>' (Linux/macOS)
243
+ Download: Invoke-WebRequest -Uri '<url>' -OutFile result.json (Windows PowerShell)
194
244
 
195
245
  Schema:
196
246
  query: string
@@ -205,6 +255,42 @@ Preview:
205
255
 
206
256
  For agent/script use (`--json` or piped output), the default increases to 20KB (matching the MCP server). Use `--max-size -1` for unlimited.
207
257
 
258
+ ### MCP Configuration
259
+
260
+ Generate MCP client config without hand-editing JSON. Print mode is the default and uses `YOUR_QVERIS_API_KEY` placeholders so the output is safe to share. Placeholder output intentionally fails API key validation until you replace it or use `--include-key`. For Claude Code, the command prints a `claude mcp add` command instead of writing a config file.
261
+
262
+ ```bash
263
+ # Print safe config for Cursor
264
+ qveris mcp configure --target cursor
265
+
266
+ # Write a working Cursor config using your resolved API key
267
+ qveris mcp configure --target cursor --write --include-key
268
+
269
+ # Other supported targets
270
+ qveris mcp configure --target claude-desktop --write --include-key
271
+ qveris mcp configure --target opencode --write --include-key
272
+ qveris mcp configure --target openclaw --write --include-key
273
+ qveris mcp configure --target claude-code
274
+ qveris mcp configure --target generic --json
275
+ ```
276
+
277
+ Config file locations and destinations:
278
+ - **Cursor**: `~/.cursor/mcp.json` (Linux/macOS) or `%USERPROFILE%\.cursor\mcp.json` (Windows)
279
+ - **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
280
+ - **Claude Code**: no config file is written; `qveris mcp configure --target claude-code` outputs a `claude mcp add` command
281
+
282
+ Validate an existing config:
283
+
284
+ ```bash
285
+ # Static config validation
286
+ qveris mcp validate --target cursor
287
+
288
+ # Live stdio probe: starts the MCP server and confirms discover/inspect/call are visible
289
+ qveris mcp validate --target cursor --probe
290
+ ```
291
+
292
+ Supported targets: `cursor`, `claude-desktop`, `claude-code`, `opencode`, `openclaw`, `generic`.
293
+
208
294
  ### Usage Audit
209
295
 
210
296
  Use `qveris usage` to answer whether recent calls succeeded, failed, or charged credits. It defaults to `summary` mode to protect Agent context.
@@ -270,12 +356,19 @@ qveris> exit
270
356
  ### API Key
271
357
 
272
358
  ```bash
273
- # Option 1: Login (saves to ~/.config/qveris/config.json)
359
+ # Option 1: Login (saves to the qveris config file)
274
360
  qveris login
275
361
 
276
362
  # Option 2: Environment variable
363
+ # Linux / macOS
277
364
  export QVERIS_API_KEY="sk-1_..."
278
365
 
366
+ # Windows (PowerShell)
367
+ $env:QVERIS_API_KEY="sk-1_..."
368
+
369
+ # Windows (CMD)
370
+ set QVERIS_API_KEY=sk-1_...
371
+
279
372
  # Option 3: Per-command flag
280
373
  qveris discover "weather" --api-key "sk-1_..."
281
374
  ```
@@ -300,18 +393,34 @@ No extra configuration needed. `qveris login` prompts for region selection inter
300
393
  qveris login --token "sk-cn-xxx"
301
394
 
302
395
  # Or environment variable
396
+ # Linux / macOS
303
397
  export QVERIS_REGION=cn
304
398
 
399
+ # Windows (PowerShell)
400
+ $env:QVERIS_REGION="cn"
401
+
402
+ # Windows (CMD)
403
+ set QVERIS_REGION=cn
404
+
305
405
  # Or custom base URL
406
+ # Linux / macOS
306
407
  export QVERIS_BASE_URL=https://custom.endpoint/api/v1
307
408
 
409
+ # Windows (PowerShell)
410
+ $env:QVERIS_BASE_URL="https://custom.endpoint/api/v1"
411
+
412
+ # Windows (CMD)
413
+ set QVERIS_BASE_URL=https://custom.endpoint/api/v1
414
+
308
415
  # Or per-command
309
416
  qveris discover "weather" --base-url https://qveris.cn/api/v1
310
417
  ```
311
418
 
312
419
  ### Config File
313
420
 
314
- Located at `~/.config/qveris/config.json` (respects `XDG_CONFIG_HOME`).
421
+ Located at:
422
+ - **All platforms**: `$XDG_CONFIG_HOME/qveris/config.json` when `XDG_CONFIG_HOME` is set
423
+ - **Default**: `~/.config/qveris/config.json` (for example, `C:\Users\<user>\.config\qveris\config.json` on Windows)
315
424
 
316
425
  ```bash
317
426
  qveris config list # View all settings with sources
@@ -342,6 +451,11 @@ qveris completions fish | source
342
451
  | `--api-key <key>` | | Override API key |
343
452
  | `--timeout <seconds>` | | Request timeout |
344
453
  | `--max-size <bytes>` | | Response size limit (-1 = unlimited) |
454
+ | `--target <target>` | | MCP target |
455
+ | `--output <path>` | | MCP config output path |
456
+ | `--write` | | Write MCP config to disk |
457
+ | `--include-key` | | Include resolved API key instead of a placeholder |
458
+ | `--probe` | | Live-probe MCP tools during validation |
345
459
  | `--no-color` | | Disable colors |
346
460
  | `--version` | `-V` | Print version |
347
461
  | `--help` | `-h` | Show help |
@@ -359,8 +473,22 @@ When used by agents or in scripts, the CLI auto-detects non-TTY environments:
359
473
 
360
474
  ```bash
361
475
  # Agent workflow: discover → select → call → parse
476
+
477
+ # Linux / macOS
362
478
  TOOL=$(qveris discover "weather" --json | jq -r '.results[0].tool_id')
363
479
  qveris call "$TOOL" --params '{"city":"London"}' --json | jq '.result.data'
480
+
481
+ # Windows (PowerShell)
482
+ $TOOL = qveris discover "weather" --json | ConvertFrom-Json | Select-Object -ExpandProperty results | Select-Object -First 1 | Select-Object -ExpandProperty tool_id
483
+ qveris call $TOOL --params '{"city":"London"}' --json | ConvertFrom-Json | Select-Object -ExpandProperty result | Select-Object -ExpandProperty data
484
+
485
+ # Windows (CMD, interactive) - requires jq for Windows
486
+ for /f "tokens=*" %i in ('qveris discover "weather" --json ^| jq -r ".results[0].tool_id"') do set TOOL=%i
487
+ qveris call %TOOL% --params "{\"city\":\"London\"}" --json | jq ".result.data"
488
+
489
+ # Windows (.bat/.cmd script) - use %%i instead of %i
490
+ for /f "tokens=*" %%i in ('qveris discover "weather" --json ^| jq -r ".results[0].tool_id"') do set TOOL=%%i
491
+ qveris call %TOOL% --params "{\"city\":\"London\"}" --json | jq ".result.data"
364
492
  ```
365
493
 
366
494
  ## Exit Codes
@@ -383,7 +511,7 @@ QVeris CLI uses only Node.js built-in APIs. No `chalk`, no `commander`, no `yarg
383
511
  - Website: https://qveris.ai (global) / https://qveris.cn (China)
384
512
  - API Docs: https://qveris.ai/docs
385
513
  - Get API Key: https://qveris.ai/account?page=api-keys (global) / https://qveris.cn/account?page=api-keys (China)
386
- - GitHub: https://github.com/QVerisAI/QVerisAI
514
+ - GitHub: https://github.com/QVerisAI/qveris-agent-toolkit
387
515
 
388
516
  ## License
389
517
 
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@qverisai/cli",
3
- "version": "0.5.0",
4
- "description": "QVeris CLI -- discover, inspect, and call 10,000+ capabilities",
3
+ "version": "0.6.1",
4
+ "description": "QVeris CLI for agent capability discovery, inspection, calling, and audit",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "qveris": "./bin/qveris.mjs"
8
8
  },
9
+ "scripts": {
10
+ "test": "node --test"
11
+ },
9
12
  "engines": {
10
13
  "node": ">=18"
11
14
  },
@@ -24,7 +27,7 @@
24
27
  ],
25
28
  "repository": {
26
29
  "type": "git",
27
- "url": "https://github.com/QVerisAI/QVerisAI",
30
+ "url": "https://github.com/QVerisAI/qveris-agent-toolkit",
28
31
  "directory": "packages/cli"
29
32
  },
30
33
  "homepage": "https://qveris.ai",
@@ -16,11 +16,15 @@ export function resolveApiKey(flagValue) {
16
16
  }
17
17
 
18
18
  const trimmed = value.trim();
19
- for (const pattern of PLACEHOLDER_PATTERNS) {
20
- if (pattern.test(trimmed)) {
21
- throw new CliError("AUTH_MISSING_KEY", "API key appears to be a placeholder. Set a real key.");
22
- }
19
+ if (isPlaceholderApiKey(trimmed)) {
20
+ throw new CliError("AUTH_MISSING_KEY", "API key appears to be a placeholder. Set a real key.");
23
21
  }
24
22
 
25
23
  return trimmed;
26
24
  }
25
+
26
+ export function isPlaceholderApiKey(value) {
27
+ if (typeof value !== "string") return true;
28
+ const trimmed = value.trim();
29
+ return PLACEHOLDER_PATTERNS.some((pattern) => pattern.test(trimmed));
30
+ }