Skip to content

Commit 44df738

Browse files
committed
Update readme and installation instructions
1 parent 61a5659 commit 44df738

File tree

3 files changed

+21
-49
lines changed

3 files changed

+21
-49
lines changed

README.md

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,50 @@
1-
# CodeClaw
1+
# ClawCode
22

3-
Telegram interface for [OpenCode](https://opencode.ai), implemented as an OpenCode plugin.
3+
OpenCode plugin for exchange logging and workspace configuration (skills, agents, commands, tools).
44

55
## Prerequisites
66

77
- [OpenCode](https://opencode.ai) installed
88
- [Bun](https://bun.sh)
9-
- Telegram bot token from [@BotFather](https://t.me/BotFather)
10-
- Your Telegram user ID from [@userinfobot](https://t.me/userinfobot)
9+
- [qmd](https://github.com/qmd-project/qmd)
1110

1211
## Setup
1312

1413
```bash
1514
bun install
1615
```
1716

18-
Create `~/.config/opencode/clawcode.json`:
17+
Optionally create `~/.config/opencode/clawcode.json` to override the exchanges directory:
1918

2019
```json
2120
{
22-
"token": "your-bot-token",
23-
"allowedUsers": [123456789]
21+
"exchangesDir": "/custom/path/to/exchanges"
2422
}
2523
```
2624

27-
## Install
28-
29-
Symlink the plugin into your OpenCode workspace:
25+
Default: `$XDG_DATA_HOME/opencode/exchanges` (falls back to `~/.local/share/opencode/exchanges`).
3026

31-
```bash
32-
mkdir -p /path/to/workspace/.opencode/plugins
33-
ln -s /path/to/clawcode/src/main.ts /path/to/workspace/.opencode/plugins/clawcode.ts
34-
```
35-
36-
Or use the Makefile to install the systemd service, plugin, and `.opencode/` assets:
27+
## Install
3728

3829
```bash
39-
make install
30+
./install.sh install
4031
systemctl --user enable --now opencode-server.service
4132
```
4233

43-
The Telegram bot is **on-demand** by default. Use `/telegram connect` in the OpenCode TUI to start it. The systemd unit sets `TELEGRAM_AUTOCONNECT=1` to auto-start.
34+
This copies skills, agents, tools, and commands to `$OPENCODE_WORKSPACE/.opencode/`, symlinks the plugin, and installs the systemd service.
4435

4536
To remove:
4637

4738
```bash
48-
make uninstall
39+
./install.sh uninstall
4940
```
5041

51-
## Bot Commands
52-
53-
| Command | Description |
54-
|---|---|
55-
| `/new` | New session |
56-
| `/sessions` | List and switch sessions |
57-
| `/abort` | Abort current session |
58-
| `/history` | Recent messages from current session |
59-
| `/agent <name>` | Switch agent (omit name to list available) |
60-
| `/remember <text>` | Save a memory to MEMORY.md via OpenCode |
61-
| `/start_llama` | Start llama systemd service |
62-
| `/stop_llama` | Stop llama systemd service |
42+
## Exchange Logging
6343

64-
Send any text message to prompt OpenCode. Responses stream in real-time.
65-
Permission requests appear as inline keyboards.
44+
Every completed session exchange is automatically saved as qmd-compatible markdown to the exchanges directory. The plugin listens for `session.idle` events and captures the last user/assistant message pair.
6645

67-
## Memory System
46+
The install script sets up a qmd collection for semantic search. New exchanges are automatically indexed after each save.
6847

69-
Every exchange is automatically saved to `exchanges/` as qmd-compatible markdown.
70-
71-
- `/remember <text>` — tells OpenCode to append a memory to `MEMORY.md` in the workspace (always read on startup)
72-
- The `recall` skill lets the model search past exchanges via qmd on demand
73-
74-
### qmd Setup
75-
76-
After first run, create a qmd collection for the exchanges:
77-
78-
```bash
79-
qmd collection add /path/to/exchanges --name exchanges --mask "**/*.md"
80-
qmd embed
81-
```
48+
## Telegram Bridge
8249

83-
New exchanges are automatically indexed via `qmd update && qmd embed` after each save (if `qmd` is installed).
50+
For Telegram integration, see [opencode-telegram](https://github.com/TheEdgeOfRage/opencode-telegram).

install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ do_install() {
1818
mkdir -p "$OPENCODE_WORKSPACE/.opencode/plugins"
1919
ln -sf "$PWD/src/main.ts" "$OPENCODE_WORKSPACE/.opencode/plugins/clawcode.ts"
2020

21+
command -v qmd &>/dev/null || { echo "qmd is required but not installed" >&2; exit 1; }
22+
EXCHANGES_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/opencode/exchanges"
23+
mkdir -p "$EXCHANGES_DIR"
24+
qmd collection add "$EXCHANGES_DIR" --name exchanges --mask "**/*.md" 2>/dev/null || true
25+
qmd embed
26+
2127
mkdir -p "$SYSTEMD_DIR"
2228
sed "s|{{WORKDIR}}|$OPENCODE_WORKSPACE|g" "$SERVICE" > "$SYSTEMD_DIR/$SERVICE"
2329
systemctl --user daemon-reload

opencode/skills/recall/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ qmd embed
2525
- For broad recall: `qmd query 'question text' --collections exchanges` (auto-expand)
2626
3. Review the results and extract the relevant context.
2727
4. Present a concise summary of what was found, with key details from the past exchanges.
28-
5. If `qmd` is not available or the collection doesn't exist, fall back to grep. Find the exchanges directory by running `qmd collection list` or checking `exchangesDir` in `~/.config/opencode/clawcode.json`. Do NOT assume exchanges are in the skill's own directory — they are stored separately by the Telegram bridge plugin.
2928

3029
## Query Examples
3130

0 commit comments

Comments
 (0)