Skip to content
dsh.fish
Bundle

dsh-cubox

Cubox sync for DeepSeek Harness: scheduled sync of your bookmarks, today's collection outline, and aggregated annotations/notes via the Cubox API-extension endpoints (/c/api/cli) — agent tools plus a web settings panel

Source
zhengjy01
stars
1 stars
License
MIT
Updated
Updated 13 days ago

Readme

# dsh-cubox

> **English** | [**中文**](README.zh.md)

Cubox sync for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): scheduled sync of your Cubox collection, with an **AI daily brief** generated from your own prompt template and written straight into Obsidian — via the same `/c/api/cli` endpoints the official cubox-cli uses. Agent tools plus a web settings panel.

## Features

- **Scheduled sync** — a timer pulls your latest bookmarks into a local cache (`~/.dsh/dsh-cubox-cache.json`) every N minutes (default 60, configurable; 0 disables the timer). Manual sync anytime with `cubox_sync`.
- **AI daily brief** — write your own prompt template (e.g. "今日收藏简报", `{collection}` is replaced with the formatted collection for the sync window: title / source / summary / annotations). When an LLM key is configured, every sync generates a brief into the output dir — `今日收藏简报-YYYY-MM-DD.md` for a 1-day sync, `最近N日收藏简报-YYYY-MM-DD.md` for wider windows (each window gets its own file).
- **Markdown export** — set `outputDir` and optionally keep one markdown file per card (frontmatter + title + description + Cubox/original links + annotations, same layout as the official Cubox Obsidian plugin). Toggle `exportCards` off to write only the AI brief.
- **Query** — `cubox_cards` filters by keyword, time window, annotated/starred/read status.
- **Config & status** — `cubox_config` / `cubox_status`; credentials persist to `~/.dsh/dsh-cubox.json` (mode 0600), secrets never echoed.
- **Settings panel** — Settings → Cubox: paste the API-extension link, set the sync interval, pick the local export folder (OS folder chooser), toggle per-card export, edit the AI brief prompt and LLM settings (OpenAI-compatible, defaults to DeepSeek).

## Install

```sh
# after publishing to GitHub (repo tagged with the `dsh-plugin` topic)
dsh plugin --profile web add github:zhengjy01/dsh-cubox

# local development
dsh plugin --profile web add link:/path/to/dsh-cubox
```

Restart `dsh web`. The plugin ships pre-built — `lib/index.js` is plain ESM.

## Configure

1. Open Cubox preferences → Extensions & Automation → API Extension → enable it and copy your unique link (e.g. `https://cubox.pro/c/api/save/abcd12345`).
2. Give the link to the plugin — either in the settings panel (Settings → Cubox), or just ask the agent:

   ```text
   帮我配置 Cubox,API 链接是 https://cubox.pro/c/api/save/abcd12345
   ```

   The agent calls `cubox_config` to persist it. `cubox.pro` is the default server; `cubox.cc` is the international instance (auto-detected from the link).
3. (Optional) Set the export dir + AI brief: choose the local folder, paste an OpenAI-compatible API key (DeepSeek by default), and edit the prompt template. `{collection}` is replaced with today's collection list.

Then:

```text
同步一下今天的收藏                → cubox_sync (days=1)
查一下收藏里关于 LLM 的文章       → cubox_cards (keyword="LLM")
```

> The API link and the LLM key are credentials — anyone holding them can read (and modify) your Cubox data or spend your LLM quota. They are stored in `~/.dsh/dsh-cubox.json` (mode 0600). To rotate, refresh in the Cubox API-extension page, then re-configure.

## Tools

| Tool | Purpose |
| --- | --- |
| `cubox_status` | Connection & cache status |
| `cubox_config` | Set / clear `apiLink`, `server`, `token`, `syncMinutes`, `outputDir`, `exportCards`, `llmBaseUrl`, `llmApiKey`, `llmModel`, `llmPrompt` |
| `cubox_sync` | Pull the last N days (default today) into the local cache + export markdown + AI brief |
| `cubox_cards` | Query the collection (keyword / days / annotated / starred / read) |

## Notes

- The public Cubox "open API" only accepts saves; reads go through the internal `/c/api/cli/*` family (same endpoints as the official [cubox-cli](https://github.com/OLCUBO/cubox-cli)).
- The sync cache is a plain JSON snapshot (cards + today's annotations, deduped by id, newest first) — agents can answer "what did I save" without extra round trips.
- License: MIT

Install

dsh plugin --profile web add github:zhengjy01/dsh-cubox

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source