@lark-project/cli
v2.6.0
Published
飞书项目插件开发工具
Readme
@lark-project/cli
Command line tool for lark project plugin development.
📘 v2 Wiki: CLI 贡献者 / 想深入了解 v2 插件框架内部实现的读者,见
docs/v2/。
Installation & Usage
To install the cli globally you need to run:
npm i -g @lark-project/cliThen you can use the commands by typing:
lmp stands for Lark Project Management. You can use the "lpm" command to perform various tasks such as init a new project, building and releasing applications, etc.
lpm <cmd> [options]Commands
lpm init <project-name> [plugin-id] [plugin-secret]lpm config <operate> [key] [value]lpm startlpm buildlpm releaselpm debug-env(hidden, 本地调试用)
lpm init <project-name> [plugin-id] [plugin-secret]
Initialize an Lark Project plugin project
USAGE
$ lpm init <project-name> [plugin-id] [plugin-secret]
OPTIONS
-f, --force overwrite target directory if it exist
-h, --help show CLI help
EXAMPLE
$ lpm init plugin-demo MII_0123456789ABCDEF xxxxxxlpm config <operate> [key] [value]
Set, get or remove plugin configuration
USAGE
$ lpm config <operate> [key] [value]
OPTIONS
-g, --global operate global configuration
-h, --help show CLI help
EXAMPLE
$ lpm config set pluginID MII_0123456789ABCDEF
$ lpm config get pluginID
$ lpm config remove pluginIDlpm start
Start the plugin locally
USAGE
$ lpm start
OPTIONS
-h, --help show CLI help
EXAMPLE
$ lpm startlpm build
Build the plugin project as a product file
USAGE
$ lpm build
OPTIONS
-h, --help show CLI help
EXAMPLE
$ lpm buildlpm release
Build the plugin project as a product file and upload it to the cloud.
USAGE
$ lpm release
OPTIONS
-h, --help show CLI help
EXAMPLE
$ lpm releaselpm debug-env
本地调试用的持久化设置。命令对
lpm --help顶层隐藏,但lpm debug-env --help仍可查看子命令。 设置写入<configDir>/settings.json,下次直接生效。
USAGE
$ lpm debug-env # 打印当前所有设置 + help
$ lpm debug-env list # 仅打印当前所有设置
$ lpm debug-env tt-env set <value> # 设置 x-tt-env 头(如 boe_xxx / ppe_xxx)
$ lpm debug-env tt-env get
$ lpm debug-env tt-env clear
$ lpm debug-env local-schema on # 绕过远端 schema 接口,使用仓库内的 schema/developer-plugin.yaml
$ lpm debug-env local-schema off
$ lpm debug-env local-schema status
ENV VARS (单次覆盖,优先级 > 持久化设置)
LPM_TT_ENV=boe_xxx 等价 tt-env set
LPM_LOCAL_SCHEMA=1 等价 local-schema on
EXAMPLE
# 调试 schema/developer-plugin.yaml 改动:开启后所有读取 schema 的命令都走本地文件
$ lpm debug-env local-schema on
$ lpm config # ← 此时使用本地 schema 校验,不打远端
# 单次临时覆盖
$ LPM_LOCAL_SCHEMA=1 lpm config