lark-cli
CLAUDE.md54 starsChanged 11 months agoMITView on GitHub
A Go CLI tool for interacting with Lark APIs, designed for use by Claude Code. See USAGE.md for full CLI documentation. Main commands: Message Sending Features: - Send text messages with line breaks (\n creates newlines) - Send images with --image and place {{image}} in text to control placement - Mention users with @{ou_xxx} placeholders - Include links with markdown text - Send to emails, user IDs, or chat IDs - Auto-detect recipient types - Support escape sequences (\n, \t,…
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Use Cobra for commands, Viper for config
- Very specific: line 106
Search results include freshness field for cache staleness
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Code Instructions for lark
A Go CLI tool for interacting with Lark APIs, designed for use by Claude Code.
Project Structure
cmd/lark/ # Main entry point
internal/
api/ # Lark API client
auth/ # OAuth authentication
cmd/ # Cobra command implementations
config/ # Configuration handling
conflicts/ # Conflict detection
mail/ # IMAP mail client with caching
output/ # JSON/human-readable output formatting
time/ # Date/time parsingBuild & Test
make build # Build binary to ./lark
make test # Run tests
make deps # Tidy and download dependencies
make install # Install to $GOPATH/binCode Conventions
- JSON output by default
- Error responses use structured format:
{"error": true, "code": "...", "message": "..."} - Date parsing supports ISO 8601 formats
- Config in
.lark/config.yaml, secrets viaLARK_APP_SECRETenv var - Use Cobra for commands, Viper for config
Commands
See USAGE.md for full CLI documentation. Main commands:
Auth
auth login|status|logout- Authentication
Calendar (cal)
cal list- List events (supports--week,--from,--to)cal show <id>- Show event detailscal create- Create eventcal update <id>- Update eventcal delete <id>- Delete eventcal search <query>- Search eventscal freebusy- Query availabilitycal lookup-user- Get user ID from emailcal common-freetime- Find mutual availabilitycal rsvp <id>- Accept/decline invitation
Contacts (contact)
contact get <user_id>- Get user info by IDcontact list-dept [dept_id]- List users in departmentcontact search-dept <query>- Search departments by name
Messages (msg)
msg history- Get chat message historymsg resource- Download message attachmentsmsg send- Send messages to users or chatsmsg recall- Recall/delete a messagechat search- Find chats and groups
Message Sending Features:
- Send text messages with line breaks (
\ncreates newlines) - Send images with
--imageand place{{image}}in text to control placement - Mention users with
@{ou_xxx}placeholders - Include links with markdown
[text](url) - Send to emails, user IDs, or chat IDs
- Auto-detect recipient types
- Support escape sequences (\n, \t, ", \)
Documents (doc)
doc list [folder_token]- List items in a Drive folderdoc get <document_id>- Get document content as markdowndoc blocks <document_id>- Get document block structure (JSON)doc create --title "..." [--folder ...]- Create a new documentdoc append <document_id>- Append blocks (text, headings, lists, code, tables, etc.)doc update-block <document_id> <block_id>- Update existing block contentdoc search <query>- Search documents by keyworddoc comments <document_id>- Get document commentsdoc download <file_token> -o <path>- Download a Drive filedoc image <image_token> --doc <id>- Download a document imagedoc wiki <node_token>- Resolve wiki node to document tokendoc wiki-children <node_token>- List child wiki nodesdoc wiki-search <query>- Search wiki nodes
Mail (mail)
mail setup- Configure IMAP credentials (interactive)mail status- Show connection and cache statusmail list- List mailboxes/foldersmail sync- Fetch new emails into local cache (supports--workersfor parallel sync)mail search- Search cached emails (fast, local)mail show --uid <uid>- Show email contentmail fetch --uid <uid>- Download as .eml file
Mail Architecture:
- Uses IMAP (not REST API) for better search capability
- Local SQLite cache for O(1) search performance
- Credentials stored in
$LARK_CONFIG_DIR/mail.json - Cache stored in
$LARK_CONFIG_DIR/mail_cache.db - Search results include
freshnessfield for cache staleness - Sync supports parallel connections (
--workers) for faster initial sync - Sync is resumable - only fetches messages not already cached
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

