> IMPORTANT: Before any operation, read the environment variable $ARTICLE_BOOKMARK_DIR to determine the bookmark storage directory. All bookmark files and the tag index must be stored under this path. If the variable is not set, prompt the user to configure it.
>
> When calling scripts/bookmark.sh, you must pass ARTICLE_BOOKMARK_DIR and ARTICLE_BOOKMARK_GITHUB as inline environment variables — the script runs in a subprocess and does not inherit them automatically.
When the user provides a URL or article text to bookmark:
scripts/bookmark.sh init to initialize the bookmark directory$ARTICLE_BOOKMARK_DIR to get the storage pathweb_fetch to get the article contentscripts/bookmark.sh save "Brief commit message" to commit and push changesFor deletion requests: find the article, confirm details with user, then remove, update index, and run scripts/bookmark.sh save "Delete article xxx".
1. Run scripts/bookmark.sh init
2. Read $ARTICLE_BOOKMARK_DIR
3. Receive URL or text content
4. Extract/save content (web_fetch for URLs)
5. Generate summary (model-based)
6. Auto-tag (keyword/topic analysis)
7. Create bookmark file (markdown format)
8. Update tag index
9. Run scripts/bookmark.sh save "Add article: <title>"
1. Run ARTICLE_BOOKMARK_DIR="$ARTICLE_BOOKMARK_DIR" ARTICLE_BOOKMARK_GITHUB="$ARTICLE_BOOKMARK_GITHUB" scripts/bookmark.sh init
2. Read $ARTICLE_BOOKMARK_DIR
3. Identify target article (by filename, topic, or content)
4. Display article details for confirmation
5. Get user confirmation
6. Delete bookmark file
7. Update tag index
8. Run ARTICLE_BOOKMARK_DIR="$ARTICLE_BOOKMARK_DIR" ARTICLE_BOOKMARK_GITHUB="$ARTICLE_BOOKMARK_GITHUB" scripts/bookmark.sh save "Delete article: <title>"
Generate tags by analyzing:
Maintain consistent tag vocabulary to avoid duplicates (e.g., use "AI" not "artificial-intelligence").
TAG_INDEX.md maintains bidirectional mapping (see file-structure.md for full format):
# Article Tag Index
## Tags
- **AI**: [article1](article1.md), [article2](article2.md)
- **Research**: [...]
## Articles by Tag Count
- 3 tags: [article1](article1.md)
- 1 tag: [...]
web_fetch with extractMode: "markdown" for web articlesmaxChars limits)https://github.com/user/repo), prioritize fetching the README content from the repository's main page or from README.md, readme.md, or README.rst files in the root directoryWhen fetching article content from URLs fails:
HTTP_PROXY or http_proxy: HTTP proxy URLHTTPS_PROXY or https_proxy: HTTPS proxy URLNO_PROXY or no_proxy: Comma-separated list of hosts to bypassExample environment variables:
export HTTP_PROXY="http://proxy.example.com:8080"
export HTTPS_PROXY="http://proxy.example.com:8080"
export NO_PROXY="localhost,127.0.0.1,.example.com"
Generate 2-3 paragraph summaries that capture:
Keep summaries informative but concise (typically 150-300 words).
Create SEO-friendly filenames:
共 2 个版本