flomo-memo-to-markdown

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Flomo Memo To Markdown

Flomo备忘录转Markdown

Overview

概述

Convert flomo memos into Markdown files grouped by time range and generate
tag-stats.md
with both
direct_count
and
total_count
per tag node.
This is a standalone export skill. It is not a CRUD helper and should not be used for interactive "find one memo and edit it" requests.
Default behavior is optimized for fast one-shot processing from the local flomo desktop login state: full date range, monthly split,
{{user}}_{{range}}
filenames, and
asset-mode=placeholder
.
将flomo备忘录转换为按时间范围分组的Markdown文件,并生成每个标签节点同时包含
direct_count
total_count
tag-stats.md
文件。
这是一个独立的导出Skill,不是CRUD辅助工具,不应用于响应“查找单条备忘录并编辑”这类交互式请求。
默认行为针对从本地flomo桌面端登录状态进行快速一次性处理做了优化:全日期范围、按月拆分、
{{user}}_{{range}}
文件名格式、
asset-mode=placeholder

Preconditions

前置条件

  • flomo.app
    has been logged in on this Mac before
  • Local flomo storage exists under
    ~/Library/Containers/com.flomoapp.m/...
  • Network access to flomo API is available if using the local source
  • 此Mac设备此前已登录过
    flomo.app
  • 本地flomo存储存在于
    ~/Library/Containers/com.flomoapp.m/...
    路径下
  • 若使用本地数据源,需可正常访问flomo API网络

Quick Start

快速开始

Set the script path from the current environment instead of hardcoding a user directory:
bash
SKILL_ROOT="${CODEX_HOME:-$HOME/.codex}/skills/flomo-memo-to-markdown"
SCRIPT="$SKILL_ROOT/scripts/flomo_to_nblm.py"
Examples:
bash
python3 "$SCRIPT"
python3 "$SCRIPT" --preview-only
python3 "$SCRIPT" --split quarter --asset-mode copy
从当前环境设置脚本路径,不要硬编码用户目录:
bash
SKILL_ROOT="${CODEX_HOME:-$HOME/.codex}/skills/flomo-memo-to-markdown"
SCRIPT="$SKILL_ROOT/scripts/flomo_to_nblm.py"
使用示例:
bash
python3 "$SCRIPT"
python3 "$SCRIPT" --preview-only
python3 "$SCRIPT" --split quarter --asset-mode copy

Default Agent Workflow

默认Agent工作流

  1. Use the local flomo API source.
  2. If any local API read step fails, fail fast and return error immediately.
  3. Do not fall back to cached exports.
  4. Do not ask for exported HTML unless the user explicitly requests postprocessing an archive.
  5. Run with defaults unless the user specifies date range / split / naming / asset handling.
  6. Report output directory, generated Markdown file count, per-file memo/char counts, threshold warnings, and the
    tag-stats.md
    path.
  1. 使用本地flomo API数据源
  2. 若任意本地API读取步骤失败,快速终止并立即返回错误
  3. 不回退到缓存的导出文件
  4. 除非用户明确要求对归档文件进行后处理,否则不请求导出的HTML文件
  5. 除非用户指定日期范围/拆分规则/命名规则/资源处理方式,否则使用默认参数运行
  6. 上报输出目录、生成的Markdown文件数量、单文件备忘录/字符计数、阈值警告,以及
    tag-stats.md
    文件路径

When To Ask Follow-Up Questions

何时需要询问后续问题

Ask only when one of these materially changes execution:
  • The user wants a custom date range
  • The user wants a different split granularity
  • The user wants a custom filename template
  • The user wants copied attachments or explicitly wants to ignore attachments
  • Local desktop auth is missing or broken
仅当以下情况会实质性影响执行结果时才需要询问:
  • 用户需要自定义日期范围
  • 用户需要不同的拆分粒度
  • 用户需要自定义文件名模板
  • 用户需要复制附件或者明确要求忽略附件
  • 本地桌面认证缺失或失效

Output Behavior

输出行为

  • Default output is decompressed Markdown files
  • Also writes
    tag-stats.md
    in export mode
  • --preview-only
    performs parsing, filtering, grouping, and tag stats only
  • --word-limit
    is treated as a character count threshold
  • 默认输出为未压缩的Markdown文件
  • 导出模式下还会生成
    tag-stats.md
    文件
  • --preview-only
    参数仅执行解析、过滤、分组和标签统计操作
  • --word-limit
    参数会被视为字符计数阈值

Local Source Semantics

本地数据源语义

  • Default input is the local flomo desktop login state, not exported HTML
  • The script reads the local desktop auth token from
    ~/Library/Containers/com.flomoapp.m/.../leveldb
  • Memo bodies come from flomo API
    content
    HTML and are rendered to Markdown
  • Memo timestamps come from
    created_at
  • Attachments come from memo
    files
  • Tags are re-derived from rendered Markdown text using
    #tag
    syntax
  • 默认输入为本地flomo桌面端登录状态,而非导出的HTML文件
  • 脚本会从
    ~/Library/Containers/com.flomoapp.m/.../leveldb
    路径读取本地桌面认证token
  • 备忘录内容来自flomo API返回的
    content
    HTML,会被渲染为Markdown格式
  • 备忘录时间戳来自
    created_at
    字段
  • 附件来自备忘录的
    files
    字段
  • 标签会使用
    #tag
    语法从渲染后的Markdown文本中重新提取

Attachment Modes

附件模式

  • placeholder
    (default): Append attachment path lines to memo Markdown; do not copy files
  • ignore
    : Ignore attachments entirely
  • copy
    : Download signed attachment URLs into
    assets/
    under the output directory and rewrite Markdown references
  • placeholder
    (默认):在备忘录Markdown末尾追加附件路径行,不复制文件
  • ignore
    :完全忽略附件
  • copy
    :将签名后的附件URL下载到输出目录下的
    assets/
    文件夹中,并重写Markdown引用

Tag Statistics Semantics

标签统计语义

  • Tags are extracted from memo plain text using
    #tag
    syntax
  • Counting is deduped per memo
  • direct_count
    : memos tagged with this exact tag
  • total_count
    :
    direct_count
    plus all descendant tags
  • 标签使用
    #tag
    语法从备忘录纯文本中提取
  • 计数会按备忘录去重
  • direct_count
    :明确标记了当前标签的备忘录数量
  • total_count
    direct_count
    加上所有后代标签的计数

Resources

资源

scripts/

scripts/

  • scripts/flomo_to_nblm.py
    : Main converter CLI for local flomo export to grouped Markdown
  • scripts/flomo_to_nblm.py
    :本地flomo导出为分组Markdown的主转换器CLI

references/

references/

  • references/flomo-export-dom.md
    : HTML export DOM assumptions and attachment selectors
  • references/flomo-export-dom.md
    :HTML导出DOM假设和附件选择器说明