# zrd-cli **Repository Path**: bujiDemon/zrd-cli ## Basic Information - **Project Name**: zrd-cli - **Description**: cli - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-06 - **Last Updated**: 2026-08-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Timeline CLI 时光轴视频 API 命令行工具 ## 功能 - `health` - 检查服务健康状态 - `ping` - Ping 健康检查 - `video generate` - 生成时光轴视频 - `video list` - 列出所有视频 - `video download` - 下载指定视频 - `video delete` - 删除指定视频 - `config set/get/show` - 配置管理 - `showdoc add` - 发布 Markdown 页面到 ShowDoc - `showdoc get` - 获取 ShowDoc 页面详情 ## 安装 ### 从源码安装 ```bash go install github.com/yourorg/timeline-cli@latest ``` ### 下载二进制 ```bash # Linux wget https://github.com/yourorg/timeline-cli/releases/download/v1.0.0/timeline-cli-linux-amd64 chmod +x timeline-cli-linux-amd64 sudo mv timeline-cli-linux-amd64 /usr/local/bin/timeline-cli # macOS curl -LO https://github.com/yourorg/timeline-cli/releases/download/v1.0.0/timeline-cli-darwin-arm64 chmod +x timeline-cli-darwin-arm64 sudo mv timeline-cli-darwin-arm64 /usr/local/bin/timeline-cli # Windows curl -LO https://github.com/yourorg/timeline-cli/releases/download/v1.0.0/timeline-cli-windows-amd64.exe ``` ## 使用 ### 健康检查 ```bash timeline-cli health timeline-cli ping ``` ### 生成视频 ```bash timeline-cli video generate \ --image "https://example.com/a.jpg:第一天" \ --image "https://example.com/b.jpg:第二天" \ --duration 3 ``` ### 列出视频 ```bash timeline-cli video list ``` ### 下载视频 ```bash timeline-cli video download timeline_20260415.mp4 --output ./my-video.mp4 timeline-cli video download timeline_20260415.mp4 -o ./my-video.mp4 # 简写 ``` ### 删除视频 ```bash timeline-cli video delete timeline_20260415.mp4 timeline-cli video delete timeline_20260415.mp4 --force # 不确认直接删除 ``` ### 配置管理 ```bash # 设置 API 地址 timeline-cli config set base-url http://192.168.0.43:29019 # 设置超时 timeline-cli config set timeout 300 # 获取配置 timeline-cli config get base-url # 显示全部配置 timeline-cli config show ``` ### ShowDoc 文档管理 ```bash # 发布 Markdown 页面到 ShowDoc timeline-cli showdoc add --title "daily-report" --content "# 今日总结\n完成了一些工作" # 简写形式 timeline-cli showdoc add -t "daily-report" -c "# Hello World" # JSON 格式输出 timeline-cli showdoc add -t "test" -c "# Test" --json # 根据标题获取 ShowDoc 页面 timeline-cli showdoc get --title "daily-report" # 简写形式 timeline-cli showdoc get -t "daily-report" # JSON 格式输出 timeline-cli showdoc get -t "daily-report" --json ``` 注意:`showdoc add` 会自动在标题后追加时间戳,格式为 `{title}-{yyyyMMddHHmmss}`(如 `daily-report-20260806143022`)。 ## 全局选项 | 选项 | 说明 | |------|------| | `--config` | 配置文件路径 | | `--base-url` | API 基础地址 | | `--verbose` | 详细输出 | | `--json` | JSON 格式输出 | | `--quiet`, `-q` | 静默模式 | | `--help`, `-h` | 显示帮助 | ## 环境变量 | 变量名 | 说明 | |--------|------| | `TIMELINE_API_BASE_URL` | API 基础地址 | | `TIMELINE_TIMEOUT` | 请求超时(秒) | | `TIMELINE_VERBOSE` | 详细输出 | | `SHOWDOC_API_KEY` | ShowDoc API Key | | `SHOWDOC_API_TOKEN` | ShowDoc API Token | | `SHOWDOC_BASE_URL` | ShowDoc 发布页面接口地址 | | `SHOWDOC_GET_PAGE_URL` | ShowDoc 获取页面接口地址 | | `SHOWDOC_CAT_NAME` | ShowDoc 默认分类名 | ## 配置文件 位置:`~/.config/timeline-cli/config.yaml` ```yaml base_url: http://192.168.0.43:29019 timeout: 300 verbose: false showdoc_api_key: your-api-key showdoc_api_token: your-api-token showdoc_base_url: http://42.194.163.46:9511/server/index.php?s=/api/item/updateByApi showdoc_get_page_url: http://42.194.163.46:9511/server/index.php?s=/api/open/getPage showdoc_cat_name: 文档 ```