agentleFS
yjwongyjwong/lark-cli/CLAUDE.md

lark-cli

CLAUDE.md53 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
  1. Distinctive:

    Use Cobra for commands, Viper for config

    line 35
  2. Very specific:

    Search results include freshness field for cache staleness

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 parsing

Build & Test

make build        # Build binary to ./lark
make test         # Run tests
make deps         # Tidy and download dependencies
make install      # Install to $GOPATH/bin

Code 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 via LARK_APP_SECRET env 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 details
  • cal create - Create event
  • cal update <id> - Update event
  • cal delete <id> - Delete event
  • cal search <query> - Search events
  • cal freebusy - Query availability
  • cal lookup-user - Get user ID from email
  • cal common-freetime - Find mutual availability
  • cal rsvp <id> - Accept/decline invitation

Contacts (contact)

  • contact get <user_id> - Get user info by ID
  • contact list-dept [dept_id] - List users in department
  • contact search-dept <query> - Search departments by name

Messages (msg)

  • msg history - Get chat message history
  • msg resource - Download message attachments
  • msg send - Send messages to users or chats
  • msg recall - Recall/delete a message
  • chat search - Find chats and groups

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](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 folder
  • doc get <document_id> - Get document content as markdown
  • doc blocks <document_id> - Get document block structure (JSON)
  • doc create --title "..." [--folder ...] - Create a new document
  • doc append <document_id> - Append blocks (text, headings, lists, code, tables, etc.)
  • doc update-block <document_id> <block_id> - Update existing block content
  • doc search <query> - Search documents by keyword
  • doc comments <document_id> - Get document comments
  • doc download <file_token> -o <path> - Download a Drive file
  • doc image <image_token> --doc <id> - Download a document image
  • doc wiki <node_token> - Resolve wiki node to document token
  • doc wiki-children <node_token> - List child wiki nodes
  • doc wiki-search <query> - Search wiki nodes

Mail (mail)

  • mail setup - Configure IMAP credentials (interactive)
  • mail status - Show connection and cache status
  • mail list - List mailboxes/folders
  • mail sync - Fetch new emails into local cache (supports --workers for parallel sync)
  • mail search - Search cached emails (fast, local)
  • mail show --uid <uid> - Show email content
  • mail 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 freshness field for cache staleness
  • Sync supports parallel connections (--workers) for faster initial sync
  • Sync is resumable - only fetches messages not already cached

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.