Skip to content

[Feature] Download/export assets — save-as in Web & Desktop UI, plus zn CLI / MCP parity #716

Description

@gtheys

Context: Self-hosted server vault. Notes embed assets as ![[assets/image.png]]. The server already exposes GET /api/assets/raw?path=... (the web and desktop clients use it internally to render images — apps/web/src/bridge/http-bridge.ts, apps/desktop/src/main/remote/server-client.ts), but as a user I have no way to actually download an asset out of the vault.

What's missing today:

  1. Web app UI — no download button in the Assets view, no "save image as…" on images embedded in a note.
  2. Desktop app UI — same, including when connected to a remote/self-hosted vault.
  3. zn CLI — no zn asset list/get/put commands.
  4. MCP server — no asset tools, so agents/scripts have to hand-roll raw curl calls against /api/assets/raw to pull embedded images.

Related papercut: unknown paths outside /api/* return the SPA's index.html with HTTP 200 (e.g. /files/assets/image.png, /assets/image.png). Naive download attempts therefore "succeed" but yield an HTML file. A 404 for non-API asset-ish paths (or at least correct content-type handling) would prevent silent failures.

Requested surfaces:

  • Web UI: download action in Assets view + context menu on embedded images
  • Desktop UI: same, for local and remote vaults
  • CLI: zn asset list / zn asset get <path> / (optionally zn asset put)
  • MCP: list_assets / get_asset tools mirroring the HTTP API

Keyboard-first note: the download actions should be reachable without a mouse (e.g. a key on the Assets view rows / command-palette entry), in line with the project's keyboard-first principle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cli-mcpThe zn CLI and the MCP servereditorEditing surface: live preview, links, images, assetsenhancementNew feature or requestserverSelf-hosted Go server and web client

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions