Lark CLI Skill: Drive — File & Folder Management
Lark/Feishu CLI skill for cloud drive. Upload/download files, create folders, manage permissions and comments.
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install 3e66318a-71d0-4d04-81f5-2576064a8b14 --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
What it is
The Lark CLI Drive skill adds cloud drive management capabilities to the Lark (Feishu) command-line interface. It lets you upload files, download documents, create folder hierarchies, and manage sharing permissions without opening the Lark web app. The skill integrates with the Lark Open API to perform drive operations directly from your terminal.
This skill is built for developers and teams who use Lark/Feishu as their collaboration platform and want to automate file operations. It is particularly useful for CI/CD pipelines that need to push build artifacts to shared drives, or for scripts that sync local directories with cloud storage.
How it saves time or tokens
Instead of navigating the Lark web interface to upload files or adjust permissions, you run a single command. Batch operations that would take minutes of clicking become one-line scripts. The CLI also enables automation in shell scripts and cron jobs, removing the need for manual file management entirely.
How to use
- Install the Lark CLI and the Drive skill:
npm install -g @larksuite/cli
npx skills add larksuite/cli -y -g
- Configure authentication (one-time setup):
lark-cli config init
lark-cli auth login --recommend
- Use drive commands to manage files:
# Upload a file
lark-cli drive upload ./report.pdf --folder <folder-token>
# Download a file
lark-cli drive download <file-token> -o ./downloads/
# Create a folder
lark-cli drive mkdir 'Project Assets' --parent <parent-token>
# List folder contents
lark-cli drive ls <folder-token>
Example
# Batch upload all PDFs in a directory to a Lark folder
for file in ./reports/*.pdf; do
lark-cli drive upload "$file" --folder <folder-token>
echo "Uploaded: $file"
done
# Set sharing permissions
lark-cli drive share <file-token> \
--user user@example.com \
--permission view
# Add a comment to a file
lark-cli drive comment <file-token> 'Review completed, approved for release'
Related on TokRepo
- Automation tools -- Explore other CLI-based automation workflows
- Task management tools -- Combine file management with project tracking
Common pitfalls
- Forgetting to run
lark-cli auth loginbefore drive commands results in authentication errors. The token expires periodically, so re-auth may be needed. - Folder tokens are not the same as folder names. You need the token from the Lark URL or from
lark-cli drive lsoutput. - Large file uploads over slow connections may time out. Use the
--retryflag for reliability on unstable networks.
常见问题
It is a plugin for the Lark command-line interface that adds cloud drive file operations. You can upload, download, list, share, and comment on files stored in Lark/Feishu drive without using the web interface.
Yes. Lark and Feishu share the same API backend. The CLI automatically detects your region based on your authentication credentials and routes requests to the correct endpoint.
Yes. The CLI supports non-interactive authentication via environment variables or stored tokens. This makes it suitable for automated pipelines that need to upload build artifacts or reports to shared Lark drives.
The Lark Open API supports uploads up to 20MB for single-part uploads. For larger files, the CLI uses multipart upload automatically. Check current Lark API documentation for the latest limits as they may change.
Open the folder in Lark web app and copy the token from the URL. Alternatively, run lark-cli drive ls on a parent folder to list child folders with their tokens.
引用来源 (3)
- Lark Open Platform— Lark CLI provides command-line access to Lark platform features
- Lark Drive API Docs— Lark Drive API supports file upload, download, and permission management
- npm Registry— npm package for Lark CLI installation
来源与感谢
Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars
Part of the Lark CLI Official Skills Collection on TokRepo.
讨论
相关资产
Lark CLI Skill: Wiki — Knowledge Base Management
Lark/Feishu CLI skill for knowledge base. Create and manage knowledge spaces, organize document nodes and shortcuts.
Lark CLI Skill: Skill Maker — Create Custom Skills
Lark/Feishu CLI skill for creating reusable custom skills. Wrap atomic APIs or orchestrate multi-step workflows.
Lark CLI Skill: Docs — Document Creation & Editing
Lark/Feishu CLI skill for cloud documents. Create from Markdown, read/update content, insert images, search documents.
Lark CLI Skill: Shared — Auth, Config & Security
Lark/Feishu CLI shared foundation skill. App config, auth login, identity switching, scope management, and security rules.