尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A personal index for the books you read: on paper, on Kindle, or as EPUBs read right in the app. When a page matters, write its number and one line in your own words. Link ideas across books and say why they're alike. Later, ask a question and Cairn walks your shelf and points to the book and the page. Installable on phone and laptop, works offline, syncs between devices.
Same family as margin and recall.
public/ (no React, no build step for the UI). Same setup as margin and recall.cairn_books, cairn_marks, cairn_links) and its private cairn-books storage bucket don't touch margin's or recall's.public/vendor/. Books render in a sandboxed frame with scripts off.app/api/suggest, app/api/ask, app/api/kindle and app/api/draft. app/api/koreader reads your Kindle's highlight files from your cloud folder; it doesn't call Claude. The key stays on the server and only ALLOWED_EMAIL can use it.app/api/suggest/route.js POST /api/suggest: a new mark → up to 3 marks that might be "like" it (owner only)
app/api/ask/route.js POST /api/ask: a question + your marks → the marks that answer it, a short answer, and what's missing (owner only)
app/api/kindle/route.js POST /api/kindle: up to 4 photos of a Kindle screen → your highlights, their location or page, and a drafted line (owner only)
app/api/draft/route.js POST /api/draft: imported highlights → a drafted one-line note for each, which you edit (owner only)
app/api/config/route.js served as /config.js: hands the browser the public Supabase URL and key
lib/server.js who is calling, and the call to Claude (same as recall's)
public/index.html markup
public/styles.css styles (tokens at the top; dark mode redefines them)
public/app.js all app logic, split into commented sections
public/sw.js offline cache (bump CACHE to force-refresh every device)
public/vendor/supabase.js pinned Supabase client (2.118.0, same file as recall)
public/vendor/epub.min.js pinned epub.js (0.3.93, BSD-2-Clause) for the reader
public/vendor/jszip.min.js pinned JSZip (3.10.1, MIT), which epub.js uses to open .epub files
supabase/schema.sql tables, row-level security
design/ the four directions explored first
docs/screens/ screenshots
supabase/schema.sql → Run. Safe to run again after updates. Nothing else to change: you sign in with your margin account.
cairn-books storage bucket with its policies). Until you do, Cairn keeps your shelf on this device and the sync status says Run supabase/schema.sql.git clone https://github.com/ajushibu/cairn.git
cd cairn
npm install
cp .env.local.example .env.local # same four values as recall's .env.local
npm run dev # http://localhost:3000
Sign in from the banner on the shelf (or ⋯ → Sign in) with your margin email and password.cairn (framework: Next.js, nothing to change). Add the env vars below, then deploy.public/, refresh localhost:3000. No build step for the UI.git add -A && git commit -m "what changed" && git push
Vercel deploys every push to main automatically, usually in under a minute.npm run build before pushing if you've touched anything in app/ or lib/.CACHE in public/sw.js.| Name | What |
|---|---|
SUPABASE_URL | Project URL (same as margin and recall) |
SUPABASE_PUBLISHABLE_KEY | Publishable (or legacy anon) key. Safe to expose; RLS does the locking. |
ANTHROPIC_API_KEY | Claude API key. Server only. |
ALLOWED_EMAIL | The only account allowed to use Claude in Cairn. |
CLAUDE_MODEL | Optional. Answers Look deeper and reads Kindle photos. Defaults to claude-sonnet-5-5. |
CLAUDE_QUICK_MODEL | Optional. Suggests matches for links and drafts lines for imported highlights. Defaults to claude-haiku-5-5. |
CLAUDE_EFFORT | Optional. low (default), medium, high or off. |
PCLOUD_AUTH | Optional. Kindle sync: a pCloud access token you make yourself (see Kindle sync). Never your password. |
PCLOUD_FOLDER | Optional. Kindle sync: the pCloud folder KOReader saves highlights to, e.g. /KOReader/highlights. |
PCLOUD_HOST | Optional. api.pcloud.com (default, US) or eapi.pcloud.com (Europe). |
KOREADER_WEBDAV_URL, KOREADER_WEBDAV_USER, KOREADER_WEBDAV_PASS | Optional. Kindle sync from any WebDAV folder instead of the pCloud API. The URL must be https://. |
updated_at; changes go up in batches, and each device pulls rows newer than the last server_ts it saw. If a device holds a different account's shelf, it asks before replacing it.The quickest way to capture is the moment something matters, with your phone beside the book:
Open a DRM-free EPUB and read it inside Cairn, marking lines as you go. Import → EPUB book (the ↓ button on the shelf), or ⋯ → Open an EPUB.
<your user id>/<book id>.epub, readable only by you. Another signed-in device downloads it the first time it opens the book. Files over 50 MB (the free plan's limit per file) stay on the device that opened them.Books can be Paper or Kindle (set it when you add or edit a book). Kindle books are numbered by location, plus the page when the book has real page numbers; the index, Revisit and Ask show whichever the book uses. Mark a Kindle spot by hand with the Location / Page switch, or import highlights. Import is the ↓ button on the shelf, or ⋯ → Import from Kindle.
documents → My Clippings.txt, and choose that file. It's read on your device with no AI. Cairn lists the books in it with how many highlights are new; tick the ones you want. Highlights you later extended are merged, your Kindle notes are attached to the highlight they belong to and become its line, and importing the same file again only adds what's new. The notebook export from the Kindle app (an .html file it emails you) works too. English-language Kindles only for now.Highlights made on a Kindle running KOReader with the HighlightSync plugin reach Cairn without any steps from you:
.json file per book to your cloud folder whenever the Kindle is online./api/koreader to read that folder. The server reads only the files that changed since the last check.Set up (once)
https://api.pcloud.com/userinfo?getauth=1&logout=1&username=YOUR_EMAIL&password=YOUR_PASSWORD&authexpire=31536000&authinactiveexpire=31536000 and copy the auth value from the reply. (A European account uses eapi.pcloud.com here and as PCLOUD_HOST.) Clear that page from your history afterwards.PCLOUD_AUTH (the token), PCLOUD_FOLDER and, for a European account, PCLOUD_HOST. Redeploy.
If that link says "Log in failed" (common when you sign in to pCloud with Google or Apple, have two-step login, or have a special character in your password), use pCloud's own login page instead: create an app under My Apps at https://docs.pcloud.com/my_apps/ (any redirect address, such as https://example.com/), then open https://my.pcloud.com/oauth2/authorize?client_id=YOUR_APP_KEY&response_type=token&redirect_uri=YOUR_REDIRECT, sign in and allow. The address you land on ends in #access_token=…&hostname=…. Use that access_token as PCLOUD_AUTH and that hostname as PCLOUD_HOST.If it says the login was not accepted, the token has expired: make a new one and update PCLOUD_AUTH. Not on pCloud? Any WebDAV folder works through KOREADER_WEBDAV_*. Cairn never stores your Amazon login, and the token only lives in your Vercel settings.
Reading EPUBs and marking them costs nothing; book files use Supabase Storage (1 GB on the free plan, so a few hundred typical EPUBs). Suggest matches, Look deeper, Draft lines and reading photos are all buttons, so nothing is sent or billed unless you tap one. The clippings file costs nothing. Look deeper sends every mark: 300 marks is roughly 8,000 tokens in and a few hundred out, which is about 2–3 US cents at Sonnet-class prices of about $3 / $15 per million tokens. Suggest matches and Draft lines use the smaller Haiku model and cost less. A photo is shrunk to about 1,500 × 1,100 pixels before it's sent, roughly 1,600 tokens, so reading one costs on the order of half a cent to a cent. Check Anthropic's pricing page for current numbers. Supabase and Vercel free tiers cover the rest.
design/ were drawn before the margin and recall look was applied. They used MarginNote and Recall AI as references by mistake. Direction A, the index, was picked.