mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
* ✨ feat: add cross-platform message tool for AI bot channel operations Implement a unified message tool (`lobe-message`) that provides AI with messaging capabilities across Discord, Telegram, Slack, Google Chat, and IRC through a single interface with platform-specific extensions. Core APIs: sendMessage, readMessages, editMessage, deleteMessage, searchMessages, reactToMessage, getReactions, pin/unpin management, channel/member info, thread operations, and polls. Architecture follows the established builtin-tool pattern: - Package: @lobechat/builtin-tool-message (manifest, types, executor, ExecutionRuntime, client components) - Registry: registered in builtin-tools (renders, inspectors, interventions, streamings) - Server runtime: stub service ready for platform adapter integration https://claude.ai/code/session_011sHc6R7V4cSYKere9RY1QM * feat: implement platform specific message service * chore: add wechat platform * chore: update wechat api service * chore: update protocol implementation * chore: optimize platform api test * fix: lark domain error * feat: support bot message cli * chore: refactor adapter to service * chore: optimize bot status fetch * fix: bot status * fix: channel nav ignore * feat: message tool support bot manage * feat: add lobe-message runtime * feat: support direct message * feat: add history limit * chore: update const limit * feat: optimize server id message history limit * chore: optimize system role & inject platform environment info * chore: update readMessages vibe * fix: form body width 50% * chore: optimize tool prompt * chore: update i18n files * chore: optimize read message system role and update bot message lh * updage readMessage api rate limit * chore: comatible for readMessages * fix: feishu readMessage implementation error * fix: test case * chore: update i18n files * fix: lint error * chore: add timeout for conversaction case * fix: message test case * fix: vite gzip error --------- Co-authored-by: Claude <noreply@anthropic.com>
55 lines
2.3 KiB
Markdown
55 lines
2.3 KiB
Markdown
# @lobehub/cli
|
|
|
|
LobeHub command-line interface.
|
|
|
|
## Local Development
|
|
|
|
| Task | Command |
|
|
| ------------------------------------------ | -------------------------- |
|
|
| Run in dev mode | `bun run dev -- <command>` |
|
|
| Build the CLI | `bun run build` |
|
|
| Link `lh`/`lobe`/`lobehub` into your shell | `bun run cli:link` |
|
|
| Remove the global link | `bun run cli:unlink` |
|
|
|
|
- `bun run build` only generates `dist/index.js`.
|
|
- To make `lh` available in your shell, run `bun run cli:link`.
|
|
- After linking, if your shell still cannot find `lh`, run `rehash` in `zsh`.
|
|
|
|
## Custom Server URL
|
|
|
|
By default the CLI connects to `https://app.lobehub.com`. To point it at a different server (e.g. a local instance):
|
|
|
|
| Method | Command | Persistence |
|
|
| -------------------- | --------------------------------------------------------------- | ----------------------------------- |
|
|
| Environment variable | `LOBEHUB_SERVER=http://localhost:4000 bun run dev -- <command>` | Current command only |
|
|
| Login flag | `lh login --server http://localhost:4000` | Saved to `~/.lobehub/settings.json` |
|
|
|
|
Priority: `LOBEHUB_SERVER` env var > `settings.json` > default official URL.
|
|
|
|
## Shell Completion
|
|
|
|
### Install completion for a linked CLI
|
|
|
|
| Shell | Command |
|
|
| ------ | ------------------------------ |
|
|
| `zsh` | `source <(lh completion zsh)` |
|
|
| `bash` | `source <(lh completion bash)` |
|
|
|
|
### Use completion during local development
|
|
|
|
| Shell | Command |
|
|
| ------ | -------------------------------------------- |
|
|
| `zsh` | `source <(bun src/index.ts completion zsh)` |
|
|
| `bash` | `source <(bun src/index.ts completion bash)` |
|
|
|
|
- Completion is context-aware. For example, `lh agent <Tab>` shows agent subcommands instead of top-level commands.
|
|
- If you update completion logic locally, re-run the corresponding `source <(...)` command to reload it in the current shell session.
|
|
- Completion only registers shell functions. It does not install the `lh` binary by itself.
|
|
|
|
## Quick Check
|
|
|
|
```bash
|
|
which lh
|
|
lh --help
|
|
lh agent <TAB>
|
|
```
|