@openbat/cli 0.2.2 → 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.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # @openbat/cli
2
2
 
3
3
  Command-line tool for managing OpenBat chatbots end-to-end — read
4
- analytics + conversations, manage settings + keys + webhooks + workflows
4
+ analytics + conversations, pull daily eval digests (`review`), manage the
5
+ live system prompt (`prompts`), manage settings + keys + webhooks + workflows
5
6
  + reports, run experiments, and help install the SDK in a target app.
7
+ All commands operate on one **pinned chatbot** (`openbat use <id>`).
6
8
 
7
9
  > **Companion docs**: [`@openbat/mcp`](../mcp/README.md) (same surface
8
10
  > over MCP), [`lib/openbat-tools/`](../../lib/openbat-tools/README.md)
@@ -63,6 +65,25 @@ rejects it with a helpful error.
63
65
 
64
66
  ---
65
67
 
68
+ ## Pin to one chatbot (active-chatbot scope)
69
+
70
+ `ob_read_*` / `ob_admin_*` keys are already scoped to one chatbot server-side.
71
+ A `ob_pat_*` reaches many — pin one so every command stays on it:
72
+
73
+ ```bash
74
+ openbat use <id|name> # persists ~/.openbatrc.activeChatbotId
75
+ openbat use # no arg → shows the current pin + reachable options
76
+ ```
77
+
78
+ Once pinned, every data command (`conversations`, `analytics`, `review`,
79
+ `prompts`, …) targets that chatbot and prints a `→ chatbot: <name> (<id>)`
80
+ banner to **stderr** so scope is never in doubt (and `--json | jq` stays
81
+ clean). Active-chatbot resolution order: `--chatbot <id|name>` flag →
82
+ `$OPENBAT_CHATBOT_ID` → `~/.openbatrc`. The MCP server reads the same pin and
83
+ **hard-locks** to it (see [`@openbat/mcp`](../mcp/README.md)).
84
+
85
+ ---
86
+
66
87
  ## Command tree
67
88
 
68
89
  ```
@@ -70,7 +91,13 @@ openbat
70
91
  ├── config
71
92
  │ ├── set-key Store / replace the key in ~/.openbatrc
72
93
  │ ├── set-url <baseUrl> Override the API base URL
73
- └── show Print the resolved config (key prefix only)
94
+ ├── show Print the resolved config (key prefix + active chatbot)
95
+ │ ├── use-chatbot <id|name> Pin the active chatbot (persists to ~/.openbatrc)
96
+ │ └── clear-chatbot Forget the pinned chatbot
97
+
98
+ ├── use [id|name] [any kind]
99
+ │ └── Pin the active chatbot (shortcut for `config use-chatbot`).
100
+ │ Omit the arg to print the current pin + the reachable list.
74
101
 
75
102
  ├── auth [any kind]
76
103
  │ ├── whoami Show kind, chatbots in scope, orgs (PAT only)
@@ -96,7 +123,11 @@ openbat
96
123
 
97
124
  ├── conversations [any kind]
98
125
  │ ├── list [--days N] [--from ISO] [--to ISO] [--limit N]
99
- │ └── show <id>
126
+ │ └── show <id> Messages + ALL analyses (issues/outcomes/flags/intents + reasoning)
127
+
128
+ ├── review [--since 45m|6h|7d] [any kind]
129
+ │ └── Daily eval digest: outcome/sentiment deltas + top issues/flags/intents
130
+ │ with representative conversation pointers. Default window 24h.
100
131
 
101
132
  ├── users [any kind]
102
133
  │ └── list --chatbot ID [--days] [--search] External users + health
@@ -124,6 +155,12 @@ openbat
124
155
  │ ├── list --chatbot ID
125
156
  │ └── create --chatbot ID [--name "..."] Returns org-private dashboard URL
126
157
 
158
+ ├── prompts manage the LIVE published prompt
159
+ │ ├── list [any kind] versions + active + kill-switch
160
+ │ ├── publish --file PATH | --text "..." [admin/pat] create a version + set it LIVE
161
+ │ ├── activate <versionId> [admin/pat] roll back/forward to a version
162
+ │ └── kill-switch --on | --off [admin/pat] emergency fallback toggle
163
+
127
164
  ├── analysis [admin or pat]
128
165
  │ ├── list --chatbot ID [--type] [--pending]
129
166
  │ └── add --chatbot ID --type intent|flag|assistant_outcome|assistant_issue
@@ -272,6 +309,9 @@ Per-tool buckets keyed by credential. The strict ones to know about:
272
309
  | Create backtest | 10 per hour per PAT |
273
310
  | Invite org member | 20 per hour per PAT |
274
311
  | Chat with an AI report | 30 per minute per credential |
312
+ | Daily review digest (`review`) | 30 per minute per credential |
313
+ | Publish prompt | 20 per hour per credential |
314
+ | Activate prompt / toggle kill switch | 30 per hour per credential |
275
315
  | Generic write | 60 per minute per credential |
276
316
  | Generic read | 600 per minute per credential |
277
317
  | Export | 30 per hour per credential |
@@ -290,11 +330,12 @@ install the OpenBat agent skill bundle:
290
330
  npx skills add openbat-dev/agent-skills
291
331
  ```
292
332
 
293
- Drops 8 `SKILL.md` files into your project's `.claude/skills/` (or the
333
+ Drops the `SKILL.md` bundle into your project's `.claude/skills/` (or the
294
334
  equivalent for Cursor / Copilot / Gemini CLI / Codex / OpenCode / Amp).
295
335
  The bundle covers chatbot onboarding, key management, webhooks,
296
- workflows, AI reports, SDK install, and safety patterns — written
297
- specifically for the four-kind auth ladder this CLI exposes.
336
+ workflows, AI reports, SDK install, the daily eval→fix loop
337
+ (`openbat-optimize`), and safety patterns written specifically for the
338
+ four-kind auth ladder this CLI exposes.
298
339
 
299
340
  Source + docs: https://github.com/openbat-dev/agent-skills.
300
341
 
@@ -32,7 +32,7 @@ __export(api_client_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(api_client_exports);
34
34
  var import_node_url = require("url");
35
- var CLI_VERSION = "0.2.2";
35
+ var CLI_VERSION = "0.3.0";
36
36
  var KEY_REGEX = /ob_(?:live|read|admin|pat)_[0-9a-f]{32}/g;
37
37
  function redact(s) {
38
38
  return s.replace(KEY_REGEX, (k) => `${k.slice(0, 16)}\u2026<hidden>`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ApiClient
3
- } from "./chunk-MCDJLQI2.mjs";
3
+ } from "./chunk-KIY62R3O.mjs";
4
4
  export {
5
5
  ApiClient
6
6
  };
@@ -9,7 +9,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
9
9
 
10
10
  // src/api-client.ts
11
11
  import { URL } from "url";
12
- var CLI_VERSION = "0.2.2";
12
+ var CLI_VERSION = "0.3.0";
13
13
  var KEY_REGEX = /ob_(?:live|read|admin|pat)_[0-9a-f]{32}/g;
14
14
  function redact(s) {
15
15
  return s.replace(KEY_REGEX, (k) => `${k.slice(0, 16)}\u2026<hidden>`);