Skip to content

feat(weread): add ai-outline command#1141

Merged
jackwener merged 2 commits intojackwener:mainfrom
lw-yang:feat/weread-ai-outline
Apr 22, 2026
Merged

feat(weread): add ai-outline command#1141
jackwener merged 2 commits intojackwener:mainfrom
lw-yang:feat/weread-ai-outline

Conversation

@lw-yang
Copy link
Copy Markdown
Contributor

@lw-yang lw-yang commented Apr 22, 2026

Summary

  • Add weread ai-outline command that fetches AI-generated hierarchical outlines for books
  • Two-step API: authenticated chapterInfos → public outline endpoint
  • Dual output modes: human-readable (grouped by chapter) and --raw (structured rows for AI)
  • --depth flag to control detail level (2=topics, 3=key points, 4=details)

Details

API Flow

  1. POST /web/book/chapterInfos (needs login cookies) → chapter UIDs
  2. POST /web/book/outline (public, no auth) → hierarchical outline with levels 1-4

Output Examples

Default (opencli weread ai-outline <book-id>):

📖 第一章 童年
1. 朱元璋的童年经历
  1.1 朱元璋出生于贫苦农民家庭
    1.1.1 朱元璋出生时,红光满地,夜间房屋中出现异光。

Structured (opencli weread ai-outline <book-id> --raw):

- chapter: 第一章 童年
  idx: '1.1'
  level: 3
  text: 朱元璋出生于贫苦农民家庭

Test plan

  • Tested with book 822995 (88 chapters, 5975 outline items)
  • Verified no VIP required — only a logged-in weread.qq.com session
  • --depth 3 correctly filters out L4 detail items
  • --raw outputs structured chapter/idx/level/text rows
  • L4 items auto-assigned sub-indexes (e.g. 1.1.1, 1.1.2)

Closes #1140

🤖 Generated with Claude Code

lw-yang and others added 2 commits April 22, 2026 11:58
Two-step API flow: fetch chapter UIDs via authenticated chapterInfos,
then retrieve hierarchical AI outline from public outline endpoint.

Supports --depth to control detail level (2=topics, 3=key points,
4=full details) and --raw for structured output (chapter/idx/level/text)
suitable for programmatic consumption.

Closes jackwener#1140

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jackwener jackwener merged commit 00d5413 into jackwener:main Apr 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(weread): add ai-outline command for AI-generated book outlines

2 participants