Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Copyright (C) 2020-2025 by Dynalist Inc.
MIT License

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
Copyright (c) 2025 Versatly

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
132 changes: 67 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,92 @@
# Obsidian Sample Plugin
# ClawVault

This is a sample plugin for Obsidian (https://obsidian.md).
Visual memory management for your Obsidian vault. ClawVault provides colored graph visualization, vault statistics, quick capture, and a status dashboard to help you manage your knowledge base effectively.

This project uses TypeScript to provide type checking and documentation.
The repo depends on the latest plugin API (obsidian.d.ts) in TypeScript Definition format, which contains TSDoc comments describing what it does.
## Features

This sample plugin demonstrates some of the basic functionality the plugin API can do.
- Adds a ribbon icon, which shows a Notice when clicked.
- Adds a command "Open modal (simple)" which opens a Modal.
- Adds a plugin setting tab to the settings page.
- Registers a global click event and output 'click' to the console.
- Registers a global interval which logs 'setInterval' to the console.
### Colored graph view
Automatically colorizes your graph view based on folder categories (tasks, projects, people, decisions, etc.). Run the "Setup graph colors" command to apply neural-style coloring to your vault's graph.

## First time developing plugins?
### Status dashboard
A dedicated panel showing vault statistics including node counts, edge counts, and category breakdowns. Access it via the ribbon icon or the "Open Status Panel" command.

Quick starting guide for new plugin devs:
### Quick capture
Rapidly capture thoughts and notes to your inbox folder. Use `Ctrl+Shift+C` (or `Cmd+Shift+C` on Mac) to open the capture modal.

- Check if [someone already developed a plugin for what you want](https://obsidian.md/plugins)! There might be an existing plugin similar enough that you can partner up with.
- Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it).
- Clone your repo to a local development folder. For convenience, you can place this folder in your `.obsidian/plugins/your-plugin-name` folder.
- Install NodeJS, then run `npm i` in the command line under your repo folder.
- Run `npm run dev` to compile your plugin from `main.ts` to `main.js`.
- Make changes to `main.ts` (or create new `.ts` files). Those changes should be automatically compiled into `main.js`.
- Reload Obsidian to load the new version of your plugin.
- Enable plugin in settings window.
- For updates to the Obsidian API run `npm update` in the command line under your repo folder.
### File decorations
Visual indicators in the file explorer showing inbox items and other category markers.

## Releasing new releases
### Status bar
Optional status bar display showing real-time node and edge counts for your vault.

- Update your `manifest.json` with your new version number, such as `1.0.1`, and the minimum Obsidian version required for your latest release.
- Update your `versions.json` file with `"new-plugin-version": "minimum-obsidian-version"` so older versions of Obsidian can download an older version of your plugin that's compatible.
- Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases
- Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
- Publish the release.
## Installation

> You can simplify the version bump process by running `npm version patch`, `npm version minor` or `npm version major` after updating `minAppVersion` manually in `manifest.json`.
> The command will bump version in `manifest.json` and `package.json`, and add the entry for the new version to `versions.json`
### From Obsidian Community Plugins

## Adding your plugin to the community plugin list
1. Open **Settings → Community plugins**
2. Select **Browse** and search for "ClawVault"
3. Select **Install**, then **Enable**

- Check the [plugin guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines).
- Publish an initial version.
- Make sure you have a `README.md` file in the root of your repo.
- Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin.
### Manual installation

## How to use
1. Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/Versatly/clawvault/releases)
2. Create a folder called `clawvault` in your vault's `.obsidian/plugins/` directory
3. Copy the downloaded files into the `clawvault` folder
4. Reload Obsidian and enable the plugin in **Settings → Community plugins**

- Clone this repo.
- Make sure your NodeJS is at least v16 (`node --version`).
- `npm i` or `yarn` to install dependencies.
- `npm run dev` to start compilation in watch mode.
## Commands

## Manually installing the plugin
| Command | Description |
|---------|-------------|
| Quick capture | Open the quick capture modal |
| Open status panel | Open the vault status dashboard |
| Open kanban board | Open your Board.md file |
| Refresh stats | Force refresh all vault statistics |
| Setup graph colors (neural style) | Apply neural-style graph coloring |

- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`.
## Settings

## Improve code quality with eslint
- [ESLint](https://eslint.org/) is a tool that analyzes your code to quickly find problems. You can run ESLint against your plugin to find common bugs and ways to improve your code.
- This project already has eslint preconfigured, you can invoke a check by running`npm run lint`
- Together with a custom eslint [plugin](https://github.com/obsidianmd/eslint-plugin) for Obsidan specific code guidelines.
- A GitHub action is preconfigured to automatically lint every commit on all branches.
- **Vault path override**: Optionally specify a custom vault path
- **Auto-refresh interval**: Configure how often statistics refresh (10–300 seconds)
- **Show status bar**: Toggle the status bar display
- **Show file decorations**: Toggle file explorer decorations
- **Graph colors**: Customize colors for each category (tasks, projects, people, etc.)

## Funding URL
## Supported categories

You can include funding URLs where people who use your plugin can financially support it.
ClawVault recognizes these folder-based categories for graph coloring:

The simple way is to set the `fundingUrl` field to your link in your `manifest.json` file:
- `tasks` — Gold/orange
- `decisions` — Red
- `people` — Blue
- `projects` — Green
- `lessons` — Purple
- `blocked` — Bright red
- `backlog` — Gray
- `inbox` — Amber

```json
{
"fundingUrl": "https://buymeacoffee.com"
}
```
## Development

```bash
# Install dependencies
npm install

# Build for production
npm run build

If you have multiple URLs, you can also do:
# Development mode with watch
npm run dev

```json
{
"fundingUrl": {
"Buy Me a Coffee": "https://buymeacoffee.com",
"GitHub Sponsor": "https://github.com/sponsors",
"Patreon": "https://www.patreon.com/"
}
}
# Run linter
npm run lint
```

## API Documentation
## Support

- [Documentation](https://clawvault.dev)
- [GitHub Issues](https://github.com/Versatly/clawvault/issues)
- [GitHub Repository](https://github.com/Versatly/clawvault)

## License

See https://docs.obsidian.md
[MIT](LICENSE)
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "obsidian-sample-plugin",
"version": "1.0.0",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"name": "obsidian-clawvault",
"version": "0.1.0",
"description": "Visual memory management for ClawVault vaults — colored graph, task dashboard, vault stats, and quick capture.",
"main": "main.js",
"type": "module",
"scripts": {
Expand All @@ -10,8 +10,15 @@
"version": "node version-bump.mjs && git add manifest.json versions.json",
"lint": "eslint ."
},
"keywords": [],
"license": "0-BSD",
"keywords": [
"obsidian",
"obsidian-plugin",
"clawvault",
"graph",
"vault-management",
"knowledge-management"
],
"license": "MIT",
"devDependencies": {
"@types/node": "^16.11.6",
"esbuild": "0.25.5",
Expand Down
24 changes: 12 additions & 12 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export function registerCommands(plugin: ClawVaultPlugin): void {
// Quick Capture command
plugin.addCommand({
id: COMMAND_IDS.QUICK_CAPTURE,
name: "ClawVault: Quick Capture",
hotkeys: [{ modifiers: ["Ctrl", "Shift"], key: "c" }],
name: "Quick capture",
callback: () => {
new CaptureModal(plugin.app).open();
},
Expand All @@ -27,7 +26,7 @@ export function registerCommands(plugin: ClawVaultPlugin): void {
// Open Status Panel command
plugin.addCommand({
id: COMMAND_IDS.OPEN_STATUS_PANEL,
name: "ClawVault: Open Status Panel",
name: "Open status panel",
callback: () => {
void activateStatusView(plugin);
},
Expand All @@ -36,7 +35,7 @@ export function registerCommands(plugin: ClawVaultPlugin): void {
// Open Kanban Board command
plugin.addCommand({
id: COMMAND_IDS.OPEN_KANBAN_BOARD,
name: "ClawVault: Open Kanban Board",
name: "Open kanban board",
callback: () => {
void plugin.app.workspace.openLinkText("Board.md", "", "tab");
},
Expand All @@ -45,7 +44,7 @@ export function registerCommands(plugin: ClawVaultPlugin): void {
// Force Refresh Stats command
plugin.addCommand({
id: COMMAND_IDS.REFRESH_STATS,
name: "ClawVault: Refresh Stats",
name: "Refresh stats",
callback: () => {
void plugin.refreshAll();
},
Expand All @@ -54,7 +53,7 @@ export function registerCommands(plugin: ClawVaultPlugin): void {
// Setup Graph Colors command
plugin.addCommand({
id: COMMAND_IDS.SETUP_GRAPH_COLORS,
name: "ClawVault: Setup graph colors (neural style)",
name: "Setup graph colors (neural style)",
callback: () => {
void setupGraphColors(plugin);
},
Expand Down Expand Up @@ -90,9 +89,10 @@ async function activateStatusView(plugin: ClawVaultPlugin): Promise<void> {
async function setupGraphColors(plugin: ClawVaultPlugin): Promise<void> {
try {
const adapter = plugin.app.vault.adapter;
const configDir = plugin.app.vault.configDir;

// 1. Write the CSS snippet
const snippetPath = ".obsidian/snippets/clawvault-graph.css";
const snippetPath = `${configDir}/snippets/clawvault-graph.css`;
const snippetCSS = `/* ClawVault Graph Colors — Neural Style */
/* Auto-generated by ClawVault plugin. Dark bg, colored nodes, green links. */

Expand All @@ -112,15 +112,15 @@ async function setupGraphColors(plugin: ClawVaultPlugin): Promise<void> {
color: #2a7d4a;
}`;

const snippetDir = ".obsidian/snippets";
const snippetDir = `${configDir}/snippets`;
if (!(await adapter.exists(snippetDir))) {
await adapter.mkdir(snippetDir);
}
await adapter.write(snippetPath, snippetCSS);

// 2. Update graph.json with colorGroups
const config = await plugin.vaultReader.readConfig();
const categories = config?.categories ?? [
const categories: string[] = config?.categories ?? [
"tasks", "decisions", "people", "projects", "lessons",
"commitments", "inbox", "backlog",
];
Expand Down Expand Up @@ -151,7 +151,7 @@ async function setupGraphColors(plugin: ClawVaultPlugin): Promise<void> {
color: { a: 1, rgb: hexToRgbInt(categoryColors[cat] ?? "#7f8c8d") },
}));

const graphConfigPath = ".obsidian/graph.json";
const graphConfigPath = `${configDir}/graph.json`;
let graphConfig: Record<string, unknown> = {};
try {
if (await adapter.exists(graphConfigPath)) {
Expand All @@ -163,7 +163,7 @@ async function setupGraphColors(plugin: ClawVaultPlugin): Promise<void> {
await adapter.write(graphConfigPath, JSON.stringify(graphConfig, null, 2));

// 3. Enable the CSS snippet
const appearancePath = ".obsidian/appearance.json";
const appearancePath = `${configDir}/appearance.json`;
let appearance: Record<string, unknown> = {};
try {
if (await adapter.exists(appearancePath)) {
Expand All @@ -180,7 +180,7 @@ async function setupGraphColors(plugin: ClawVaultPlugin): Promise<void> {
appearance["enabledCssSnippets"] = enabledSnippets;
await adapter.write(appearancePath, JSON.stringify(appearance, null, 2));

new Notice("ClawVault: Graph colors configured (neural style). Reload Obsidian to see changes.");
new Notice("Graph colors configured (neural style). Reload Obsidian to see changes.");
} catch (error) {
new Notice(`ClawVault: Failed to setup graph colors: ${error instanceof Error ? error.message : "unknown"}`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ClawVaultPlugin extends Plugin {
});

// Add ribbon icon
this.addRibbonIcon("database", "ClawVault status", () => {
this.addRibbonIcon("database", "Open status panel", () => {
void this.activateStatusView();
});

Expand Down Expand Up @@ -182,7 +182,7 @@ export default class ClawVaultPlugin extends Plugin {
`🐘 ${stats.nodeCount.toLocaleString()} nodes · ${stats.edgeCount.toLocaleString()} edges`
);
} catch {
this.statusBarItem.setText("🐘 ClawVault");
this.statusBarItem.setText("🐘 vault stats");
}
}

Expand Down
12 changes: 3 additions & 9 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,9 @@ export class ClawVaultSettingTab extends PluginSettingTab {
const { containerEl } = this;
containerEl.empty();

// Header
new Setting(containerEl).setName("ClawVault settings").setHeading();

// General section
new Setting(containerEl).setName("General").setHeading();

new Setting(containerEl)
.setName("Vault path override")
.setDesc("Optional: Override the vault path (leave empty to auto-detect)")
.setDesc("Override the vault path (leave empty to auto-detect)")
.addText((text) =>
text
.setPlaceholder("Auto-detect")
Expand Down Expand Up @@ -178,10 +172,10 @@ export class ClawVaultSettingTab extends PluginSettingTab {
new Setting(containerEl).setName("About").setHeading();

containerEl.createEl("p", {
text: "ClawVault is a visual memory health plugin for Obsidian. It provides graph insights, quick capture, and vault statistics.",
text: "Visual memory health plugin for Obsidian. Provides graph insights, quick capture, and vault statistics.",
});
containerEl.createEl("p", {
text: "For more information, visit the ClawVault documentation.",
text: "For more information, visit the documentation.",
});
}

Expand Down
Loading