Overview
Query running script calligraphy data: ancient text generation, single-character candidates, radicals, single-character composite images. You can also use OCR to recognize text in calligraphy images.
cyeam mo guwen "兰亭序" # 行书古文
cyeam mo guwen "兰亭序" --ai-compose # AI 补全缺失字
cyeam mo char detail "之" # 单字行书写法候选
cyeam mo char composition "曦" # 偏旁部首
cyeam mo char compose "曦" --out char.png # 合成书法图
cyeam mo ocr image.png # 文字识别
Character retrieval rules (must be followed)
When the user asks to "write a character," "return a certain character," "provide a character image," or "view the calligraphy of a certain character,"look up the original character by default; never directly call char compose. Process in the following order:
- For a single character, first run
cyeam mo char detail <char>, which returns original rubbing glyph candidates and their sources; if there are candidates, use the original character. - For a passage of text, run
cyeam mo guwen <text>; by default it returns only original characters in the font library, and missing characters will be empty. - Only when the original character candidates are empty, the text contains missing characters, or the user explicitly requests "character decomposition composition / composite character / character assembly," use the composition capability: for text use
guwen --ai-compose, for a single character usechar compose。
char compose is aforced character decomposition compositioncommand: even if the font library already has the complete original character, it will still compose, so it cannot be used as the default command for "get a character image." For example, "无" has an original rubbing glyph, so char detail "无"should be used first; only use char compose "无"。
Image delivery (must be followed)
When the user needs to view a glyph, calligraphy image, or "show me the character," you must not reply with only the candidate image URL. After selecting an original character candidate, use its image field to display it directly as a Markdown image, and also write out its source; for example:
「无」— 王羲之《临锺繇千字文》

char detail 's URL is the original rubbing image and can be embedded directly in Markdown;do not switch to char composejust to obtain a displayable image. Only when the current client cannot render Markdown images should you attach the image link as a fallback.
Installation
# macOS Apple Silicon
curl -L https://github.com/mnhkahn/cyeam-cli/releases/latest/download/cyeam_Darwin_arm64.tar.gz | tar xz && chmod +x cyeam && sudo mv cyeam /usr/local/bin/
# macOS Intel
curl -L https://github.com/mnhkahn/cyeam-cli/releases/latest/download/cyeam_Darwin_x86_64.tar.gz | tar xz && chmod +x cyeam && sudo mv cyeam /usr/local/bin/
# Linux amd64
curl -L https://github.com/mnhkahn/cyeam-cli/releases/latest/download/cyeam_Linux_x86_64.tar.gz | tar xz && chmod +x cyeam && sudo mv cyeam /usr/local/bin/
Check installation:which cyeam && cyeam version
Command
cyeam mo guwen <text> 行书古文生成(JSON)
cyeam mo guwen <text> --ai-compose 仅为缺失字形启用合成补全
cyeam mo char detail <char> 查询原帖单字候选(JSON,默认首选)
cyeam mo char composition <char> 偏旁部首(JSON)
cyeam mo char compose <char> --out png 强制拆字合成书法图片(需要 --out)
cyeam mo ocr <image> 书法图片 OCR(JSON)
Output
guwen、char detail、char composition、ocroutputs JSON to stdoutchar detailEach candidate returned includes the original rubbing glyph and its source; when the user wants a single character, prioritize using it- When a glyph needs to be displayed, the caller should embed the original character candidate's
imageURL as a Markdown image and display itssource, rather than outputting only the URL char composeoutputs a PNG file (requires--outto specify the path), and it is always character decomposition composition, not representing the original rubbing's original character
Notes
- Only running script is supported; regular script, clerical script, and other fonts are not supported
- No login required
--ai-composeonly enables composition completion for characters not in the library; existing original characters should still retain the original characterocruploads images to cyeam.com for recognition; image format is unrestricted, but PNG/JPG is recommended