pinyin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese看拼音写字
Read Pinyin and Write Chinese Characters
概述
Overview
把中文文本转成拼音,并生成"看拼音写字"练习纸 PDF(含米字格)。转换过程在本地完成;CLI 默认统计和更新提示的网络请求及关闭方式见下方安装说明。
bash
cyeam pinyin "你好世界" # 获取每个字的拼音
cyeam pinyin sheet "你好世界" # 生成练习纸(PDF base64)
cyeam pinyin sheet --out practice.pdf "你好世界" # 保存 PDF 到文件Converts Chinese text to pinyin and generates a "Read Pinyin and Write Characters" practice-sheet PDF (including rice-grid squares). The conversion runs locally; see the installation instructions below for the CLI's default analytics and update-notification network requests and how to disable them.
bash
cyeam pinyin "你好世界" # Get the pinyin for each character
cyeam pinyin sheet "你好世界" # Generate a practice sheet (base64-encoded PDF)
cyeam pinyin sheet --out practice.pdf "你好世界" # Save the PDF to a filePDF 模式入口
PDF Mode Entry
也可从文件或 stdin 生成同样的练习纸:
bash
printf '%s' '你好' | cyeam pdf --mode pinyin -o practice.pdf
cyeam pdf words.txt --mode pinyin -o practice.pdfA4 纵向,拼音提示、空白米字格及底部改错区。空格、换行和标点分隔词组;长词自动拆分,长文本自动分页,不截断。没有汉字时返回错误。PDF 模式的中文标题需要可用系统中文字体;多音字请核对语境。
You can also generate the same practice sheet from a file or stdin:
bash
printf '%s' '你好' | cyeam pdf --mode pinyin -o practice.pdf
cyeam pdf words.txt --mode pinyin -o practice.pdfA4 portrait, with pinyin hints, blank rice-grid squares, and a correction area at the bottom. Spaces, line breaks, and punctuation separate phrases; long phrases are split automatically, long text is paginated automatically, and nothing is truncated. An error is returned when there are no Chinese characters. Chinese text in PDF mode requires an available Chinese font on the system; check polyphonic characters in context.
安装
Installation
安装前先阅读下面的命令。示例固定为 v1.1.4,不跟随 latest;下载的是可执行程序归档。
仅在需要安装 CLI 时执行,不要在每次调用命令时重复安装。
Read the commands below before installation. The example is pinned to v1.1.4 and does not follow latest; it downloads a binary archive. Execute it only when you need to install the CLI; do not repeat the installation every time you invoke a command.
macOS / Linux:校验后安装到用户目录
macOS / Linux: Verify and Install to the User Directory
在 Bash 或 Zsh 中执行;需要 、、,以及 或 。
脚本自动选择 macOS / Linux 的 arm64 或 x86_64,其他平台会停止。
curltarinstallshasumsha256sumbash
(
set -eu
version='v1.1.4'
case "$(uname -s)/$(uname -m)" in
Darwin/arm64)
asset='cyeam_Darwin_arm64.tar.gz'
sha256='06b5af004ab4f0f05d5829ea6bd18b97c4449c262af7df14c67175f7d3cb29db' ;;
Darwin/x86_64)
asset='cyeam_Darwin_x86_64.tar.gz'
sha256='107342bb9d2fa444b96155c468e71b8cc63e0f5ad0acc784698afe221548efa6' ;;
Linux/aarch64|Linux/arm64)
asset='cyeam_Linux_arm64.tar.gz'
sha256='ed87697f3948bead67b585e9881c3bef20e8d2d903beb5b125587281a5091c5b' ;;
Linux/x86_64)
asset='cyeam_Linux_x86_64.tar.gz'
sha256='873d6805fab8ab56540bb034aaf2f57f12eb672fcabd322ebe401e8250a5966d' ;;
*) echo '不支持的平台,请查看固定版本的 Release。' >&2; exit 1 ;;
esac
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT
cd "$workdir"
curl --fail --show-error --silent --location --proto '=https' --proto-redir '=https' \
--output "$asset" "https://github.com/mnhkahn/cyeam-cli/releases/download/$version/$asset"
printf '%s %s\n' "$sha256" "$asset" > expected.sha256
if command -v sha256sum >/dev/null 2>&1; then
sha256sum -c expected.sha256
else
shasum -a 256 -c expected.sha256
fi
# set -e 确保下载或校验失败时,不会解压或安装。
tar -xzf "$asset" cyeam
mkdir -p "$HOME/.local/bin"
install -m 0755 cyeam "$HOME/.local/bin/cyeam"
CYEAM_CLI_NO_UPDATE_NOTIFIER=1 "$HOME/.local/bin/cyeam" --no-analytics version
)只写临时目录和 (已有同名程序会被替换),无需管理员权限,
不修改系统目录、服务或 shell 配置。当前 shell 使用:
~/.local/bin/cyeambash
export PATH="$HOME/.local/bin:$PATH"如需永久生效,可自行把上面这一行加入 shell 配置。
可在 v1.1.4 发布页 和
checksums.txt
核对摘要。升级固定版本时,必须同时核对并替换版本号和对应 SHA-256。
摘要用于核对发布文件一致性,不等同于独立签名或安全审计。
Run this in Bash or Zsh; , , , and either or are required. The script automatically selects arm64 or x86_64 for macOS / Linux and stops on unsupported platforms.
curltarinstallshasumsha256sumbash
(
set -eu
version='v1.1.4'
case "$(uname -s)/$(uname -m)" in
Darwin/arm64)
asset='cyeam_Darwin_arm64.tar.gz'
sha256='06b5af004ab4f0f05d5829ea6bd18b97c4449c262af7df14c67175f7d3cb29db' ;;
Darwin/x86_64)
asset='cyeam_Darwin_x86_64.tar.gz'
sha256='107342bb9d2fa444b96155c468e71b8cc63e0f5ad0acc784698afe221548efa6' ;;
Linux/aarch64|Linux/arm64)
asset='cyeam_Linux_arm64.tar.gz'
sha256='ed87697f3948bead67b585e9881c3bef20e8d2d903beb5b125587281a5091c5b' ;;
Linux/x86_64)
asset='cyeam_Linux_x86_64.tar.gz'
sha256='873d6805fab8ab56540bb034aaf2f57f12eb672fcabd322ebe401e8250a5966d' ;;
*) echo 'Unsupported platform. Please check the pinned Release.' >&2; exit 1 ;;
esac
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT
cd "$workdir"
curl --fail --show-error --silent --location --proto '=https' --proto-redir '=https' \
--output "$asset" "https://github.com/mnhkahn/cyeam-cli/releases/download/$version/$asset"
printf '%s %s\n' "$sha256" "$asset" > expected.sha256
if command -v sha256sum >/dev/null 2>&1; then
sha256sum -c expected.sha256
else
shasum -a 256 -c expected.sha256
fi
# set -e ensures that the archive will not be extracted or installed if the download or checksum verification fails.
tar -xzf "$asset" cyeam
mkdir -p "$HOME/.local/bin"
install -m 0755 cyeam "$HOME/.local/bin/cyeam"
CYEAM_CLI_NO_UPDATE_NOTIFIER=1 "$HOME/.local/bin/cyeam" --no-analytics version
)This writes only to a temporary directory and (an existing executable with the same name will be replaced), requires no administrator privileges, and does not modify system directories, services, or shell configuration. To use it in the current shell:
~/.local/bin/cyeambash
export PATH="$HOME/.local/bin:$PATH"To make the change permanent, you can add the line above to your shell configuration. You can verify the checksum on the v1.1.4 Release page and checksums.txt. When upgrading to a pinned version, you must verify and replace the version number and corresponding SHA-256 at the same time. A checksum is used to verify the consistency of release artifacts; it is not equivalent to independent signing or a security audit.
外部请求和权限用途
External Requests and Permission Purposes
- 安装下载:只从 GitHub 的固定 Release 下载选定归档;GitHub 可能重定向到其资产 CDN。
下载后先验证文档中固定的 SHA-256,再解压单个 文件。安装检查关闭统计与更新提示。
cyeam - 拼音与练习纸:使用本地词典和字体处理用户指定的文字,不上传文本,
不需要登录。和 PDF 模式的
sheet --out写入指定路径,已有文件可能被覆盖。-o - 使用统计:默认向 发送命令名称、CLI 版本、系统信息和随机安装编号, 服务端可根据出口 IP 解析地域;不发送命令参数、图片内容或登录凭证。 随机编号保存在
https://us.i.posthog.com,用~/.cyeam/analytics-id或--no-analytics关闭。CYEAM_CLI_NO_ANALYTICS=1 - 更新提示:默认最多每 24 小时向 GitHub 检查最新版本,并缓存到 , 提示本身不会替换程序。设置
~/.cyeam/update-state.json关闭。CYEAM_CLI_NO_UPDATE_NOTIFIER=1是显式升级命令,会下载并校验最新 Release、替换当前程序,成功后还会尝试通过cyeam update同步 skills;需要保持固定版本时不要运行它,按上述步骤安装选定版本。npx skills add
关闭 CLI 统计和更新提示(业务本身的网络请求不受影响),可在当前 shell 设置:
bash
export CYEAM_CLI_NO_ANALYTICS=1
export CYEAM_CLI_NO_UPDATE_NOTIFIER=1- Installation download: Downloads only the selected archive from the pinned GitHub Release; GitHub may redirect to its asset CDN. After downloading, it verifies the fixed SHA-256 specified in this document before extracting the single file. The installation check disables analytics and the update notifier.
cyeam - Pinyin and practice sheets: Uses a local dictionary and fonts to process user-specified text; it does not upload the text and requires no login. and PDF mode's
sheet --outwrite to the specified path, and existing files may be overwritten.-o - Usage analytics: By default, sends command names, the CLI version, system information, and a random installation ID to . The service may determine the geographic region from the outgoing IP address; it does not send command arguments, image content, or login credentials. The random ID is stored in
https://us.i.posthog.comand can be disabled with~/.cyeam/analytics-idor--no-analytics.CYEAM_CLI_NO_ANALYTICS=1 - Update notifier: By default, checks GitHub for the latest version at most once every 24 hours and caches the result in ; the notification itself does not replace the program. Set
~/.cyeam/update-state.jsonto disable it.CYEAM_CLI_NO_UPDATE_NOTIFIER=1is an explicit upgrade command that downloads and verifies the latest Release, replaces the current program, and, on success, also attempts to synchronize skills viacyeam update; do not run it when you need to remain on a pinned version—install the selected version using the steps above.npx skills add
To disable CLI analytics and update notifications (network requests made by the core functionality are unaffected), set the following in the current shell:
bash
export CYEAM_CLI_NO_ANALYTICS=1
export CYEAM_CLI_NO_UPDATE_NOTIFIER=1输出
Output
cyeam pinyin "你好"json
{"ok":true,"data":"{\"pinyin\":[{\"char\":\"你\",\"pinyin\":\"nǐ\"},{\"char\":\"好\",\"pinyin\":\"hǎo\"}]}"}cyeam pinyin sheet "你好""pdf"cyeam pinyin "你好"json
{"ok":true,"data":"{\"pinyin\":[{\"char\":\"你\",\"pinyin\":\"nǐ\"},{\"char\":\"好\",\"pinyin\":\"hǎo\"}]}"}cyeam pinyin sheet "你好""pdf"注意事项
Notes
- 纯本地生成,使用 go-pinyin 库 + gofpdf
- 贴入的字体仅 21KB(pinyin-wenkai-light.ttf),二进制文件小巧
- 练习纸包含米字格(含对角线)、拼音提示和底部改错区
- 空格分隔的词组会自动换行排版
- Purely local generation using the go-pinyin library and gofpdf
- The embedded font is only 21 KB (), keeping the binary small
pinyin-wenkai-light.ttf - The practice sheet includes rice-grid squares with diagonals, pinyin hints, and a correction area at the bottom
- Phrases separated by spaces are automatically wrapped onto new lines