Skip to content

Commit 918f1d9

Browse files
committed
Docs: gateway-first quick start, web + channels as primary interface
- Restructure Quick Start: gateway -> engine choice -> channels -> CLI - Lead with web dashboard and IM channels as primary interaction - Position CLI as power user / automation option - Reorder features: web dashboard and channels first - Rewrite use cases: web and multi-channel scenarios first - Add three-mode comparison table (Web + Channels + CLI)
1 parent 98a6bb4 commit 918f1d9

2 files changed

Lines changed: 144 additions & 64 deletions

File tree

README.md

Lines changed: 72 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,64 @@ cd bashclaw && ./bashclaw doctor
4646

4747
## Quick Start
4848

49-
### Recommended: Claude Code CLI Engine
49+
### 1. Start the Gateway
5050

51-
If you have a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) subscription (Pro/Max/Team/Enterprise), BashClaw can use it directly as its backend -- no API keys, no per-token cost:
51+
```sh
52+
bashclaw gateway
53+
```
54+
55+
Open `http://localhost:18789` in your browser. If no API key is configured, a first-run setup overlay guides you through it.
56+
57+
### 2. Choose an Engine
58+
59+
<table>
60+
<tr><th>Claude Code CLI (Recommended)</th><th>Builtin (Direct API)</th></tr>
61+
<tr>
62+
<td>
63+
64+
Reuses your Claude subscription -- no API keys, no per-token cost.
5265

5366
```sh
54-
bashclaw config set '.agents.defaults.engine' '"claude"'
67+
bashclaw config set \
68+
'.agents.defaults.engine' '"claude"'
69+
```
5570

56-
bashclaw agent -m "What is the mass of the sun?" # one-shot
57-
bashclaw agent -i # interactive REPL
71+
Requires: [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated.
72+
73+
</td>
74+
<td>
75+
76+
Calls LLM APIs directly via curl. Supports 18 providers.
77+
78+
```sh
79+
export ANTHROPIC_API_KEY="sk-ant-..."
80+
# or set via web dashboard
5881
```
5982

60-
This delegates all reasoning and tool execution to the `claude` CLI, reusing your existing subscription.
83+
</td>
84+
</tr>
85+
</table>
6186

62-
### Alternative: Builtin Engine with API Keys
87+
### 3. Connect Channels (Optional)
6388

64-
For other providers or if you prefer direct API access:
89+
Add always-on messaging through Telegram, Discord, Slack, or Feishu. Channels auto-start with the gateway:
6590

6691
```sh
67-
export ANTHROPIC_API_KEY="sk-ant-..." # or OPENAI_API_KEY, GOOGLE_API_KEY, etc.
92+
# Example: Telegram
93+
bashclaw config set '.channels.telegram.botToken' '"BOT_TOKEN"'
94+
bashclaw config set '.channels.telegram.enabled' 'true'
95+
bashclaw gateway # web + Telegram both active
96+
```
97+
98+
See [Channels](#channels) for all platforms.
99+
100+
### 4. CLI Mode (Power Users)
101+
102+
For scripting, automation, or SSH sessions:
68103

104+
```sh
69105
bashclaw agent -m "What is the mass of the sun?" # one-shot
70106
bashclaw agent -i # interactive REPL
71-
bashclaw onboard # guided setup wizard
72-
bashclaw gateway # web dashboard + channels
73107
```
74108

75109
## Why BashClaw
@@ -106,12 +140,11 @@ BashClaw targets Bash 3.2 deliberately: no `declare -A`, no `mapfile`, no `|&`.
106140

107141
## Features
108142

109-
- **Pure shell** -- Zero dependencies beyond bash 3.2, curl, jq. Already on your machine.
110-
- **Self-modifying** -- Agent hot-patches its own source at runtime. No compilation step.
143+
- **Web dashboard** -- Built-in browser UI for chat, config, and monitoring. First-run setup wizard. No external tools.
144+
- **Multi-channel** -- Telegram, Discord, Slack, Feishu/Lark. Each channel is one shell script. Auto-starts with gateway.
111145
- **Dual engine** -- Claude Code CLI (reuses subscription) or builtin (direct API via curl). Per-agent configurable.
112146
- **Multi-provider** -- 18 providers: Claude, GPT, Gemini, DeepSeek, Qwen, Zhipu, Moonshot, MiniMax, Groq, xAI, Mistral, Ollama, vLLM, and more.
113-
- **Multi-channel** -- Telegram, Discord, Slack, Feishu/Lark. Each channel is one shell script.
114-
- **Web dashboard** -- Built-in browser UI for chat, config, and monitoring. No external tools.
147+
- **Pure shell** -- Zero dependencies beyond bash 3.2, curl, jq. Already on your machine.
115148
- **14 built-in tools** -- Web fetch, search, shell exec, memory, cron, file I/O, inter-agent messaging.
116149
- **Plugin system** -- 4 discovery paths. Register tools, hooks, commands, providers.
117150
- **8-layer security** -- SSRF protection, command filters, pairing codes, rate limiting, RBAC, audit.
@@ -153,14 +186,15 @@ bashclaw gateway
153186
**Logs** -- Live log viewer with level filtering.
154187
**First-run** -- If no API key is set, shows a setup overlay on first visit.
155188

156-
### Web + CLI Dual Mode
189+
### Web + Channels + CLI
157190

158-
Both modes share the same config, sessions, and state. Changes in the dashboard take effect in CLI immediately, and vice versa.
191+
All three modes share the same config, sessions, and state. Changes in one take effect in the others immediately.
159192

160193
| Mode | Best For | Command |
161194
|------|----------|---------|
162-
| Web | First-time setup, visual config, casual chat | `bashclaw gateway` |
163-
| CLI | Automation, scripting, SSH, power users | `bashclaw agent -i` |
195+
| Web | First-time setup, visual config, casual chat | `bashclaw gateway` then open browser |
196+
| Channels | Always-on team bot, mobile access | `bashclaw gateway` with channels enabled |
197+
| CLI | Automation, scripting, SSH, CI/CD | `bashclaw agent -m "..."` or `bashclaw agent -i` |
164198

165199
### REST API
166200

@@ -780,19 +814,29 @@ Config file: `~/.bashclaw/bashclaw.json`
780814

781815
## Use Cases
782816

783-
**Personal assistant on a Mac**
817+
**Web dashboard on a Mac**
784818
```sh
785-
export ANTHROPIC_API_KEY="sk-ant-..."
786-
bashclaw agent -i
787-
# No Python, no Node, no Docker. Just works.
819+
bashclaw gateway
820+
# Open http://localhost:18789 -- first-run wizard configures API keys
821+
# Chat with the agent in your browser immediately
822+
```
823+
824+
**Multi-channel team bot**
825+
```sh
826+
# One agent, multiple channels -- all served by a single gateway
827+
bashclaw config set '.channels.telegram.enabled' 'true'
828+
bashclaw config set '.channels.discord.enabled' 'true'
829+
bashclaw config set '.channels.slack.enabled' 'true'
830+
bashclaw gateway
831+
# Messages from all platforms routed to the same agent
788832
```
789833

790-
**Headless server agent**
834+
**Always-on server agent**
791835
```sh
792836
# Install on a fresh Ubuntu server
793837
curl -fsSL .../install.sh | bash
794838
bashclaw daemon install --enable
795-
# Agent runs 24/7, accessible via Telegram or web dashboard
839+
# Agent runs 24/7, accessible via Telegram, Discord, Slack, or web dashboard
796840
```
797841

798842
**CI/CD pipeline agent**
@@ -801,14 +845,10 @@ bashclaw daemon install --enable
801845
bashclaw agent -m "Review this diff and suggest improvements" < diff.patch
802846
```
803847

804-
**Multi-channel team bot**
848+
**SSH / headless CLI**
805849
```sh
806-
# One agent, multiple channels
807-
bashclaw config set '.channels.telegram.enabled' 'true'
808-
bashclaw config set '.channels.discord.enabled' 'true'
809-
bashclaw config set '.channels.slack.enabled' 'true'
810-
bashclaw gateway
811-
# Messages from all platforms routed to the same agent
850+
bashclaw agent -i
851+
# Interactive REPL for power users. No browser needed.
812852
```
813853

814854
## Testing

README_CN.md

Lines changed: 72 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,64 @@ cd bashclaw && ./bashclaw doctor
4646

4747
## 快速开始
4848

49-
### 推荐: Claude Code CLI 引擎
49+
### 1. 启动 Gateway
5050

51-
如果你有 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 订阅 (Pro/Max/Team/Enterprise),BashClaw 可以直接使用它作为后端 -- 无需 API 密钥,无按量付费:
51+
```sh
52+
bashclaw gateway
53+
```
54+
55+
在浏览器中打开 `http://localhost:18789`。如果尚未配置 API 密钥,首次访问会显示引导式配置界面。
56+
57+
### 2. 选择引擎
58+
59+
<table>
60+
<tr><th>Claude Code CLI (推荐)</th><th>Builtin (直接调用 API)</th></tr>
61+
<tr>
62+
<td>
63+
64+
复用你的 Claude 订阅 -- 无需 API 密钥,无按量付费。
5265

5366
```sh
54-
bashclaw config set '.agents.defaults.engine' '"claude"'
67+
bashclaw config set \
68+
'.agents.defaults.engine' '"claude"'
69+
```
5570

56-
bashclaw agent -m "太阳的质量是多少?" # 单次问答
57-
bashclaw agent -i # 交互式 REPL
71+
前置要求: 已安装 [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) 并完成认证。
72+
73+
</td>
74+
<td>
75+
76+
通过 curl 直接调用 LLM API。支持 18 个提供者。
77+
78+
```sh
79+
export ANTHROPIC_API_KEY="sk-ant-..."
80+
# 或通过 Web 控制台设置
5881
```
5982

60-
这会将所有推理和工具执行委托给 `claude` CLI,复用你现有的订阅额度。
83+
</td>
84+
</tr>
85+
</table>
6186

62-
### 备选: Builtin 引擎 + API 密钥
87+
### 3. 接入消息频道 (可选)
6388

64-
使用其他提供者或偏好直接 API 访问时:
89+
通过 Telegram、Discord、Slack 或飞书接入始终在线的消息服务。频道随 Gateway 自动启动:
6590

6691
```sh
67-
export ANTHROPIC_API_KEY="sk-ant-..." # 或 OPENAI_API_KEY, GOOGLE_API_KEY 等
92+
# 示例: Telegram
93+
bashclaw config set '.channels.telegram.botToken' '"BOT_TOKEN"'
94+
bashclaw config set '.channels.telegram.enabled' 'true'
95+
bashclaw gateway # Web 控制台 + Telegram 同时运行
96+
```
97+
98+
详见[消息频道](#消息频道)章节。
99+
100+
### 4. CLI 模式 (高级用户)
101+
102+
用于脚本、自动化或 SSH 会话:
68103

104+
```sh
69105
bashclaw agent -m "太阳的质量是多少?" # 单次问答
70106
bashclaw agent -i # 交互式 REPL
71-
bashclaw onboard # 引导式安装向导
72-
bashclaw gateway # Web 控制台 + 频道
73107
```
74108

75109
## 为什么选 BashClaw
@@ -106,12 +140,11 @@ BashClaw 刻意以 Bash 3.2 为目标: 不用 `declare -A`、不用 `mapfile`、
106140

107141
## 特性
108142

109-
- **纯 Shell** -- 仅依赖 bash 3.2, curl, jq。你的机器上已经有了
110-
- **自修改** -- 智能体在运行时热修改自身源代码。无编译步骤
143+
- **Web 控制台** -- 内置浏览器界面,用于聊天、配置和监控。首次引导向导。无需外部工具
144+
- **多频道** -- Telegram, Discord, Slack, 飞书/Lark。每个频道是一个 Shell 脚本。随 Gateway 自动启动
111145
- **双引擎** -- Claude Code CLI (复用订阅) 或 builtin (curl 直接调用 API)。按智能体独立配置。
112146
- **多提供者** -- 18 个提供者: Claude, GPT, Gemini, DeepSeek, 通义千问, 智谱, Moonshot, MiniMax, Groq, xAI, Mistral, Ollama, vLLM 等。
113-
- **多频道** -- Telegram, Discord, Slack, 飞书/Lark。每个频道是一个 Shell 脚本。
114-
- **Web 控制台** -- 内置浏览器界面,用于聊天、配置和监控。无需外部工具。
147+
- **纯 Shell** -- 仅依赖 bash 3.2, curl, jq。你的机器上已经有了。
115148
- **14 个内置工具** -- Web 抓取、搜索、Shell 执行、记忆、定时任务、文件 I/O、智能体间通信。
116149
- **插件系统** -- 4 个发现路径。可注册工具、钩子、命令、提供者。
117150
- **8 层安全模型** -- SSRF 防护、命令过滤、配对码、限流、RBAC、审计。
@@ -150,14 +183,15 @@ bashclaw gateway
150183
**状态** -- 网关状态、活跃会话、提供者信息。
151184
**首次引导** -- 如果没有配置 API 密钥,首次访问会显示配置引导。
152185

153-
### Web + CLI 双模式
186+
### Web + 频道 + CLI
154187

155-
两种模式共享相同的配置、会话和状态。控制台中的更改立即在 CLI 中生效,反之亦然
188+
三种模式共享相同的配置、会话和状态。任一模式中的更改立即在其他模式中生效
156189

157190
| 模式 | 适用场景 | 命令 |
158191
|------|----------|------|
159-
| Web | 首次配置、可视化管理、日常聊天 | `bashclaw gateway` |
160-
| CLI | 自动化、脚本、SSH 会话、高级用户 | `bashclaw agent -i` |
192+
| Web | 首次配置、可视化管理、日常聊天 | `bashclaw gateway` 然后打开浏览器 |
193+
| 频道 | 始终在线的团队机器人、移动端访问 | `bashclaw gateway` 并启用频道 |
194+
| CLI | 自动化、脚本、SSH、CI/CD | `bashclaw agent -m "..."``bashclaw agent -i` |
161195

162196
### REST API
163197

@@ -779,19 +813,29 @@ plugin_register_provider "my_llm" "My LLM" '["model-a"]' '{"envKey":"MY_KEY"}'
779813

780814
## 使用场景
781815

782-
**Mac 上的个人助手**
816+
**Mac 上的 Web 控制台**
783817
```sh
784-
export ANTHROPIC_API_KEY="sk-ant-..."
785-
bashclaw agent -i
786-
# 不需要 Python、Node、Docker。直接运行。
818+
bashclaw gateway
819+
# 打开 http://localhost:18789 -- 首次引导向导配置 API 密钥
820+
# 在浏览器中直接与智能体对话
821+
```
822+
823+
**多频道团队机器人**
824+
```sh
825+
# 一个智能体,多个频道 -- 由同一个 Gateway 提供服务
826+
bashclaw config set '.channels.telegram.enabled' 'true'
827+
bashclaw config set '.channels.discord.enabled' 'true'
828+
bashclaw config set '.channels.slack.enabled' 'true'
829+
bashclaw gateway
830+
# 所有平台的消息路由到同一个智能体
787831
```
788832

789-
**无头服务器智能体**
833+
**始终在线的服务器智能体**
790834
```sh
791835
# 在全新 Ubuntu 服务器上安装
792836
curl -fsSL .../install.sh | bash
793837
bashclaw daemon install --enable
794-
# 智能体 7x24 运行,通过 Telegram 或 Web 控制台访问
838+
# 智能体 7x24 运行,通过 Telegram、Discord、Slack 或 Web 控制台访问
795839
```
796840

797841
**CI/CD 流水线智能体**
@@ -800,14 +844,10 @@ bashclaw daemon install --enable
800844
bashclaw agent -m "审查这个 diff 并提出改进建议" < diff.patch
801845
```
802846

803-
**多频道团队机器人**
847+
**SSH / 无头 CLI**
804848
```sh
805-
# 一个智能体,多个频道
806-
bashclaw config set '.channels.telegram.enabled' 'true'
807-
bashclaw config set '.channels.discord.enabled' 'true'
808-
bashclaw config set '.channels.slack.enabled' 'true'
809-
bashclaw gateway
810-
# 所有平台的消息路由到同一个智能体
849+
bashclaw agent -i
850+
# 高级用户的交互式 REPL。无需浏览器。
811851
```
812852

813853
## 测试

0 commit comments

Comments
 (0)