Overview
Convert Chinese text to pinyin and generate a "Write Characters from Pinyin" practice sheet PDF (with mi-zi grids). All generated locally, no network required.
cyeam pinyin "你好世界" # 获取每个字的拼音
cyeam pinyin sheet "你好世界" # 生成练习纸(PDF base64)
cyeam pinyin sheet --out practice.pdf "你好世界" # 保存 PDF 到文件
PDF Mode Entry
The same practice sheet can also be generated from a file or stdin:
printf '%s' '你好' | cyeam pdf --mode pinyin -o practice.pdf
cyeam pdf words.txt --mode pinyin -o practice.pdf
A4 portrait, with pinyin prompts, blank mi-zi grids, and a correction area at the bottom. Spaces, line breaks, and punctuation separate phrases; long words are automatically split, and long text is automatically paginated without truncation. Returns an error when there are no Chinese characters. The Chinese title in PDF mode requires an available system Chinese font; please verify the context for polyphonic characters.
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/
Output
cyeam pinyin "你好" Returns JSON:
{"ok":true,"data":"{\"pinyin\":[{\"char\":\"你\",\"pinyin\":\"nǐ\"},{\"char\":\"好\",\"pinyin\":\"hǎo\"}]}"}
cyeam pinyin sheet "你好" Additionally includes the "pdf" field (base64-encoded PDF).
Notes
- Purely local generation, using the go-pinyin library + gofpdf
- The embedded font is only 21KB (pinyin-wenkai-light.ttf), making the binary small
- The practice sheet includes mi-zi grids (with diagonal lines), pinyin prompts, and a correction area at the bottom
- Space-separated phrases are automatically wrapped and laid out