Skip to content

Commit e2c7c28

Browse files
linfangwgemini-code-assist[bot]claude
authored
docs(agent): update agent docs with latest CLI and MCP guidelines (#16)
* feat(cli): add gradient welcome/login banners and fix centering - Add banner.mjs: Banner3 solid block QVERIS, brand cyan→indigo gradient - Show banner on help, login, and interactive; respect --json and --no-color - Lazy isColorEnabled in colors.mjs; set NO_COLOR when --no-color for consistent output - Center banner and taglines using stripAnsi + displayWidth (CJK double-width) Made-with: Cursor * Update packages/cli/src/output/colors.mjs Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update packages/cli/src/output/banner.mjs Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update packages/cli/src/output/banner.mjs Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * perf(cli): batch ANSI spans in banner; English tagline - Merge consecutive chars with same RGB (truecolor) or band (16-color fallback) - Replace per-char cyan/bold/dim with single SGR per run in fallback - Tagline: use 'intelligent orchestration' instead of Chinese Made-with: Cursor * chore(cli): bump version to 0.3.0 Made-with: Cursor * feat: add CLI/Agent sections to getting-started docs + fix CLI multi-region gaps - Add QVeris CLI and Agent Setup sections to all three getting-started docs (en-US, zh-CN, cn/zh-CN), reorder sections: CLI → MCP → SDK → API - Fix CLI multi-region support: region-aware account URLs in login/credits, display region in doctor/whoami/config list, pass baseUrl in login validation, store region in session, add QVERIS_REGION to help text Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(cli): interactive region selection during login When QVERIS_REGION or --base-url is not set, `qveris login` now prompts the user to choose their region (Global/China) before showing the API key URL. This removes the need to set environment variables before first login. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(agent): update agent docs with latest CLI v0.4.0 and MCP v0.5.0 guidelines - Update MCP tool names from search_tools/get_tools_by_ids/execute_tool to discover/inspect/call with backward compatibility notes - Add CLI as primary integration method with full command reference, key flags (--json, --dry-run, --codegen), session/index shortcuts, and multi-region support details - Add CLI setup option (qveris login, qveris doctor) to SETUP.md - Add CLI workflow section to GUIDELINES.md with agent-specific patterns - Fix broken doc links from docs/ to docs/en-US/ across all four files - Update system prompt recommendation to use new tool names - Add missing logout and config commands to CLI reference table - Clarify different default limit values between CLI (5) and MCP (20) - Update version info to llms-full.txt v1.1.0, last updated 2026-04-10 * docs(agent): address Gemini review comments - Clarify --max-size default difference between CLI and MCP in GUIDELINES.md - Remove CLI default from MCP parameters section in llms-full.txt - Add note about params_to_tool (MCP) vs parameters (REST) naming difference * docs(agent): add --max-size defaults to llms-full.txt for consistency Match the detailed default description from GUIDELINES.md. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0d9cdde commit e2c7c28

4 files changed

Lines changed: 258 additions & 39 deletions

File tree

agent/GUIDELINES.md

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,58 @@ When a tool response exceeds `max_response_size`, the API returns:
162162

163163
---
164164

165+
## CLI Workflow
166+
167+
When using the QVeris CLI (`@qverisai/cli` v0.4.0) instead of MCP, the same Discover → Inspect → Call pattern applies via shell commands.
168+
169+
### Basic Agent Workflow
170+
171+
```bash
172+
# Discover tools (free)
173+
qveris discover "weather forecast API" --json
174+
175+
# Inspect top result by index (free)
176+
qveris inspect 1 --json
177+
178+
# Call with parameters (1-100 credits)
179+
qveris call 1 --params '{"city": "London"}' --json
180+
181+
# Validate without consuming credits
182+
qveris call 1 --params '{"city": "London"}' --dry-run --json
183+
184+
# Generate code snippet after successful call
185+
qveris call 1 --params '{"city": "London"}' --codegen curl
186+
```
187+
188+
### Key Flags for Agents
189+
190+
| Flag | Purpose |
191+
|------|---------|
192+
| `--json` | Structured JSON output — always use in agent/script contexts |
193+
| `--dry-run` | Validate parameters without executing (no credits consumed) |
194+
| `--codegen <curl\|js\|python>` | Generate API call snippets from last successful call |
195+
| `--params <json\|@file\|->` | Pass parameters as inline JSON, from file (`@params.json`), or stdin (`-`) |
196+
| `--limit <n>` | Limit discover results (default: 5) |
197+
| `--max-size <bytes>` | Response size limit; `-1` for unlimited (default: 4KB TTY, 20KB non-TTY). MCP default is 20KB. |
198+
199+
### Session & Index Shortcuts
200+
201+
After `qveris discover`, results are stored in a session file (30-minute TTL). Use numeric indices in subsequent commands:
202+
203+
```bash
204+
qveris discover "stock price API" # Returns indexed results: 1, 2, 3...
205+
qveris inspect 1 # Inspect first result by index
206+
qveris call 1 --params '...' # Call first result by index
207+
```
208+
209+
The session tracks the discovery ID, so `inspect` and `call` automatically link back to the original discovery for analytics. Use `qveris history` to view current session state.
210+
211+
### Diagnostics
212+
213+
Run `qveris doctor` to check setup: Node.js version, API key validity, region detection, and API connectivity.
214+
215+
---
216+
165217
## Self-Check (before responding)
166218

167219
- Is my discover query a **tool type description** or a **factual question**? → If it contains specific names, "is X listed?", or "what is Y?" — use web_search.
@@ -185,10 +237,20 @@ Region is auto-detected from the API key prefix. Override with `QVERIS_REGION=cn
185237

186238
**Auth**: `Authorization: Bearer ${QVERIS_API_KEY}`
187239

188-
| Action | Endpoint | Body |
189-
|--------|----------|------|
190-
| Discover | `POST /search` | `{"query": "...", "limit": 10}` |
191-
| Inspect | `POST /tools/by-ids` | `{"tool_ids": ["..."], "search_id": "..."}` |
192-
| Call | `POST /tools/execute?tool_id=...` | `{"search_id": "...", "parameters": {...}, "max_response_size": 20480}` |
240+
| Action | REST Endpoint | MCP Tool | CLI Command |
241+
|--------|--------------|----------|-------------|
242+
| Discover | `POST /search` | `discover` | `qveris discover <query>` |
243+
| Inspect | `POST /tools/by-ids` | `inspect` | `qveris inspect <id\|index>` |
244+
| Call | `POST /tools/execute?tool_id=...` | `call` | `qveris call <id\|index>` |
245+
246+
**REST Body Examples:**
247+
248+
| Action | Body |
249+
|--------|------|
250+
| Discover | `{"query": "...", "limit": 10}` |
251+
| Inspect | `{"tool_ids": ["..."], "search_id": "..."}` |
252+
| Call | `{"search_id": "...", "parameters": {...}, "max_response_size": 20480}` |
253+
254+
> **MCP backward compatibility:** Old tool names `search_tools`, `get_tools_by_ids`, `execute_tool` are still supported as deprecated aliases in MCP server v0.5.0. Use the new names (`discover`, `inspect`, `call`) going forward.
193255
194256
Full API documentation: https://github.com/QVerisAI/QVerisAI/blob/main/docs/en-US/rest-api.md

agent/SETUP.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,61 @@ The QVeris MCP server requires Node.js.
4141
- Attempt to install it using the system's package manager (e.g., `winget install OpenJS.NodeJS` on Windows, `brew install node` on macOS, or `apt install nodejs` on Linux).
4242
- If you cannot install it automatically, stop and ask the user to install Node.js (LTS version recommended).
4343

44-
## 2. Detect Environment & Configure
44+
## 2. Choose Integration Method
45+
46+
QVeris supports two integration methods. Choose based on your environment:
47+
48+
| Method | Best For | How It Works |
49+
|--------|----------|--------------|
50+
| **CLI** (recommended) | Agents with shell access (Claude Code, OpenClaw, terminals) | Subprocess calls — zero prompt tokens, 10,000+ tools without bloat |
51+
| **MCP Server** | IDE integrations (Cursor, Claude Desktop, OpenCode) | MCP protocol — tools injected into agent context |
52+
53+
### Option A: CLI Setup (Recommended for shell-capable agents)
54+
55+
Install the CLI globally:
56+
57+
```bash
58+
# One-liner install
59+
curl -fsSL https://qveris.ai/cli/install | bash
60+
61+
# Or via npm
62+
npm install -g @qverisai/cli
63+
```
64+
65+
Authenticate with interactive region selection:
66+
67+
```bash
68+
qveris login
69+
```
70+
71+
The `login` command will:
72+
1. Prompt for region selection (Global or China) if not pre-configured
73+
2. Open a browser to retrieve your API key
74+
3. Accept masked key input and validate it
75+
4. Save credentials to `~/.config/qveris/config.json`
76+
77+
Alternatively, set the API key directly:
78+
79+
```bash
80+
qveris config set api_key YOUR_QVERIS_API_KEY
81+
```
82+
83+
Verify the setup:
84+
85+
```bash
86+
qveris doctor # Check Node.js, API key, region, connectivity
87+
qveris whoami # Show auth status and region
88+
qveris credits # Check credit balance
89+
```
90+
91+
Skip to **Section 3: Verify Installation** once `qveris doctor` passes all checks.
92+
93+
### Option B: MCP Server Setup
4594

4695
Detect which coding tool or environment you are currently running in (e.g., Claude Code, OpenCode, Cursor, Trae, VS Code).
4796

4897
**Configuration involves two steps for all environments:**
49-
1. **MCP Server Setup:** Connects the QVeris tool server (`@qverisai/mcp`) to your environment.
98+
1. **MCP Server Setup:** Connects the QVeris tool server (`@qverisai/mcp` v0.5.0) to your environment.
5099
2. **Skill Configuration:** Teaches the agent how to use the tools using the MCP/client skill definition file.
51100
- **Skill URL:** `https://github.com/QVerisAI/QVerisAI/blob/main/skills/qveris/SKILL.md`
52101

@@ -215,11 +264,20 @@ More details: https://qveris.ai/docs/openclaw-setup
215264

216265
## 3. Verify Installation
217266

218-
After configuration, you must verify that the QVeris tools are visible and usable.
267+
After configuration, verify that QVeris tools are visible and usable.
268+
269+
### CLI Verification
270+
271+
```bash
272+
qveris doctor # Run diagnostics
273+
qveris discover "weather forecast API" # Test discovery (free)
274+
```
275+
276+
### MCP Verification
219277

220278
1. **Restart:** If required by the environment, restart the MCP client or reload the window.
221-
2. **List Tools:** Run the tool discovery command available to you (e.g., `mcp.list_tools`, `search_tools`, or `/mcp` in chat).
222-
3. **Check for QVeris:** Look for tools starting with `qveris_` or the `qveris` server in the list.
279+
2. **List Tools:** Run the tool discovery command available to you (e.g., `mcp.list_tools`, or `/mcp` in chat).
280+
3. **Check for QVeris:** Look for `discover`, `inspect`, `call` tools (or the `qveris` server) in the list. Legacy tool names `search_tools`, `get_tools_by_ids`, `execute_tool` are still supported as deprecated aliases.
223281

224282
## 4. Troubleshooting & Fixes
225283

0 commit comments

Comments
 (0)