Convert an Obsidian / JSON Canvas .canvas file into SVG and import it into a Feishu/Lark whiteboard with lark-cli.
This is a visual migration helper. It preserves the canvas layout as an SVG import, but does not preserve native Canvas node semantics, whiteboard semantic bindings, comments, local image embedding, or table structure.
SKILL.md: Codex skill instructions.scripts/canvas_to_svg.py: Converts.canvasJSON into SVG.scripts/canvas_to_feishu_whiteboard.sh: Converts, validates, dry-runs, and writes to Feishu/Lark.agents/openai.yaml: Skill UI metadata.
- Python 3
- Node.js and
npx - Official Lark/Feishu CLI:
lark-cli - Authenticated Lark/Feishu account with edit permission on the target document or whiteboard
Install the official CLI if needed:
npx @larksuite/cli@latest installThen log in:
lark-cli auth login
lark-cli auth statusAppend a local Canvas into an existing whiteboard, whiteboard link, or Feishu document:
./scripts/canvas_to_feishu_whiteboard.sh \
/path/to/source.canvas \
'https://example.feishu.cn/docx/...' \
--appendOverwrite an existing whiteboard:
./scripts/canvas_to_feishu_whiteboard.sh \
/path/to/source.canvas \
'wbcnxxxxxxxx' \
--overwrite--overwrite clears existing whiteboard content before writing. Use it only when that is intended.
Generate SVG only:
python3 ./scripts/canvas_to_svg.py /path/to/source.canvas /path/to/output.svgThe import script:
- Converts
.canvasto SVG. - Generates a local PNG preview using
@larksuite/whiteboard-cli. - Runs SVG checks.
- Runs a Feishu/Lark dry-run before any cloud write.
- Writes to the target only if dry-run passes.
- Attempts to export a Feishu whiteboard preview image.
If the target is a Feishu document with no embedded whiteboard token, the script appends a new SVG whiteboard block to the document.
Do not commit Feishu/Lark auth files, tokens, device codes, API keys, or other credentials. The repository .gitignore excludes common local credential and generated-output paths.
The scripts mask whiteboard tokens in terminal output where practical, but users should still avoid sharing command logs publicly when they contain private document links.
- This is SVG visual import, not native semantic whiteboard migration.
- Canvas comments, node metadata, edge bindings, and local image content are not guaranteed to survive.
- Local image/file nodes are represented by path or file name only; local images are not uploaded automatically.
- Text wrapping may differ between browser SVG rendering and Feishu whiteboard rendering.
MIT.