buku — Bookmark Manager
CLI bookmark manager with SQLite backend. Always use --nostdin and --np flags to prevent interactive prompts.
Common Operations
Add bookmark
buku --nostdin -a "URL" --tag tag1,tag2 --title "Title" -c "Description"
Omit
--title to auto-fetch from web. Use
--offline to skip fetching.
Search
CODEBLOCK1
List/Print
CODEBLOCK2
List all tags
CODEBLOCK3
Update bookmark
CODEBLOCK4
Delete
CODEBLOCK5
Import/Export
CODEBLOCK6
Tag management
CODEBLOCK7
Important Notes
- - Always use
--nostdin as first arg to prevent waiting for input - Always use
--np for search/print to skip interactive prompt - Use
--tacit for delete operations to skip confirmation - Use
-j for JSON output when parsing results programmatically - DB location: INLINECODE8
buku — 书签管理器
基于SQLite后端的命令行书签管理器。始终使用--nostdin和--np标志来防止交互式提示。
常用操作
添加书签
bash
buku --nostdin -a URL --tag tag1,tag2 --title 标题 -c 描述
省略--title可从网页自动获取标题。使用--offline可跳过获取过程。
搜索
bash
任意关键词
buku --nostdin --np -s 关键词1 关键词2
全部关键词
buku --nostdin --np -S 关键词1 关键词2
按标签(逗号表示任意匹配,加号表示全部匹配)
buku --nostdin --np -t tag1,tag2
buku --nostdin --np -t tag1+tag2
正则表达式
buku --nostdin --np -r 模式
深度搜索(子串匹配)
buku --nostdin --np -s 关键词 --deep
列出/打印
bash
最近N个书签
buku --nostdin --np -p -5
所有书签
buku --nostdin --np -p
指定索引
buku --nostdin --np -p 42
JSON输出(推荐用于解析)
buku --nostdin --np -p -j
限制字段:1=URL,2=URL+标签,3=标题,4=URL+标题+标签,5=标题+标签
buku --nostdin --np -p -f 4
列出所有标签
bash
buku --nostdin --np -t
更新书签
bash
更新指定索引的字段
buku --nostdin -u 索引 --url 新URL --title 新标题 --tag tag1,tag2
追加标签
buku --nostdin -u 索引 --tag + 新标签1,新标签2
移除标签
buku --nostdin -u 索引 --tag - 旧标签
从网页刷新标题/描述
buku --nostdin -u 索引
删除
bash
按索引删除(使用--tacit跳过确认)
buku --nostdin --tacit -d 索引
范围删除
buku --nostdin --tacit -d 10-20
导入/导出
bash
从浏览器导入
buku --nostdin --ai
从文件导入(.html、.md、.json、.org、.db)
buku --nostdin -i bookmarks.html
导出为Markdown
buku --nostdin -e bookmarks.md
导出搜索结果
buku --nostdin -s 关键词 -e results.md
标签管理
bash
全局替换标签
buku --nostdin --replace 旧标签 新标签
全局删除标签
buku --nostdin --replace 旧标签
重要提示
- - 始终将--nostdin 作为第一个参数,防止等待输入
- 搜索/打印时始终使用--np 跳过交互式提示
- 删除操作使用--tacit 跳过确认
- 程序化解析结果时使用-j 获取JSON输出
- 数据库位置:~/.local/share/buku/bookmarks.db