This document covers only one capability: creating a Feishu/Lark document from a PaperFlow reading report.
It is separate from the webhook/ngrok bot deployment. You do not need ngrok for document export because PaperFlow calls Feishu APIs directly from the local machine.
paperflow read
-> generate a local Markdown reading report
-> optionally create a Feishu/Lark doc with the same content
-> record doc_url / doc_token in PaperFlow history and wiki metadata
If Feishu doc creation fails, the local Markdown report is still saved.
Set these values in .env:
FEISHU_APP_ID=cli_xxxxxxxxxxxxx
FEISHU_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
FEISHU_CLI_CMD=C:/Users/you/npm-global/lark-cli.cmd
FEISHU_IM_IDENTITY=botOptional GUI default:
PAPERFLOW_WRITE_FEISHU=truePAPERFLOW_WRITE_FEISHU only controls whether the GUI checkbox is enabled by
default. The CLI is controlled by --no-feishu.
In the Feishu/Lark developer console:
- Create or select a Feishu/Lark app.
- Copy its
App IDintoFEISHU_APP_ID. - Copy its
App SecretintoFEISHU_APP_SECRET. - Enable permissions needed for creating cloud documents.
- If you also want PaperFlow to send the document link to a chat, enable bot messaging permissions and add the bot to the target chat.
If lark-cli reports permission_violations, open the console_url from the
error and enable the listed scopes. That error is the most reliable source of
the exact missing permission for your app.
Dry run, no real document is created:
lark-cli docs +create --as bot --title "PaperFlow Feishu smoke test" --markdown "hello" --dry-runCreate a real tiny test document:
lark-cli docs +create --as bot --title "PaperFlow Feishu smoke test" --markdown "hello"Create local Markdown and a Feishu document:
paperflow read 1 --user-id user_role1Only create local Markdown:
paperflow read 1 --user-id user_role1 --no-feishuCreate the Feishu document in a specific folder:
paperflow read 1 --user-id user_role1 --folder-id <feishu_folder_token>The folder token comes from a URL like:
https://.../drive/folder/<feishu_folder_token>
Optionally send the created document link to a Feishu user:
paperflow read 1 --user-id user_role1 --feishu-user-id ou_xxxxxxxxxFor this notification step, the bot must be able to message that user or chat. If using private messages, the user should first send any message to the bot so Feishu has an existing one-on-one conversation.
Start the GUI:
paperflow guiIn the daily-push or direct-reading panels, tick:
同时尝试写入飞书文档
Checked means: generate local Markdown, then attempt Feishu doc creation.
Unchecked means: generate local Markdown only.
This document does not cover:
- Feishu users sending messages to the PaperFlow bot
- Feishu event callbacks
- daily scheduled bot delivery
- ngrok webhook exposure
Those belong to feishu-webhook-setup.md.