Feishu Print Skill
Strict rules:
- - Do not use write/edit tools to create or modify any files
- Do not create Python scripts, test scripts, or any auxiliary files
- Only run existing shell scripts or
lp commands via exec
Print Files from Feishu
Smart Matching: Interpret Intent → Set Variables → Call Script
The agent interprets the user's natural language, determines intent, sets the corresponding environment variables, then calls the script.
| User says | Environment variables |
|---|
| "Print the latest file" / "Print this file" | (default, no variables needed) |
| "Print the last two files" / "Print these two files" |
LIMIT=2 |
| "Print files starting with report" |
NAME_PREFIX=report |
| "Print files with contract in the name" |
NAME_CONTAINS=contract |
| "Print the PDF I just uploaded" / "Print the PDF from just now" |
MINUTES=5 FILE_TYPE=pdf |
| "Print the last three files" |
LIMIT=3 MINUTES=10 |
FILE_TYPE values: pdf / image / video / doc / file (default — matches all)
Invocation
CODEBLOCK0
Script prints Sent to printer: <filename> for each file on success.
Print Text Content Directly
CODEBLOCK1
Multi-line content:
cat > /tmp/openclaw_print.txt << 'EOF'
content
EOF
lp -d <PrinterName> /tmp/openclaw_print.txt
List Available Printers
CODEBLOCK3
Check Print Queue
CODEBLOCK4
Cancel Print Jobs
CODEBLOCK5
飞书打印技能
严格规则:
- - 不得使用写入/编辑工具创建或修改任何文件
- 不得创建Python脚本、测试脚本或任何辅助文件
- 只能通过exec运行现有的Shell脚本或lp命令
从飞书打印文件
智能匹配:解析意图 → 设置变量 → 调用脚本
智能体解析用户的自然语言,确定意图,设置相应的环境变量,然后调用脚本。
| 用户指令 | 环境变量 |
|---|
| 打印最新文件 / 打印这个文件 | (默认,无需变量) |
| 打印最后两个文件 / 打印这两个文件 |
LIMIT=2 |
| 打印以report开头的文件 | NAME_PREFIX=report |
| 打印文件名包含contract的文件 | NAME_CONTAINS=contract |
| 打印我刚上传的PDF / 打印刚才的PDF | MINUTES=5 FILE_TYPE=pdf |
| 打印最后三个文件 | LIMIT=3 MINUTES=10 |
FILE_TYPE取值:pdf / image / video / doc / file(默认——匹配所有类型)
调用方式
bash
默认:打印最新文件
PRINTER=MyPrinter
DIR>/feishufetchandprint.sh
打印最新的2个文件
PRINTER=MyPrinter LIMIT=2 DIR>/feishufetchandprint.sh
打印名称以report开头的文件
PRINTER=MyPrinter NAMEPREFIX=report DIR>/feishufetchand_print.sh
打印最近5分钟内上传的PDF文件
PRINTER=MyPrinter MINUTES=5 FILETYPE=pdf DIR>/feishufetchand_print.sh
脚本成功执行后,每个文件会输出 已发送到打印机:<文件名>。
直接打印文本内容
bash
echo 要打印的内容 | lp -d <打印机名称>
多行内容:
bash
cat > /tmp/openclaw_print.txt << EOF
内容
EOF
lp -d <打印机名称> /tmp/openclaw_print.txt
列出可用打印机
bash
lpstat -a
查看打印队列
bash
lpq -P <打印机名称>
取消打印任务
bash
cancel -a <打印机名称>