A local content library shared by a person and an agent. Save a link, a file, a folder, or supplied text; xclip copies the original into the library. An agent reads it, writes a compact English summary, and files it under a controlled tag pool. Then search from the app or the CLI.
An entry is the unit you meant to save and owns one or more assets: Markdown, code, images, video, audio, or any other file. A folder is one entry with relative paths preserved. The app and CLI share one SQLite library and blob store; neither calls an LLM.
- Local only:
library.dbplus a content-addressedblobs/directory; no account or sync. - Owned originals: importing copies the file into the library. The source path is provenance only, so moving or deleting it does not affect the entry.
- Ingestion: files, folders, supplied text, web pages, and X posts (via fxtwitter). A failed remote fetch still saves the source URL.
- Searchable text, archived everything: UTF-8 text and code are indexed. Images, video, and
audio are playable and become searchable after
--describeor a transcript. - Controlled tags: English slug plus Chinese display name, unique both ways. Chinese UI and CLI copy.
Go 1.27+; Node 22.18+ (or Bun) for the frontend.
npm install
npm run generate # typed Go → TypeScript client
npm run dev # MyGo development app with live reload
npm run build # packaged app in .build/mygo/<os>-<arch>/
go test ./...
npm test
npm run typecheckscripts/package-app.sh [--install] [--launch] builds the app and CLI; --install copies the app
to /Applications and the CLI to ~/.local/bin.
cmd/app/ MyGo app: window, bound Library service, media protocol
cmd/xclip/ CLI
internal/core/ Data layer: entry/asset model, ingestion, search, migration
internal/service/ MyGo bindings and the scoped media handler
web/ TypeScript frontend, tests, and Vite/TypeScript config
resources/ App icon
scripts/ Packaging helper
docs/ Product design notes
The library defaults to ~/.xclip/. Put --home <dir> before the command, or set XCLIP_HOME,
to relocate it. v2 uses library.db; the v1 xclip.db in the same folder is only read by migrate.
xclip add <link> [--title <title>] [-s <summary>] [-n <note>] [-t <tag>] [--json]
xclip add <file-or-folder>... [--title <title>] [-s <summary>] [-n <note>] [-t <tag>] [--json]
xclip add --text-file <path|-> [--name <asset-name>] [--title <title>] [-s <summary>] [-n <note>] [-t <tag>]
xclip search [keyword...] [-t <tag>] [--kind text|code|image|video|audio|file] [--limit <n>] [--json]
xclip show <entry> [--asset <relative-path>] [--json]
xclip update <entry> [--title <title>] [-s <summary>] [-n <note>] [-t <tag>]
[--clear-summary] [--clear-note] [--clear-tags]
[--describe <asset-path>=<description>] [--json]
xclip tags [--json]
xclip delete <entry> [--json]
xclip prune [--json]
xclip migrate --from <old xclip.db> [--media <old media dir>] [--to <new library>] [--json]- Addressing:
show,update, anddeletetake the 8-character short ID (#bbc02c28), a longer unambiguous prefix, or the full ID. Ambiguous prefixes fail rather than pick one. - Files and folders: a folder becomes one entry; nested relative paths are preserved. Symlinks and non-regular files inside it are skipped.
- URLs: one per
add. X links use fxtwitter; other pages keep a title, extracted text, and linked images. - Tags: pass an existing slug, or create inline with
slug:中文名称. Onupdate,-treplaces the tag set; omitting it leaves tags unchanged. - Deletion:
deleteremoves the entry; blobs it alone referenced stay on disk untilprunecollects them and reports the freed bytes. - JSON:
schema_versionis2. Summaries, text, and local paths are never truncated; every asset carrieslocal_path,sha256,kind,size, andreadable. - Search results: one row per matching asset, with path, line, snippet, and hit count. Read it
with
xclip show <entry> --asset <path>.
summary is English only, one or two sentences, one line, at most 400 characters. note is the
person's own free-form note and is not subject to this rule.
- Ingest:
xclip add <link|path> -t <tag>, then read the local assets in the output. - Summarize and file:
xclip update <short-id> -s "English summary." -t <tag>; for media whose content matters, add--describe <path>="What it shows.". - Retrieve:
xclip tags, thenxclip search <keyword>orxclip search -t <tag>, thenxclip show <short-id> --asset <path>. - Maintain:
xclip updatefor metadata,xclip deletefor an entry, andxclip pruneto reclaim blobs no entry references. Deleting removes rows; blobs stay untilpruneruns.
| Table | Purpose |
|---|---|
entries |
Title, summary, note, source, timestamps |
assets |
Entry-relative path, kind, MIME, size, SHA-256, position |
blobs |
Content-addressed original bytes, deduplicated by SHA-256 |
documents |
Searchable text: metadata, text, code, description, transcript |
documents_fts |
FTS5 trigram index over documents |
tags, entry_tags |
Bilingual vocabulary and associations |
The same bytes can belong to several entries; the blob hash is not an asset identity. Ingestion stages and hashes first, publishes blobs, then inserts the entry in one transaction, so a failed import cannot leave a partial entry. Search uses FTS5 trigram for three or more characters and substring matching for shorter terms.
A media-first workspace with content cards, a list view, tag filters, and search that opens the matching file at its line. Cards copy their 8-character ID. The reader keeps related media, documentation, and code together, with image zoom, a video/code comparison view, playback progress, and recently viewed entries.
Markdown is sanitized; relative links resolve only to assets owned by the entry. HTML and SVG stay
source text and never execute. Images, video, and audio stream through xclip-media:// by asset ID;
poster and duration previews are rebuildable derivatives in cache/previews/. The app can import
files or folders (including drops) and edit metadata, but does not generate summaries or tags.
xclip migrate --from <old xclip.db> [--media <dir>] [--to <dir>] opens the old database read-only
and requires an empty v2 library. It preserves IDs, summaries, notes, post text, tags, sources, and
cached media. Media the old library never cached is reported as missing_media.
MIT — see LICENSE.