shiori-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseshiori-cli
shiori-cli
Unofficial CLI client for Shiori, a read-later / bookmark service.
这是Shiori(一款稍后阅读/书签服务,官网:https://www.shiori.sh/)的非官方CLI客户端。
Prerequisites
前置条件
Ensure is set before running any command. The CLI refuses to run without it.
SHIORI_API_KEYbash
export SHIORI_API_KEY="shk_..."Optionally override the API endpoint:
bash
export SHIORI_API_BASE_URL="https://custom.host"运行任何命令前请确保已设置,否则CLI将无法运行。
SHIORI_API_KEYbash
export SHIORI_API_KEY="shk_..."(可选)覆盖API端点:
bash
export SHIORI_API_BASE_URL="https://custom.host"Quick Start
快速开始
bash
undefinedbash
undefinedList unread links
列出未读链接
shiori list --read unread
shiori list --read unread
Save a new link
保存新链接
shiori add "https://example.com/article"
shiori add "https://example.com/article"
Mark as read
标记为已读
shiori read --id "link-id"
shiori read --id "link-id"
Delete
删除链接
shiori delete "link-id"
Append `--json` to any command for machine-readable JSON output.shiori delete "link-id"
在任意命令后添加`--json`参数可获取机器可读的JSON格式输出。Command Overview
命令概览
| Command | Purpose | Key args |
|---|---|---|
| List saved links | |
| Save a new link | |
| Mark links as read | |
| Mark links as unread | |
| Delete a link | positional |
For full option details, default values, and output format specs, see references/cli-reference.md.
| 命令 | 用途 | 关键参数 |
|---|---|---|
| 列出已保存的链接 | |
| 保存新链接 | |
| 将链接标记为已读 | |
| 将链接标记为未读 | |
| 删除链接 | 位置参数 |
如需了解完整的选项详情、默认值和输出格式规范,请查看references/cli-reference.md。
Workflow
工作流程
- Check environment - Verify is set. If not, instruct the user to set it.
SHIORI_API_KEY - Choose command - Pick from ,
list,add,read,unreadbased on intent.delete - Choose output mode - Use when parsing output programmatically; omit for human-readable plain text.
--json - Handle errors - Check stderr and exit code. Common issues:
- : API key not configured
MISSING_API_KEY - : Invalid API key
UNAUTHORIZED - : Back off and retry (the CLI auto-retries up to 2 times)
RATE_LIMITED - : Check connectivity
NETWORK_ERROR
- 检查环境 - 确认已设置,若未设置则指导用户进行配置。
SHIORI_API_KEY - 选择命令 - 根据需求从、
list、add、read、unread中选择对应命令。delete - 选择输出模式 - 若需通过程序解析输出,使用参数;若供人类阅读则省略该参数。
--json - 错误处理 - 检查标准错误输出和退出码。常见问题:
- :未配置API密钥
MISSING_API_KEY - :API密钥无效
UNAUTHORIZED - :请等待后重试(CLI会自动重试最多2次)
RATE_LIMITED - :检查网络连接
NETWORK_ERROR
Common Patterns
常见使用模式
List then bulk-mark as read
列出后批量标记为已读
bash
undefinedbash
undefinedGet unread links as JSON, extract IDs, mark all as read
获取未读链接的JSON格式输出,提取ID,然后标记全部为已读
shiori list --read unread --json
shiori read --id "id1" --id "id2" --id "id3"
undefinedshiori list --read unread --json
shiori read --id "id1" --id "id2" --id "id3"
undefinedSave and immediately mark as read
保存链接并立即标记为已读
bash
shiori add "https://example.com" --readbash
shiori add "https://example.com" --readPaginated listing
分页列出链接
bash
shiori list --limit 20 --offset 0
shiori list --limit 20 --offset 20bash
shiori list --limit 20 --offset 0
shiori list --limit 20 --offset 20Error Handling Reference
错误处理参考
See references/cli-reference.md for the full error code table and output format specifications.
完整的错误码表格和输出格式规范请查看references/cli-reference.md。