Skip to content

Commit 7577ca0

Browse files
adding readme and bump version
1 parent f6e1386 commit 7577ca0

8 files changed

Lines changed: 523 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Config is stored at `~/.config/rtrvr/config.json`.
291291
| Key | Default | Description |
292292
|-----|---------|-------------|
293293
| `defaultTarget` | `auto` | Default routing mode |
294-
| `preferExtensionByDefault` | `true` | Prefer extension in auto mode |
294+
| `preferExtensionByDefault` | `false` | Prefer extension in auto mode |
295295
| `retryMaxAttempts` | `1` | Max retry attempts |
296296
| `retryBaseDelayMs` | `250` | Base retry delay |
297297
| `retryMaxDelayMs` | `4000` | Max retry delay |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rtrvr-cli-monorepo",
33
"private": true,
4-
"version": "0.1.1",
4+
"version": "0.2.0",
55
"description": "rtrvr CLI and SDK monorepo",
66
"license": "Apache-2.0",
77
"repository": {

packages/cli/README.md

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# @rtrvr-ai/cli
2+
3+
Official RTRVR CLI for browser automation with cloud + extension routing.
4+
5+
## Install
6+
7+
```bash
8+
npm install -g @rtrvr-ai/cli
9+
# or
10+
npx @rtrvr-ai/cli --help
11+
```
12+
13+
## Requirements
14+
15+
- Node.js 18+
16+
17+
## Quickstart
18+
19+
```bash
20+
# Authenticate
21+
rtrvr auth login
22+
23+
# Run an agent task
24+
rtrvr run "Extract the top 10 products" --url https://example.com
25+
26+
# Scrape a page
27+
rtrvr scrape --url https://example.com
28+
29+
# Check capabilities
30+
rtrvr capabilities
31+
32+
# Diagnose connectivity
33+
rtrvr doctor
34+
```
35+
36+
## Authentication
37+
38+
```bash
39+
# OAuth bootstrap (interactive)
40+
rtrvr auth login --oauth
41+
42+
# API key login
43+
rtrvr auth login --api-key rtrvr_...
44+
45+
# Check auth status
46+
rtrvr auth status
47+
48+
# Get raw token for automation
49+
rtrvr auth token
50+
51+
# Logout (clear credentials)
52+
rtrvr auth logout
53+
```
54+
55+
**Token types:**
56+
57+
- `rtrvr_...` API keys can access cloud + MCP + control endpoints.
58+
- `mcp_at_...` tokens are limited to MCP endpoints.
59+
60+
**Google OAuth for Drive/Docs/Sheets:**
61+
62+
```bash
63+
# Check Google OAuth status
64+
rtrvr auth google status
65+
66+
# Connect Google OAuth (opens browser)
67+
rtrvr auth google login
68+
69+
# Use with --auth-token flag
70+
rtrvr run "Extract data to Sheets" --url https://example.com --auth-token <google-token>
71+
```
72+
73+
**Environment variables override stored credentials:**
74+
75+
```bash
76+
export RTRVR_API_KEY=rtrvr_...
77+
# or
78+
export RTRVR_AUTH_TOKEN=rtrvr_...
79+
```
80+
81+
**Credential storage:**
82+
83+
Credentials are stored in the OS keychain (macOS Keychain or Linux secret-service) when available, otherwise in `~/.config/rtrvr/config.json`.
84+
85+
**Login options:**
86+
87+
```bash
88+
rtrvr auth login --oauth # OAuth bootstrap
89+
rtrvr auth login --api-key rtrvr_... # Direct API key
90+
rtrvr auth login --storage keychain # Force keychain storage
91+
rtrvr auth login --strict-auth # Fail if OAuth unavailable
92+
rtrvr auth login --no-browser # Don't auto-open browser
93+
rtrvr auth login --prefer-extension # Set default target to extension
94+
```
95+
96+
## Core commands
97+
98+
```bash
99+
rtrvr run "Do the task" --url https://example.com
100+
rtrvr agent "Do the task" --url https://example.com
101+
rtrvr scrape --url https://example.com
102+
rtrvr extension "Run in local session" --url https://example.com
103+
rtrvr devices list
104+
```
105+
106+
Key flags for `run` / `agent`:
107+
108+
**Input options:**
109+
- `<input...>` - positional task input
110+
- `--input <text>` - task text (use `-` to read from stdin)
111+
- `--input-file <path>` - read task from file
112+
- `-u, --url <url...>` - starting URL(s)
113+
114+
**Routing options:**
115+
- `--target auto|cloud|extension` - routing mode
116+
- `--cloud` - shortcut for `--target cloud`
117+
- `--extension` - shortcut for `--target extension`
118+
- `--device-id <id>` - target extension device
119+
- `--prefer-extension` - prefer extension in auto mode
120+
- `--require-local-session` - require extension or fail
121+
122+
**Data and schema:**
123+
- `--schema-file <path>` - JSON schema for structured output
124+
- `--file-url <url...>` - file URL(s) for context
125+
126+
**Configuration:**
127+
- `--settings-json <json>` - agent settings
128+
- `--tools-json <json>` - tool configuration
129+
- `--options-json <json>` - execution options
130+
- `--response-json <json>` - response config (verbosity, inlineOutputMaxBytes)
131+
- `--webhooks-json <json>` - webhook subscriptions array
132+
- `--auth-token <token>` - Google OAuth access token for Drive/Docs/Sheets/Slides
133+
134+
**Output options:**
135+
- `--json` - machine-readable JSON output
136+
- `--no-stream` - disable SSE progress streaming
137+
- `--no-stream-output` - hide tool output payloads in stream events
138+
139+
**Scrape options:**
140+
141+
All routing and output options above, plus:
142+
- `-u, --url <url...>` - URL(s) to scrape (required)
143+
144+
## Skills
145+
146+
```bash
147+
rtrvr skills templates
148+
rtrvr skills install-template agent-web
149+
rtrvr skills add ./my-skill.md
150+
rtrvr skills list
151+
rtrvr skills apply my-skill "Find financing options" --url https://example.com
152+
```
153+
154+
## MCP helpers
155+
156+
```bash
157+
rtrvr mcp init --client claude
158+
rtrvr mcp init --client cursor
159+
rtrvr mcp url
160+
```
161+
162+
## Raw MCP tools
163+
164+
```bash
165+
rtrvr raw tool planner --params-json '{"user_input":"Summarize"}'
166+
rtrvr raw act "Click login" --url https://example.com
167+
```
168+
169+
## Configuration
170+
171+
Config file: `~/.config/rtrvr/config.json`
172+
173+
**Available keys:**
174+
175+
```bash
176+
rtrvr config set defaultTarget cloud # auto|cloud|extension
177+
rtrvr config set preferExtensionByDefault true # boolean
178+
rtrvr config set authStorage keychain # auto|keychain|config
179+
rtrvr config set telemetryOptIn false # boolean
180+
rtrvr config set retryMaxAttempts 3 # number
181+
rtrvr config set retryBaseDelayMs 250 # number (ms)
182+
rtrvr config set retryMaxDelayMs 4000 # number (ms)
183+
rtrvr config set cloudBaseUrl https://api.rtrvr.ai
184+
rtrvr config set mcpBaseUrl https://mcp.rtrvr.ai
185+
rtrvr config set controlBaseUrl https://cli.rtrvr.ai
186+
```
187+
188+
**Environment variable overrides:**
189+
190+
- `RTRVR_API_KEY` or `RTRVR_AUTH_TOKEN` - auth token
191+
- `RTRVR_CONFIG_DIR` - config directory path
192+
- `RTRVR_CLOUD_BASE_URL` - cloud API base URL
193+
- `RTRVR_MCP_BASE_URL` - MCP base URL
194+
- `RTRVR_CONTROL_BASE_URL` - CLI control base URL
195+
196+
**OAuth configuration:**
197+
198+
```bash
199+
rtrvr config set oauthPollIntervalMs 2000 # OAuth poll interval
200+
rtrvr config set oauthTimeoutMs 300000 # OAuth timeout (5 min)
201+
```

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rtrvr-ai/cli",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Official rtrvr CLI — browser automation for AI agents and humans",
55
"license": "Apache-2.0",
66
"repository": {

packages/core/README.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# @rtrvr-ai/core
2+
3+
Low-level client, types, and HTTP transport for RTRVR cloud and MCP endpoints. This package powers `@rtrvr-ai/sdk` and `@rtrvr-ai/cli`.
4+
5+
## Install
6+
7+
```bash
8+
npm install @rtrvr-ai/core
9+
```
10+
11+
## Requirements
12+
13+
- Node.js 18+
14+
- ESM (`"type": "module"`)
15+
16+
## Quickstart
17+
18+
```ts
19+
import { RtrvrClient } from '@rtrvr-ai/core';
20+
21+
const client = new RtrvrClient({
22+
apiKey: process.env.RTRVR_API_KEY!,
23+
defaultTarget: 'auto',
24+
});
25+
26+
const run = await client.run({
27+
input: 'Extract the top 5 products and prices',
28+
urls: ['https://example.com'],
29+
});
30+
31+
console.log(run.metadata, run.data);
32+
```
33+
34+
## Cloud agent and scrape
35+
36+
```ts
37+
// Cloud /agent (requires rtrvr_ API key)
38+
const agent = await client.agentRun({
39+
input: 'Summarize this page',
40+
urls: ['https://example.com'],
41+
});
42+
43+
// Cloud /scrape (requires rtrvr_ API key)
44+
const scrape = await client.scrapeRun({
45+
urls: ['https://example.com'],
46+
});
47+
```
48+
49+
## MCP tools and extension routing
50+
51+
```ts
52+
// Call a tool directly through MCP
53+
const extracted = await client.toolRun({
54+
tool: 'extract_from_tab',
55+
params: {
56+
user_input: 'Extract all product names and prices',
57+
tab_urls: ['https://example.com/products'],
58+
},
59+
});
60+
61+
// List online extension devices
62+
const devices = await client.listDevices();
63+
```
64+
65+
## Routing behavior
66+
67+
- `run` and `scrape` support `target: 'cloud' | 'extension' | 'auto'`.
68+
- `auto` checks for online extension devices via `list_devices` and falls back to cloud when needed.
69+
- Use `deviceId` or `requireLocalSession: true` to force extension execution.
70+
71+
## Auth tokens
72+
73+
- `rtrvr_...` API keys can access cloud + MCP + control endpoints.
74+
- `mcp_at_...` tokens are limited to MCP endpoints. Cloud calls throw an error.
75+
76+
## Client options
77+
78+
```ts
79+
interface ClientOptions {
80+
apiKey: string;
81+
cloudBaseUrl?: string; // default https://api.rtrvr.ai
82+
mcpBaseUrl?: string; // default https://mcp.rtrvr.ai
83+
controlBaseUrl?: string; // default https://cli.rtrvr.ai
84+
timeoutMs?: number; // default 9 minutes
85+
retryPolicy?: {
86+
maxAttempts?: number; // default 1
87+
baseDelayMs?: number; // default 250ms
88+
maxDelayMs?: number; // default 4000ms
89+
retriableStatusCodes?: number[]; // default [408, 429, 500, 502, 503, 504]
90+
};
91+
defaultTarget?: 'auto' | 'cloud' | 'extension'; // default 'auto'
92+
preferExtensionByDefault?: boolean; // default false
93+
defaultHeaders?: Record<string, string>;
94+
fetchImpl?: typeof fetch; // custom fetch for tests or runtime
95+
}
96+
```
97+
98+
## Request options
99+
100+
### UnifiedRunRequest
101+
102+
```ts
103+
interface UnifiedRunRequest {
104+
input: string; // task description
105+
urls?: string[]; // starting URLs
106+
schema?: Record<string, unknown>; // structured output schema
107+
files?: CloudFile[]; // structured file inputs
108+
fileUrls?: string[]; // URLs to files for context
109+
dataInputs?: unknown[]; // additional data inputs
110+
settings?: Record<string, unknown>; // agent settings
111+
tools?: Record<string, unknown>; // tool configuration
112+
options?: Record<string, unknown>; // execution options
113+
response?: {
114+
verbosity?: 'final' | 'steps' | 'debug'; // response detail level
115+
inlineOutputMaxBytes?: number; // output size limit
116+
};
117+
webhooks?: WebhookSubscription[]; // event webhooks
118+
trajectoryId?: string; // workflow tracking ID
119+
phase?: number; // workflow phase number
120+
recordingContext?: string; // replay context
121+
authToken?: string; // Google OAuth token for Drive/Docs/Sheets
122+
target?: 'auto' | 'cloud' | 'extension'; // routing mode
123+
preferExtension?: boolean; // prefer extension in auto mode
124+
requireLocalSession?: boolean; // require extension or fail
125+
deviceId?: string; // target device ID
126+
}
127+
```
128+
129+
### Webhooks
130+
131+
```ts
132+
interface WebhookSubscription {
133+
url: string;
134+
events?: string[]; // event types to subscribe to
135+
auth?: WebhookAuth; // authentication config
136+
secret?: string; // webhook signing secret
137+
}
138+
139+
type WebhookAuth =
140+
| { type: 'bearer'; token: string }
141+
| { type: 'basic'; username: string; password: string };
142+
```
143+
144+
## Tool names
145+
146+
MCP tools are `snake_case` (for example: `planner`, `act_on_tab`, `extract_from_tab`, `crawl_and_extract_from_tab`, `scrape`, `list_devices`, `get_current_credits`, `cloud_agent`, `cloud_scrape`).
147+
148+
Aliases are available for a few tool names: `act`, `extract`, `crawl`, `getPageData`, `listDevices`, `getCurrentCredits`.
149+
150+
## Errors
151+
152+
Requests throw `RtrvrError` with `status`, `requestId`, and optional `details` when available.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rtrvr-ai/core",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Core runtime and API client primitives for rtrvr CLI/SDK",
55
"license": "Apache-2.0",
66
"repository": {

0 commit comments

Comments
 (0)