Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clis/web/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cli({
{ name: 'download-images', type: 'boolean', default: true, help: 'Download images locally' },
{ name: 'wait', type: 'int', default: 3, help: 'Seconds to wait after page load' },
],
columns: ['title', 'author', 'publish_time', 'status', 'size'],
columns: ['title', 'author', 'publish_time', 'status', 'size', 'saved'],
func: async (page, kwargs) => {
const url = kwargs.url;
const waitSeconds = kwargs.wait ?? 3;
Expand Down
5 changes: 3 additions & 2 deletions clis/weixin/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ cli({
{ name: 'output', default: './weixin-articles', help: 'Output directory' },
{ name: 'download-images', type: 'boolean', default: true, help: 'Download images locally' },
],
columns: ['title', 'author', 'publish_time', 'status', 'size'],
columns: ['title', 'author', 'publish_time', 'status', 'size', 'saved'],
func: async (page, kwargs) => {
const rawUrl = kwargs.url;
Comment on lines +182 to 184
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columns adds the new saved field, but not all return paths in this command include it. In particular, the invalid-URL early return a few lines below returns an object without saved, which makes output schema inconsistent. Update that return object to include saved: '-' as well.

Copilot uses AI. Check for mistakes.
const url = normalizeWechatUrl(rawUrl);
if (!url.startsWith('https://mp.weixin.qq.com/')) {
return [{ title: 'Error', author: '-', publish_time: '-', status: 'invalid URL', size: '-' }];
return [{ title: 'Error', author: '-', publish_time: '-', status: 'invalid URL', size: '-', saved: '-' }];
}
// Navigate and wait for content to load
await page.goto(url);
Expand Down Expand Up @@ -297,6 +297,7 @@ cli({
publish_time: '-',
status: 'failed — verification required in WeChat browser page',
size: '-',
saved: '-',
}];
}
return downloadArticle({
Expand Down
6 changes: 3 additions & 3 deletions skills/opencli-usage/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Public API commands (`hackernews`, `v2ex`) need no browser.
| **post/create** | Twitter, Jike, Douyin, Weibo |
| **AI chat** | Grok, Doubao, ChatGPT, Gemini, Cursor, Codex, NotebookLM |
| **finance/stock** | Xueqiu, Yahoo Finance, Barchart, Sina Finance, Bloomberg |
| **web scraping** | `opencli web read --url <url>` — any URL to Markdown |
| **web scraping** | `opencli web read --url <url>` — any URL to Markdown (saves to local file, check `saved` field in output) |
| **GitHub/DevOps** | `opencli gh`, `opencli docker`, `opencli vercel` — external CLI passthrough |
| **collaboration** | `opencli lark-cli`, `opencli dws`, `opencli wecom-cli` — external CLI passthrough |

Expand Down Expand Up @@ -118,9 +118,9 @@ Type legend: 🌐 = Browser (needs Chrome login) · ✅ = Public API (no browser
| **tiktok** | 🌐 | `explore` `search` `profile` `user` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `live` `notifications` `friends` |
| **twitter** | 🌐 | `trending` `bookmarks` `search` `profile` `timeline` `thread` `article` `follow` `unfollow` `bookmark` `unbookmark` `post` `like` `likes` `reply` `delete` `block` `unblock` `followers` `following` `notifications` `hide-reply` `download` `accept` `reply-dm` |
| **v2ex** | ✅🌐 | Public: `hot` `latest` `topic` `node` `nodes` `member` `user` `replies` · Browser: `daily` `me` `notifications` |
| **web** | 🌐 | `read` — any URL to Markdown |
| **web** | 🌐 | `read` — any URL to Markdown (saves to local file, not stdout) |
| **weibo** | 🌐 | `hot` `search` `feed` `user` `me` `post` `comments` |
| **weixin** | 🌐 | `download` — 公众号 article to Markdown |
| **weixin** | 🌐 | `download` — 公众号 article to Markdown (saves to local file, not stdout) |
| **weread** | 🌐 | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` |
| **wikipedia** | ✅ | `search` `summary` `random` `trending` |
| **xianyu** | 🌐 | `search` `item` `chat` |
Expand Down
4 changes: 2 additions & 2 deletions skills/opencli-usage/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ opencli v2ex notifications --limit 10 # 通知
## Web 🌐

```bash
opencli web read --url "https://..." # 抓取任意网页并导出为 Markdown
opencli web read --url "https://..." # 抓取任意网页并导出为 Markdown(默认保存到 ./web-articles/,可用 --output 修改)
```

## Weibo (微博) 🌐
Expand All @@ -689,7 +689,7 @@ opencli weibo comments <mid> # 微博评论
## Weixin (微信公众号) 🌐

```bash
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" # 下载公众号文章为 Markdown
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" # 下载公众号文章为 Markdown(默认保存到 ./weixin-articles/,可用 --output 修改)
```

## WeRead (微信读书) 🌐
Expand Down
4 changes: 4 additions & 0 deletions src/download/article-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ArticleDownloadResult {
publish_time: string;
status: string;
size: string;
saved: string;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ArticleDownloadResult is exported from a shared module; adding a new required field (saved) is a TypeScript-breaking change for any downstream code that references this interface (even though runtime is backward-compatible). Consider making saved optional (saved?: string) to preserve type compatibility, while still populating it in all return paths for CLI output.

Suggested change
saved: string;
saved?: string;

Copilot uses AI. Check for mistakes.
}

const DEFAULT_LABELS: Required<FrontmatterLabels> = {
Expand Down Expand Up @@ -212,6 +213,7 @@ export async function downloadArticle(
publish_time: '-',
status: 'failed — no title',
size: '-',
saved: '-',
}];
}

Expand All @@ -222,6 +224,7 @@ export async function downloadArticle(
publish_time: data.publishTime || '-',
status: 'failed — no content',
size: '-',
saved: '-',
}];
}

Expand Down Expand Up @@ -268,5 +271,6 @@ export async function downloadArticle(
publish_time: data.publishTime || '-',
status: 'success',
size: formatBytes(size),
saved: filePath,
}];
}
Loading