Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canvas to Feishu Whiteboard

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.

Contents

  • SKILL.md: Codex skill instructions.
  • scripts/canvas_to_svg.py: Converts .canvas JSON into SVG.
  • scripts/canvas_to_feishu_whiteboard.sh: Converts, validates, dry-runs, and writes to Feishu/Lark.
  • agents/openai.yaml: Skill UI metadata.

Requirements

  • 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 install

Then log in:

lark-cli auth login
lark-cli auth status

Usage

Append 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/...' \
  --append

Overwrite 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.svg

Behavior

The import script:

  1. Converts .canvas to SVG.
  2. Generates a local PNG preview using @larksuite/whiteboard-cli.
  3. Runs SVG checks.
  4. Runs a Feishu/Lark dry-run before any cloud write.
  5. Writes to the target only if dry-run passes.
  6. 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.

Security

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.

Limitations

  • 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.

License

MIT.

About

Convert Obsidian JSON Canvas files to SVG and import them into Feishu/Lark whiteboards

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages