57 lines
2.4 KiB
Markdown
57 lines
2.4 KiB
Markdown
# Beaver — Obsidian plugin
|
|
|
|
[](https://sladge.net)
|
|
|
|
Sends the current note to Beaver's `markdown frontend` (`POST /chat` on `beaver-gateway`) and writes the agent's reply back into the file. Skips the Obsidian Sync round-trip by POSTing the buffer contents directly.
|
|
|
|
## Commands
|
|
|
|
Both commands appear in the command palette only when the active note's YAML frontmatter has an `agent:` field:
|
|
|
|
- **Beaver: Send using selected agent** — uses `frontmatter.agent`.
|
|
- **Beaver: Send using different agent** — fetches the agent list from the gateway and opens a fuzzy picker.
|
|
|
|
## Settings
|
|
|
|
- **Base URL** — markdown-frontend root, e.g. `http://localhost:62993`.
|
|
- **Bearer token** — a token with the `messages` scope (mint via the admin frontend or `BOOTSTRAP_TOKENS`).
|
|
- **Test connection** — calls `GET /agents`.
|
|
|
|
## Note format
|
|
|
|
A minimal note that the plugin can send:
|
|
|
|
```markdown
|
|
---
|
|
agent: beaver-opus-medium
|
|
---
|
|
|
|
hi there
|
|
```
|
|
|
|
The gateway parses `### User:` / `### Assistant:` markers; a note with no markers is treated as a single user turn. After a successful send, the gateway returns the new file content (including an `### Assistant:` block and a fresh `### User:` scaffold), and the plugin writes it back to the buffer.
|
|
|
|
## Install
|
|
|
|
```
|
|
make install VAULT=~/Obsidian/my-vault # build + copy manifest.json + main.js into <vault>/.obsidian/plugins/beaver
|
|
make zip # build → beaver-plugin-<version>.zip you can carry to any vault
|
|
```
|
|
|
|
Then enable **Beaver** in Settings → Community plugins.
|
|
|
|
### Mobile
|
|
|
|
The plugin is desktop-and-mobile (`isDesktopOnly: false`). Two things to get right on a phone:
|
|
|
|
- The base URL in plugin settings has to be reachable from the phone — `http://localhost:62993` won't work; use the gateway's LAN IP, a tunnel, or a public hostname.
|
|
- Get the plugin files onto the phone vault via Obsidian Sync (toggle "Installed community plugins" in your sync settings) or any file-sync tool you already use (Working Copy, Syncthing, etc.). `make install` only knows how to write to a local path.
|
|
|
|
### Hand-rolled
|
|
|
|
Three files are all Obsidian needs — `manifest.json`, `main.js`, `versions.json`. Drop them in `<vault>/.obsidian/plugins/beaver/` however you like (unzip, `scp`, `rsync`, your own git, …).
|
|
|
|
## Bumping the version
|
|
|
|
Edit the version field in `manifest.json`, `package.json`, and `versions.json` by hand. Three files, one change each.
|