Skip to content

feat: add Flomo memos reader adapter#1549

Open
Pandas886 wants to merge 8 commits into
jackwener:mainfrom
Pandas886:feat/flomo-memos-adapter
Open

feat: add Flomo memos reader adapter#1549
Pandas886 wants to merge 8 commits into
jackwener:mainfrom
Pandas886:feat/flomo-memos-adapter

Conversation

@Pandas886
Copy link
Copy Markdown
Contributor

Summary

Add a new adapter for reading memos from Flomo, a popular card-based note-taking app. The adapter accesses the user's memos via Flomo's internal signed API, with authentication handled through the browser login session.

Commands

Command Description
opencli flomo memos [options] List memos from your Flomo account

Technical Details

Auth strategy: Strategy.COOKIE with browser: true. The adapter navigates to v.flomoapp.com (the Flomo SPA) and reads the access token from localStorage.me.access_token. No manual token setup or environment variables needed.

API integration: Flomo's internal API at flomoapp.com/api/v1/memo/updated/ uses a custom MD5 signing mechanism. Parameters are sorted alphabetically and hashed with a static secret key. The adapter implements this signing in Node.js using the built-in crypto module.

Arguments:

  • --limit (default: 20, max: 200) — number of memos to fetch. Use --limit 200 to fetch all memos in one call
  • --since <unix_ts> — only return memos updated after this timestamp (experimentally verified to work)
  • --slug <cursor> — experimental cursor-based pagination

Output columns: content, slug, tags, images, created_at, updated_at

Testing

  • 5 unit tests (command registration, args validation, columns)
  • Verified with real Flomo account data (173 memos, 17 with image attachments)
  • Verified --since date filtering returns correct results
  • Rate limit confirmed: 360 requests/hour

Files Changed

  • clis/flomo/memos.js — main adapter implementation
  • clis/flomo/memos.test.js — unit tests (5 tests)
  • cli-manifest.json — regenerated

Closes #1548

huzekang added 8 commits May 14, 2026 11:12
Read your Flomo memos via the signed API.

- flomo memos: Lists recent memos with content, tags, timestamps
  Uses the Flomo v1 API with MD5 signing (secret embedded).
  Requires FLOMO_ACCESS_TOKEN env variable.
  Supports pagination via --slug cursor and --limit.
Use Strategy.COOKIE + browser:true instead of PUBLIC + manual token.
The adapter now reads flomo_token from localStorage in the browser,
and makes the signed API call from within the page context via fetch().
Signature is computed in Node.js and injected into the browser eval.
No env var or --token flag needed.
Flomo API requires Bearer token from access_token field in
localStorage.me (not api_token). Adapter now reads access_token
from the browser's localStorage and calls the signed API from
Node.js with the Bearer header.
- Add --since <unix_ts> to filter memos by updated_at
- Add --limit 200 to fetch all memos in one call
- Mark --slug as experimental (cursor pagination unreliable)
- 5 tests passing
@Pandas886 Pandas886 force-pushed the feat/flomo-memos-adapter branch from 2867b4a to d95e022 Compare May 14, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Flomo memos reader adapter

1 participant