Skip to content

Commit a45da32

Browse files
feat: add BotsChat CLI with browser login and E2E encryption
- New packages/cli/ — full CLI client (chat, channels, sessions, tasks, jobs, models, tokens, messages, config, status, setup) - Browser-based login: CLI starts local HTTP server, opens browser for OAuth (Google/GitHub/Apple), receives credentials via redirect callback - E2E encryption: encrypt/decrypt messages, job summaries, task data - WebSocket chat: single-shot, interactive REPL, streaming, pipe mode - Bundle CLI into plugin package as bin/botschat-cli.mjs (tsup, 52KB) - Add SKILL.md for OpenClaw skill support (npx skills add) - Web: handle cli_port/cli_state params for CLI login callback - Web: show success banner on cli_done redirect - README: add CLI section with npx usage examples - E2E test: CDP-based browser login test (tests/cli-login-e2e.mjs)
1 parent d23562d commit a45da32

31 files changed

Lines changed: 5719 additions & 99 deletions

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,72 @@ Open the BotsChat web UI in your browser, sign in, and start chatting with your
253253
4. Your API keys, agent configs, and data never leave your machine — only chat messages travel through the relay.
254254
5. With **E2E encryption** enabled, messages are encrypted **before** step 3 and decrypted **after** — the ConnectionDO and database only ever see ciphertext.
255255

256+
## CLI
257+
258+
BotsChat includes a command-line client with full E2E encryption support. No install needed — use `npx`:
259+
260+
```bash
261+
npx @botschat/botschat login # Login via browser (Google/GitHub/Apple)
262+
npx @botschat/botschat chat "Hello" # Send a message
263+
npx @botschat/botschat chat -i # Interactive chat
264+
```
265+
266+
Or install globally for shorter commands:
267+
268+
```bash
269+
npm i -g @botschat/botschat
270+
botschat login
271+
botschat chat "Hello"
272+
```
273+
274+
### Login
275+
276+
```bash
277+
npx @botschat/botschat login # Browser OAuth (recommended)
278+
npx @botschat/botschat --url http://localhost:8787 login --dev --secret <secret> # Local dev
279+
```
280+
281+
Running `login` opens your browser, you sign in normally, and credentials are saved to `~/.botschat/config.json`.
282+
283+
### Chat
284+
285+
```bash
286+
npx @botschat/botschat chat "What can you do?" # Single-shot
287+
npx @botschat/botschat chat -i # Interactive REPL
288+
echo "Summarize this log" | npx @botschat/botschat chat --pipe # Pipe from stdin
289+
npx @botschat/botschat --json chat "Hello" # JSON output
290+
```
291+
292+
### Management
293+
294+
```bash
295+
npx @botschat/botschat whoami # Current user info
296+
npx @botschat/botschat channels # List channels
297+
npx @botschat/botschat sessions <channelId> # List sessions
298+
npx @botschat/botschat models # List available models
299+
npx @botschat/botschat models set <modelId> # Set default model
300+
npx @botschat/botschat tasks # List background tasks
301+
npx @botschat/botschat tasks run <channelId> <taskId> # Run a task now
302+
npx @botschat/botschat jobs <taskId> # Job execution history
303+
npx @botschat/botschat messages <sessionKey> # Message history
304+
npx @botschat/botschat tokens # Manage pairing tokens
305+
npx @botschat/botschat status # OpenClaw connection status
306+
npx @botschat/botschat config # View config
307+
npx @botschat/botschat config e2e --password <pwd> # Set E2E encryption password
308+
```
309+
310+
### OpenClaw Skill
311+
312+
Use the CLI as an [OpenClaw skill](https://openclawai.com/docs/skills) — your agent can interact with BotsChat directly:
313+
314+
```bash
315+
npx skills add @botschat/botschat
316+
```
317+
318+
This registers `/botschat` as a skill in OpenClaw, providing commands like `botschat chat`, `botschat channels`, `botschat status`, etc.
319+
320+
---
321+
256322
## Plugin Reference
257323

258324
### Configuration

0 commit comments

Comments
 (0)