cnote
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese云端笔记
Cloud Notes
概述
Overview
在 OneDrive 文件夹中管理 HTML 笔记。需要先登录 Microsoft 账号(登录方式见 cyeam-cli skill 的"登录方式")。
Notesbash
cyeam cnote list # 列出所有笔记
cyeam cnote get "笔记标题" # 查看(默认 markdown 格式)
cyeam cnote get "笔记标题" --format text
cyeam cnote new "笔记标题" < note.html
cyeam cnote append "笔记标题" < more.htmlManage HTML notes in the OneDrive folder. You must first sign in with a Microsoft account (see "Sign-in method" in the cyeam-cli skill).
Notesbash
cyeam cnote list # 列出所有笔记
cyeam cnote get "笔记标题" # 查看(默认 markdown 格式)
cyeam cnote get "笔记标题" --format text
cyeam cnote new "笔记标题" < note.html
cyeam cnote append "笔记标题" < more.html安装
Installation
安装前先阅读下面的命令。示例固定为 v1.1.4,不跟随 latest;下载的是可执行程序归档。
仅在需要安装 CLI 时执行,不要在每次调用命令时重复安装。
Before installing, read the commands below. The examples are pinned to v1.1.4 and do not follow ; the downloaded file is an executable archive. Run these steps only when you need to install the CLI; do not repeat the installation every time you invoke a command.
latestmacOS / 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 in Bash or Zsh; , , , and either or are required. The script automatically selects arm64 or x86_64 on macOS/Linux and stops on other 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 '不支持的平台,请查看固定版本的 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
)The script writes only to a temporary directory and (an existing executable with the same name is replaced). It requires no administrator privileges and does not modify system directories, services, or shell configuration.
~/.local/bin/cyeamTo use it in the current shell:
bash
export PATH="$HOME/.local/bin:$PATH"To make it permanent, you can add the line above to your shell configuration.
You can verify the digest on the v1.1.4 release page and checksums.txt. When upgrading a pinned version, you must verify and replace both the version number and corresponding SHA-256. The digest verifies the consistency of the release file; it is not equivalent to independent signing or a security audit.
外部请求和权限用途
External Requests and Permission Purposes
- 安装下载:只从 GitHub 的固定 Release 下载选定归档;GitHub 可能重定向到其资产 CDN。
下载后先验证文档中固定的 SHA-256,再解压单个 文件。安装检查关闭统计与更新提示。
cyeam - Microsoft 授权:仅在需要云端功能时运行 ,通过
cyeam login的设备码流程登录,并尝试打开授权页面。 请求https://login.microsoftonline.com/consumers(读写 OneDrive 文件)、Files.ReadWrite(读取账号信息)、User.Read(刷新令牌,免于每次登录)。文件权限覆盖授权账号的 OneDrive 文件, 不局限于本技能的文件夹;令牌优先存系统钥匙串,不可用时回退到offline_access。~/.cyeam/token.json - 云笔记:通过 读写 OneDrive 的
https://graph.microsoft.com/v1.0文件夹; Microsoft 的文件下载可能重定向到其存储域名。Notes/读取文件信息或内容,list/get上传 stdin 中的 HTML(同名文件会被替换),new读取原文再上传追加后的全文。 这些操作需要用户要求的笔记内容和目标标题,不需要系统管理员权限。append - 使用统计:默认向 发送命令名称、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, first verify the fixed SHA-256 in this document, then extract only the file. The installation check disables analytics and update notifications.
cyeam - Microsoft authorization: Run only when cloud features are needed. It signs in through the device-code flow at
cyeam loginand attempts to open the authorization page. It requestshttps://login.microsoftonline.com/consumers(read and write OneDrive files),Files.ReadWrite(read account information), andUser.Read(refresh tokens, avoiding the need to sign in each time). The file permission applies to OneDrive files in the authorized account and is not limited to this skill's folder; tokens are stored in the system keychain when available and fall back tooffline_access.~/.cyeam/token.json - Cloud notes: Reads and writes the folder in OneDrive through
Notes/; Microsoft file downloads may redirect to its storage domain.https://graph.microsoft.com/v1.0reads file information or content,list/getuploads HTML from stdin (replacing a file with the same name), andnewreads the original content and uploads the full text with the addition. These operations require the note content and target title supplied by the user and do not require system administrator privileges.append - Usage analytics: By default, sends command names, the CLI version, system information, and a random installation identifier to . The server may infer the geographic region from the egress IP; command arguments, image content, and login credentials are not sent. The random identifier is stored in
https://us.i.posthog.comand can be disabled with~/.cyeam/analytics-idor--no-analytics.CYEAM_CLI_NO_ANALYTICS=1 - Update notifications: 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 executable. 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 executable, and, on success, also attempts to synchronize skills throughcyeam update. Do not run it when you need to keep a pinned version; install the selected version using the steps above.npx skills add
To disable CLI analytics and update notifications (network requests required by the feature itself are unaffected), set the following in the current shell:
bash
export CYEAM_CLI_NO_ANALYTICS=1
export CYEAM_CLI_NO_UPDATE_NOTIFIER=1命令
Commands
cyeam whoami 查看登录状态(登录方式见 cyeam-cli skill)
cyeam cnote list 列出笔记(显示文件名、修改时间、可点击链接)
cyeam cnote get <title> 读取笔记内容(默认 markdown 渲染)
cyeam cnote get <title> --format text
cyeam cnote new <title> < note.html 从 stdin 创建笔记
cyeam cnote append <title> < note.htmlcyeam whoami 查看登录状态(登录方式见 cyeam-cli skill)
cyeam cnote list 列出笔记(显示文件名、修改时间、可点击链接)
cyeam cnote get <title> 读取笔记内容(默认 markdown 渲染)
cyeam cnote get <title> --format text
cyeam cnote new <title> < note.html 从 stdin 创建笔记
cyeam cnote append <title> < note.html数据存储
Data Storage
笔记存储在 OneDrive 的 文件夹下,每篇笔记是一个 文件。列表时如果有 会显示可点击的"打开"链接。
Notes/.htmlwebUrlNotes are stored in the OneDrive folder, and each note is a file. When listing notes, a clickable "Open" link is displayed if is available.
Notes/.htmlwebUrl注意事项
Notes
- 需要 Microsoft 账号登录,使用 Device Code 流程(登录方式见 cyeam-cli skill)
- 登录后 token 自动刷新(带 refresh_token)
- 内容是纯 HTML,命令会解析并转换为 markdown/text 显示
get - 和
new从 stdin 读取,适合管道:appendecho "<h1>hello</h1>" | cyeam cnote new test
- A Microsoft account is required. Sign-in uses the Device Code flow (see "Sign-in method" in the cyeam-cli skill).
- After sign-in, the token refreshes automatically using .
refresh_token - The content is plain HTML. The command parses it and converts it to markdown/text for display.
get - and
newread from stdin and are suitable for use in pipelines:appendecho "<h1>hello</h1>" | cyeam cnote new test