prompteryx 0.1.0 → 0.2.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog — prompteryx (CLI)
2
+
3
+ ## 0.2.0 — 2026-10-02
4
+ - Requires `@prompteryx/sdk` ^0.5.0 — publish the SDK first.
5
+ - Fixed: `workflows run --wait` failed with "Execution not found" (the SDK
6
+ never returned the execution id); `workflows list --search` was ignored;
7
+ `workflows get` / `runs get` printed the API wrapper instead of the record;
8
+ `runs logs` printed quoted JSON strings.
9
+ - `whoami` shows remaining AI credits, cloud-browser minutes, Connect Hub calls
10
+ and workflow runs (it showed only the plan).
11
+ - New flags: `agent --model ID`, `workflows run --webhook-url URL`.
12
+ - 429s say whether it is the key's request limit or a used-up allowance, and
13
+ when to retry.
14
+
15
+ ## 0.1.0 — 2026-09-20
16
+ - First release: OAuth (PKCE + loopback) or API-key login, agent, workflows,
17
+ runs, browser, schedules, apps (Connect Hub), mcp.
package/README.md CHANGED
@@ -1,54 +1,54 @@
1
- # prompteryx
2
-
3
- The [Prompteryx](https://www.prompteryx.ai) command line. Run AI browser agents, cloud browsers, Visual Studio workflows and Connect Hub actions from a terminal or a CI job.
4
-
5
- ```bash
6
- npm install -g prompteryx # or: npx prompteryx <command>
7
- prompteryx login # opens the browser; approve once, tokens refresh automatically
8
- prompteryx agent "Find the cheapest direct flight from London to Lisbon next Tuesday"
9
- ```
10
-
11
- ## Sign in
12
-
13
- | Command | Use when |
14
- |---|---|
15
- | `prompteryx login` | You are at a keyboard. Opens `https://www.prompteryx.ai/oauth/authorize`; no key is pasted. |
16
- | `prompteryx login --key px_live_…` | Servers and CI. Create the key in Settings → API Keys. |
17
- | `prompteryx login --cloud-browser-key pcb_live_…` | Needed only for `prompteryx browser …`. Create it in Cloud Platform → API Keys. |
18
-
19
- `PROMPTERYX_API_KEY` and `PROMPTERYX_API_URL` environment variables override the saved config (`~/.prompteryx/config.json`). Add `--json` to any command for machine-readable output.
20
-
21
- ## Commands
22
-
23
- ```text
24
- agent "goal" [--start-url URL] [--max-steps N] [--max-credits N] [--save-as-workflow] [--local]
25
- workflows list [--search q] | get <id> | run <id> [--input key=value …] [--wait] [--visible]
26
- runs get <id> | wait <id> | logs <id>
27
- browser create [--record] [--local] | list | close <id>
28
- schedules list [--workflow <id>]
29
- apps list [--search q] | actions <app> | accounts | run <app> <action> --params '{"to":"…"}' [--account <id>]
30
- mcp <claude-code|cursor|vscode|claude-desktop|http>
31
- whoami | logout | help | version
32
- ```
33
-
34
- ### Examples
35
-
36
- ```bash
37
- # Run a workflow with variables and wait for the result
38
- prompteryx workflows run fHX8NlpAJxoWuAOll7zr --input postcode="SW1A 1AA" --wait
39
-
40
- # Start a cloud browser and drive it from Playwright
41
- prompteryx browser create --record
42
- # Connect with Playwright: chromium.connectOverCDP("wss://…")
43
-
44
- # Send an email through a connected Gmail account
45
- prompteryx apps actions gmail
46
- prompteryx apps run gmail gmail-send-email --params '{"to":"hello@example.com","subject":"Hi","body":"From the CLI"}'
47
-
48
- # Print the one-line setup for Claude Code
49
- prompteryx mcp claude-code
50
- ```
51
-
52
- Access follows your account's balance of cloud browser minutes and AI credits, whatever plan you are on. When a limit is hit the command explains what to top up.
53
-
54
- Docs: https://www.prompteryx.ai/docs/developers/cli
1
+ # prompteryx
2
+
3
+ The [Prompteryx](https://www.prompteryx.ai) command line. Run AI browser agents, cloud browsers, Visual Studio workflows and Connect Hub actions from a terminal or a CI job.
4
+
5
+ ```bash
6
+ npm install -g prompteryx # or: npx prompteryx <command>
7
+ prompteryx login # opens the browser; approve once, tokens refresh automatically
8
+ prompteryx agent "Find the cheapest direct flight from London to Lisbon next Tuesday"
9
+ ```
10
+
11
+ ## Sign in
12
+
13
+ | Command | Use when |
14
+ |---|---|
15
+ | `prompteryx login` | You are at a keyboard. Opens `https://www.prompteryx.ai/oauth/authorize`; no key is pasted. |
16
+ | `prompteryx login --key px_live_…` | Servers and CI. Create the key in Settings → API Keys. |
17
+ | `prompteryx login --cloud-browser-key pcb_live_…` | Needed only for `prompteryx browser …`. Create it in Cloud Platform → API Keys. |
18
+
19
+ `PROMPTERYX_API_KEY` and `PROMPTERYX_API_URL` environment variables override the saved config (`~/.prompteryx/config.json`). Add `--json` to any command for machine-readable output.
20
+
21
+ ## Commands
22
+
23
+ ```text
24
+ agent "goal" [--start-url URL] [--model ID] [--max-steps N] [--max-credits N] [--save-as-workflow] [--local]
25
+ workflows list [--search q] | get <id> | run <id> [--input key=value …] [--wait] [--visible] [--webhook-url URL]
26
+ runs get <id> | wait <id> | logs <id>
27
+ browser create [--record] [--local] | list | close <id>
28
+ schedules list [--workflow <id>]
29
+ apps list [--search q] | actions <app> | accounts | run <app> <action> --params '{"to":"…"}' [--account <id>]
30
+ mcp <claude-code|cursor|vscode|claude-desktop|http>
31
+ whoami | logout | help | version
32
+ ```
33
+
34
+ ### Examples
35
+
36
+ ```bash
37
+ # Run a workflow with variables and wait for the result
38
+ prompteryx workflows run fHX8NlpAJxoWuAOll7zr --input postcode="SW1A 1AA" --wait
39
+
40
+ # Start a cloud browser and drive it from Playwright
41
+ prompteryx browser create --record
42
+ # Connect with Playwright: chromium.connectOverCDP("wss://…")
43
+
44
+ # Send an email through a connected Gmail account
45
+ prompteryx apps actions gmail
46
+ prompteryx apps run gmail gmail-send-email --params '{"to":"hello@example.com","subject":"Hi","body":"From the CLI"}'
47
+
48
+ # Print the one-line setup for Claude Code
49
+ prompteryx mcp claude-code
50
+ ```
51
+
52
+ Access follows your account's balance of cloud browser minutes and AI credits, whatever plan you are on. When a limit is hit the command explains what to top up.
53
+
54
+ Docs: https://www.prompteryx.ai/docs/developers/cli
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * prompteryx login [--key px_live_…] [--cloud-browser-key pcb_live_…]
6
6
  * prompteryx whoami | logout
7
- * prompteryx agent "goal" [--start-url URL] [--max-steps N] [--save-as-workflow] [--local]
7
+ * prompteryx agent "goal" [--start-url URL] [--model ID] [--max-steps N] [--save-as-workflow] [--local]
8
8
  * prompteryx workflows list | get <id> | run <id> [--input k=v …] [--wait] [--visible] [--json]
9
9
  * prompteryx runs get <id> | wait <id> | logs <id>
10
10
  * prompteryx browser create [--record] [--local] | list | close <id>
@@ -17,7 +17,7 @@
17
17
  import { Prompteryx } from '@prompteryx/sdk';
18
18
  import { baseUrl, configPath, readConfig, updateConfig, writeConfig } from './config.js';
19
19
  import { ensureFreshOAuth, oauthLogin, revokeOAuth } from './login.js';
20
- const VERSION = '0.1.0';
20
+ const VERSION = '0.2.0';
21
21
  function parseArgs(argv) {
22
22
  const positional = [];
23
23
  const flags = {};
@@ -148,24 +148,33 @@ async function cmdWhoami() {
148
148
  console.log(`Signed in via ${cfg.oauth ? 'OAuth (browser sign-in)' : 'API key'} to ${baseUrl(cfg)}`);
149
149
  if (sub?.tier)
150
150
  console.log(`Plan: ${sub.tier}`);
151
- const u = sub?.usage ?? sub;
152
- if (u?.aiCredits !== undefined || u?.aiCreditsUsed !== undefined) {
153
- console.log(`AI credits used: ${u.aiCreditsUsed ?? '?'} / ${u.aiCredits ?? u.aiCreditsIncluded ?? '?'}`);
154
- }
155
- if (u?.cloudBrowserMinutes !== undefined)
156
- console.log(`Cloud browser minutes used: ${u.cloudBrowserMinutes}`);
151
+ // GET /api/v1/subscription → { tier, balances: { aiCredits: { remaining, included }, … }, topUpBalances }
152
+ const b = sub?.balances ?? {};
153
+ const top = sub?.topUpBalances ?? {};
154
+ const line = (label, k) => {
155
+ if (!b[k])
156
+ return;
157
+ const extra = top[k] ? ` (+${top[k]} top-up)` : '';
158
+ console.log(`${label}: ${b[k].remaining} of ${b[k].included} left${extra}`);
159
+ };
160
+ line('AI credits', 'aiCredits');
161
+ line('Cloud browser minutes', 'cloudBrowserMinutes');
162
+ line('Connect Hub calls', 'connectHubCalls');
163
+ line('Workflow runs this month', 'monthlyExecutions');
157
164
  console.log(`Cloud-browser key: ${cfg.cloudBrowserKey ? 'saved' : 'not set (needed for `prompteryx browser`)'}`);
158
165
  });
159
166
  }
160
167
  async function cmdAgent(args) {
161
168
  const goal = args.positional.slice(1).join(' ').trim();
162
169
  if (!goal)
163
- throw new UsageError('Usage: prompteryx agent "what you want done" [--start-url URL] [--max-steps N] [--save-as-workflow] [--local]');
170
+ throw new UsageError('Usage: prompteryx agent "what you want done" [--start-url URL] [--model ID] [--max-steps N] [--max-credits N] [--save-as-workflow] [--local]');
164
171
  const px = await client();
165
172
  console.error(`Running the AI browser agent${bool(args.flags.local) ? ' on your local Chrome' : ' in a cloud browser'}…`);
166
173
  const result = await px.autopilot.run({
167
174
  goal,
168
175
  startUrl: str(args.flags['start-url']),
176
+ // Catalog: AUTOPILOT_MODELS in @prompteryx/sdk (default gemini-3.5-flash).
177
+ model: str(args.flags.model),
169
178
  maxSteps: num(args.flags['max-steps']),
170
179
  maxCredits: num(args.flags['max-credits']),
171
180
  saveAsWorkflow: bool(args.flags['save-as-workflow']),
@@ -203,7 +212,7 @@ async function cmdWorkflows(args) {
203
212
  const execution = bool(args.flags.visible) ? { runMode: 'visible' } : undefined;
204
213
  if (bool(args.flags.wait)) {
205
214
  console.error('Running and waiting for the result…');
206
- const rec = await px.workflows.runAndWait(id, { input, execution, timeoutMs: (num(args.flags.timeout) ?? 300) * 1000 });
215
+ const rec = await px.workflows.runAndWait(id, { input, execution, webhookUrl: str(args.flags['webhook-url']), timeoutMs: (num(args.flags.timeout) ?? 300) * 1000 });
207
216
  print(rec, () => {
208
217
  console.log(`${rec.status} (${rec.durationMs != null ? `${Math.round(rec.durationMs / 1000)}s` : ''}) run ${rec.id}`);
209
218
  if (rec.error)
@@ -213,7 +222,7 @@ async function cmdWorkflows(args) {
213
222
  });
214
223
  return;
215
224
  }
216
- const started = await px.workflows.run(id, { input, execution });
225
+ const started = await px.workflows.run(id, { input, execution, webhookUrl: str(args.flags['webhook-url']) });
217
226
  print(started, () => console.log(`Started run ${started.executionId} (${started.status}). Follow it with: prompteryx runs wait ${started.executionId}`));
218
227
  return;
219
228
  }
@@ -368,19 +377,19 @@ function cmdMcp(args) {
368
377
  }
369
378
  }
370
379
  function help() {
371
- console.log(`prompteryx ${VERSION} — Prompteryx from your terminal
372
-
373
- login [--key px_live_…] [--cloud-browser-key pcb_live_…] sign in (browser) or save keys
374
- whoami | logout
375
- agent "goal" [--start-url URL] [--max-steps N] [--save-as-workflow] [--local]
376
- workflows list | get <id> | run <id> [--input k=v …] [--wait] [--visible]
377
- runs get <id> | wait <id> | logs <id>
378
- browser create [--record] [--local] | list | close <id>
379
- schedules list [--workflow <id>]
380
- apps list [--search q] | actions <app> | accounts | run <app> <action> --params '{…}'
381
- mcp <claude-code|cursor|vscode|claude-desktop|http> print the config for an AI client
382
-
383
- --json on any command prints raw JSON. PROMPTERYX_API_KEY / PROMPTERYX_API_URL override the saved config.
380
+ console.log(`prompteryx ${VERSION} — Prompteryx from your terminal
381
+
382
+ login [--key px_live_…] [--cloud-browser-key pcb_live_…] sign in (browser) or save keys
383
+ whoami | logout
384
+ agent "goal" [--start-url URL] [--model ID] [--max-steps N] [--max-credits N] [--save-as-workflow] [--local]
385
+ workflows list [--search q] | get <id> | run <id> [--input k=v …] [--wait] [--visible] [--webhook-url URL]
386
+ runs get <id> | wait <id> | logs <id>
387
+ browser create [--record] [--local] | list | close <id>
388
+ schedules list [--workflow <id>]
389
+ apps list [--search q] | actions <app> | accounts | run <app> <action> --params '{…}'
390
+ mcp <claude-code|cursor|vscode|claude-desktop|http> print the config for an AI client
391
+
392
+ --json on any command prints raw JSON. PROMPTERYX_API_KEY / PROMPTERYX_API_URL override the saved config.
384
393
  Docs: https://www.prompteryx.ai/docs/developers/cli`);
385
394
  }
386
395
  // ── main ─────────────────────────────────────────────────────────────────────
@@ -420,6 +429,10 @@ main().catch((err) => {
420
429
  console.error(`Not authorised: ${err.message}\nRun \`prompteryx login\` again.`);
421
430
  else if (name === 'QuotaError')
422
431
  console.error(`Plan limit: ${err.message}`);
432
+ else if (name === 'RateLimitError') {
433
+ const wait = err.retryAfterSeconds ? ` Try again in ${err.retryAfterSeconds}s.` : '';
434
+ console.error(err.code === 'RATE_LIMIT_EXCEEDED' ? `Too many requests for this key.${wait}` : `Limit reached: ${err.message}.${wait}`);
435
+ }
423
436
  else
424
437
  console.error(err?.message || err);
425
438
  process.exit(1);
package/package.json CHANGED
@@ -1,40 +1,41 @@
1
- {
2
- "name": "prompteryx",
3
- "version": "0.1.0",
4
- "description": "Prompteryx command line: run AI browser agents, cloud browsers, workflows and Connect Hub actions from your terminal.",
5
- "author": "Prompteryx <support@prompteryx.ai>",
6
- "license": "MIT",
7
- "type": "module",
8
- "bin": {
9
- "prompteryx": "dist/index.js"
10
- },
11
- "files": [
12
- "dist",
13
- "README.md"
14
- ],
15
- "engines": {
16
- "node": ">=18"
17
- },
18
- "scripts": {
19
- "build": "tsc -p tsconfig.json",
20
- "prepublishOnly": "npm run build"
21
- },
22
- "keywords": [
23
- "prompteryx",
24
- "cli",
25
- "browser-automation",
26
- "ai-agent",
27
- "workflow",
28
- "mcp"
29
- ],
30
- "dependencies": {
31
- "@prompteryx/sdk": "^0.4.2"
32
- },
33
- "devDependencies": {
34
- "@types/node": "^20.11.0",
35
- "typescript": "^5.4.0"
36
- },
37
- "publishConfig": {
38
- "access": "public"
39
- }
40
- }
1
+ {
2
+ "name": "prompteryx",
3
+ "version": "0.2.0",
4
+ "description": "Prompteryx command line: run AI browser agents, cloud browsers, workflows and Connect Hub actions from your terminal.",
5
+ "author": "Prompteryx <support@prompteryx.ai>",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "bin": {
9
+ "prompteryx": "dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "CHANGELOG.md"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "keywords": [
24
+ "prompteryx",
25
+ "cli",
26
+ "browser-automation",
27
+ "ai-agent",
28
+ "workflow",
29
+ "mcp"
30
+ ],
31
+ "dependencies": {
32
+ "@prompteryx/sdk": "^0.5.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^20.11.0",
36
+ "typescript": "^5.4.0"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ }
41
+ }