by geekjourneyx
A lightweight CLI tool wrapping Jina AI Reader API for AI Agents. Fetch and parse any URL into LLM-friendly formats (Markdown/Text/HTML). Perfect for reading X(Twitter), blogs, and news sites.
# Add to your Claude Code skills
git clone https://github.com/geekjourneyx/jina-clijina 是一个轻量级的命令行工具,封装了 Jina AI Reader API,可以将任意 URL 转换为 LLM 友好的输入格式。特别适合阅读 X (Twitter)、博客、新闻网站等复杂网页。
核心功能:
jina 有三种独立的安装方式,根据你的使用场景选择:
什么是 OpenClaw?
OpenClaw 是一个本地 AI 助理(可以理解为"有终端权限的 Claude"),运行在你的机器上。它通过 Skills 插件扩展能力,支持 9000+ 个技能插件。
适用场景:本地 AI 助理、自动化工作流、文件系统操作
安装方式 - 直接复制 skill 文件:
# 创建 jina-cli skill 目录并下载
mkdir -p ~/.openclaw/workspace/skills/jina-cli
curl -o ~/.openclaw/workspace/skills/jina-cli/SKILL.md \
https://raw.githubusercontent.com/geekjourneyx/jina-cli/main/skills/jina-cli/SKILL.md
验证安装:
# 启动 OpenClaw
openclaw
# 在 OpenClaw 中直接使用 jina 命令
# skill 会自动从 ~/.openclaw/workspace/skills/jina-cli/ 加载
No comments yet. Be the first to share your thoughts!
你将获得:
jina read 和 jina search适用场景:在 Claude Code 中使用 AI 协助你处理网页内容
安装步骤:
# 1. 确保已安装 Node.js 和 Claude Code
node --version
# v18.0.0 或更高版本
# 2. 安装 jina skill
npx skills add https://github.com/geekjourneyx/jina-cli --skill jina-cli
安装后验证:
# 在 Claude Code 中可以直接使用
# 无需额外操作,skill 会自动加载
你将获得:
jina read 和 jina search 命令适用场景:在终端/脚本中使用,或与其他工具集成
curl -fsSL https://raw.githubusercontent.com/geekjourneyx/jina-cli/main/scripts/install.sh | bash
安装脚本会自动:
~/.local/bin/jina 或 ~/bin/jina# 检查是否安装成功
jina --version
# 预期输出: jina version 1.0.0 (构建时间: ..., 提交: ...)
# 测试基本功能
jina read --url "https://example.com"
如果自动安装失败,可以手动下载:
# 1. 下载对应平台的二进制
# Linux amd64:
wget https://github.com/geekjourneyx/jina-cli/releases/latest/download/jina-linux-amd64 -O jina
chmod +x jina
sudo mv jina /usr/local/bin/
# macOS ARM64 (Apple Silicon):
wget https://github.com/geekjourneyx/jina-cli/releases/latest/download/jina-darwin-arm64 -O jina
chmod +x jina
sudo mv jina /usr/local/bin/
# 2. 验证安装
jina --version
git clone https://github.com/geekjourneyx/jina-cli.git
cd jina-cli
go build -o jina ./cli
sudo mv jina /usr/local/bin/
| 特性 | OpenClaw Skill | Claude Code Skill | CLI 二进制 |
|------|----------------|-------------------|------------|
| 安装位置 | ~/.openclaw/workspace/skills/jina-cli/ | ~/.claude/skills/ | ~/.local/bin/jina |
| 使用环境 | OpenClaw 本地 AI 助理 | Claude Code | 任何终端/脚本 |
| AI 集成 | AI 自动理解功能 | AI 自动理解功能 | 需要手动调用 |
| 文件权限 | ✅ 可访问本地文件系统 | ❌ 受限 | ✅ 完整权限 |
| 脚本执行 | ✅ 可执行脚本 | ❌ 受限 | ✅ 完整权限 |
| 更新方式 | 重新下载/npx skills update | npx skills update | 重新运行安装脚本 |
| 适用场景 | 本地 AI 助理、自动化 | AI 辅助开发 | 脚本集成、日常使用 |
推荐选择:
注意:三种方式完全独立,可以同时安装,互不干扰。
# 读取单个 URL
jina read --url "https://example.com"
# 读取 X (Twitter) 帖子
jina read -u "https://x.com/user/status/123456789" --with-alt
# 输出 Markdown 格式
jina read -u "https://example.com" --output markdown
# 保存到文件
jina read -u "https://example.com" --output-file result.md
# 从文件读取 URL 列表
cat > urls.txt << EOF
https://example.com/page1
https://example.com/page2
https://x.com/user/status/123
EOF
jina read --file urls.txt
# 搜索关键词
jina search --query "golang latest news"
# 限定搜索站点
jina search -q "AI developments" --site techcrunch.com --site theverge.com
# 限制结果数量
jina search -q "climate change" --limit 10
配置文件位于 ~/.jina-reader/config.yaml:
# 查看所有配置
jina config list
# 设置配置项
jina config set timeout 60
jina config set with-generated-alt true
# 获取单个配置
jina config get timeout
# 查看配置文件路径
jina config path
| 配置项 | 环境变量 | 默认值 | 说明 |
|--------|----------|--------|------|
| api_base_url | JINA_API_BASE_URL | https://r.jina.ai/ | Read API 地址 |
| search_api_url | JINA_SEARCH_API_URL | https://s.jina.ai/ | Search API 地址 |
| default_response_format | JINA_RESPONSE_FORMAT | markdown | 响应格式 |
| default_output_format | JINA_OUTPUT_FORMAT | json | 输出格式 |
| timeout | JINA_TIMEOUT | 30 | 请求超时(秒) |
| with_generated_alt | JINA_WITH_GENERATED_ALT | false | 启用图片描述 |
| proxy_url | JINA_PROXY_URL | "" | 代理服务器 |
| api_key | JINA_API_KEY | "" | API 密钥(用于更高速率限制) |
优先级: 命令行参数 > 环境变量 > 配置文件 > 默认值
添加 API Key 可以获得更高的速率限制:
# 方式 1:配置文件设置
jina config set api_key jina_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 方式 2:环境变量
export JINA_API_KEY=jina_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 方式 3:命令行参数
jina read -u "https://example.com" -k jina_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
获取 API Key:访问 Jina AI Reader 注册并获取。
{
"success": true,
"data": {
"url": "https://example.com",
"title": "Example Domain",
"content": "# Example Domain\n\nThis domain is..."
}
}
jina read -u "https://example.com" --output markdown
输出:
# Example Domain
**Source**: https://example.com
---
# Example Domain
This domain is for use in illustrative examples...
jina read -u "https://example.com" --no-cache
jina read -u "https://example.com" --proxy "http://proxy.com:8080"
# 只提取指定元素
jina read -u "https://example.com" --target-selector "article.main"
# 等待元素加载
jina read -u "https://example.com" --wait-for-selector "#content"
# 对于带 hash 路由的 SPA,使用 POST 方法
jina read -u "https://example.com/#/route" --post
jina read -u "https://example.com" --cookie "session=abc123"
# 在 Claude Code 或其他 AI 工具中使用
jina read -u "https://x.com/elonmusk/status/123456" --output json
# 搜索最新信息
jina search -q "golang 1.24 release notes" --output json
jina - CLI tool for Jina AI Reader and Search APIs
Usage:
jina [command]
Available Commands:
read Extract and convert content from URLs
search Search the web with AI-powered results
config Manage configuration
completion Generate shell completion
help Help about any command
Flags:
-a, --api-base string API base URL (overrides config)
-k, --api-key string API key (overrides config)
-o, --output string Output format: json, markdown (default "json")
-v, --verbose Verbose output
-h, --help help for jina
--version version for jina
# 运行测试
go test ./...
# 运行测试并计算覆盖率
go test -cover ./...
# 构建
go build -o jina ./cli
# 交叉编译
GOOS=linux GOARCH=amd64 go build -o jina-linux-amd64 ./cli
GOOS=darwin GOARCH=arm64 go build -o jina-darwin-arm64 ./cli
GOOS=windows GOARCH=amd64 go build -o jina-windows-amd64.exe ./cli
jina-cli/
├── cli/
│ ├── main.go # 入口
│ ├── read.go # read 命令
│ ├── search.go # search 命令
│ ├── config.go # config 命令
│ └── pkg/
│ ├── api/ # HTTP 客户端
│ ├── config/ # 配置管理
│ └── output/ # 输出格式化
└── scripts/
└── install.sh # 安装脚本
如果该项目帮助了您,欢迎请作者喝杯咖啡 ☕️
微信打赏
关注公众号,获取更多 AI 编程、AI 工具与 AI 出海建站的实战分享:
jina is a lightweight CLI tool that wraps the Jina AI Reader API to convert any URL into LLM-friendly input. Perfect for reading X (Twitter), blogs, news sites, and other complex web pages.
Features:
jina offers two independent installation methods. Choose based on your use case:
Use case: Using jina within Claude Code with AI assistance
Installation steps:
# 1. Ensure Node.js and Claude Code are installed
node --version
# v18.0.0 or higher
# 2. Install jina skill
npx skills add https://github.com/geekjourneyx/jina-cli --skill jina-cli
Verify installation:
# You can now use jina commands directly in Claude Code
# No additional steps needed, skill loads automatically
You get:
✅ Direct access to jina read and jina search commands in Claude Code
✅ AI automatically understands jina's functionality
✅ No manual CLI binary installation required