Integration
Obsidian Openclaw
Obsidian plugin for OpenClaw integration - chat with your AI assistant directly in your vault
Install
npm install
npm
Configuration Example
{
"gateway": {
"http": {
"endpoints": {
"chatCompletions": { "enabled": true }
}
}
}
}
README
# Obsidian OpenClaw
Chat with your [OpenClaw](https://openclaw.ai) AI assistant directly inside your Obsidian vault.


## Features
### 🦞 Sidebar Chat
- Full chat interface in Obsidian's right sidebar
- Send messages to your OpenClaw agent and receive real-time streaming responses
- Markdown rendering for code blocks, lists, and rich text
- Message history within session
### ⚡ Real-Time Streaming
- Server-Sent Events (SSE) streaming for live response updates
- Typing indicator while the agent is thinking
- Connection status display
### 📄 Context Awareness
- Automatically detects the active file in your editor
- Optionally sends the current file path with your messages
- Shares selected text as context so the agent knows what you're looking at
- The agent can read/write vault files via OpenClaw tools
### ⚙️ Configurable
- Gateway URL (default: `http://localhost:18789`)
- Gateway token for authentication
- Choose which agent to chat with
- Toggle context sharing (file path, selection)
- Toggle streaming on/off
## Setup
### Prerequisites
1. [OpenClaw](https://openclaw.ai) installed and running locally
2. Gateway started: `openclaw gateway start`
3. Chat Completions endpoint enabled in your `~/.openclaw/openclaw.json`:
```json
{
"gateway": {
"http": {
"endpoints": {
"chatCompletions": { "enabled": true }
}
}
}
}
```
### Install the Plugin
#### Manual Installation
1. Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/shawnohail/obsidian-openclaw/releases)
2. Create a folder `obsidian-openclaw` in your vault's `.obsidian/plugins/` directory
3. Copy the downloaded files into that folder
4. Enable the plugin in Obsidian Settings → Community Plugins
#### From Source
```bash
git clone https://github.com/shawnohail/obsidian-openclaw.git
cd obsidian-openclaw
npm install
npm run build
# Copy to your vault
cp main.js manifest.json /path/to/vault/.obsidian/plugins/obsidian-openclaw/
```
### Configure
1. Open Obsidian Settings → OpenClaw
2. Enter your Gateway URL (default: `http://localhost:18789`)
3. Enter your gateway token (`OPENCLAW_GATEWAY_TOKEN`)
4. Click **Test** to verify the connection
5. Click the 💬 icon in the ribbon (left sidebar) to open the chat
## Usage
- Click the chat bubble icon in the ribbon to open the OpenClaw chat panel
- Or use the command palette: **OpenClaw: Open chat**
- Type a message and press Enter (or click Send)
- The agent responds with streaming text, rendered as Markdown
- Open a file and select text — it will be included as context automatically
## Development
```bash
# Clone the repo
git clone https://github.com/shawnohail/obsidian-openclaw.git
cd obsidian-openclaw
# Install dependencies
npm install
# Build (watch mode)
npm run dev
# Production build
npm run build
```
### Architecture
```
src/
├── main.ts # Plugin entry point, commands, ribbon icon
├── chat-view.ts # Sidebar chat UI (ItemView)
├── gateway-client.ts # OpenClaw gateway HTTP client (SSE streaming)
├── settings-tab.ts # Plugin settings UI
└── types.ts # TypeScript interfaces
```
The plugin communicates with the OpenClaw gateway via its **OpenAI-compatible Chat Completions endpoint** (`POST /v1/chat/completions`). This endpoint supports both standard request/response and SSE streaming modes.
## License
[MIT](LICENSE)
integration
Comments
Sign in to leave a comment