jina-cli について
jina-cliは、ウェブページの読み取りとAI検索を行うコマンドラインツールです。調査やLLMのワークフロー向けに、URLの一括処理、複数の出力形式、サイト指定検索、設定管理を備えています。
主な機能
- 01URLからのコンテンツ抽出
- 02AIによる検索結果処理
- 03URLの一括読み取り
- 04Markdown、HTML、テキスト形式
- 05サイトを指定した検索
- 06設定とプロキシの管理
活用シーン
- 01ウェブ記事をLLM向けに変換
- 02トピック検索と結果コンテンツの取得
- 03URL一覧の一括処理
- 04画像キャプション付きでSNS投稿を読む
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ geekjourneyx/ jina-cli --skill jina-cliインストール後、Claude Code で/jina-cliを入力して読み込まれたか確認します。
詳細
jina - Web コンテンツの読み取りと検索
Web コンテンツの読み取りと、AI を活用した Web 検索を行う CLI ツールです。
クイックスタート
インストール:
curl -fsSL https://raw.githubusercontent.com/geekjourneyx/jina-cli/main/scripts/install.sh | bash
基本的な使い方:
# Read a URL
jina read --url "https://example.com"
# Search the web
jina search --query "golang latest news"
コマンド
| コマンド | 用途 |
|---|---|
read | URL からコンテンツを抽出し、LLM に適した形式に変換します |
search | AI による検索結果の処理を伴う Web 検索を行います |
config | 設定を管理します(set/get/list/path) |
Read コマンド
任意の URL からコンテンツを抽出します。
# Basic read
jina read --url "https://example.com"
# Read with image captioning
jina read -u "https://x.com/user/status/123" --with-alt
# Batch process from file
jina read --file urls.txt
# Output as Markdown
jina read -u "https://example.com" --output markdown
# Save to file
jina read -u "https://example.com" --output-file result.md
レスポンス形式
--format を指定すると、API はコンテンツをさまざまな形式で返します。
markdown- デフォルト。LLM に適した Markdownhtml- 生の HTMLtext- プレーンテキストscreenshot- スクリーンショットの URL
高度なオプション
# Bypass cache
jina read -u "https://example.com" --no-cache
# Use proxy
jina read -u "https://example.com" --proxy "http://proxy.com:8080"
# CSS selector extraction
jina read -u "https://example.com" --target-selector "article.main"
# Wait for element to load
jina read -u "https://example.com" --wait-for-selector "#content"
# Forward cookies
jina read -u "https://example.com" --cookie "session=abc123"
# POST method for SPA with hash routing
jina read -u "https://example.com/#/route" --post
Search コマンド
検索上位の結果からコンテンツを自動取得して Web を検索します。
# Basic search
jina search --query "golang latest news"
# Restrict to specific sites
jina search -q "AI developments" --site techcrunch.com --site theverge.com
# Limit results
jina search -q "climate change" --limit 10
# Output format
jina search -q "news" --output markdown
サイトの絞り込み
複数の --site フラグを使用して、検索対象を特定のドメインに絞り込めます。
jina search -q "startup funding" --site techcrunch.com --site theverge.com --site wired.com
設定
設定ファイル:~/.jina-reader/config.yaml
優先順位:コマンド引数 > 環境変数 > 設定ファイル > デフォルト値
環境変数:
JINA_API_BASE_URL- Read API の URL(デフォルト:https://r.jina.ai/)JINA_SEARCH_API_URL- Search API の URL(デフォルト:https://s.jina.ai/)JINA_TIMEOUT- リクエストのタイムアウト(秒)(デフォルト:30)JINA_WITH_GENERATED_ALT- 画像のキャプション生成を有効化(デフォルト:false)JINA_OUTPUT_FORMAT- 出力形式:json/markdown(デフォルト:json)JINA_PROXY_URL- プロキシサーバーの URL
設定コマンド:
# Set configuration
jina config set timeout 60
jina config set with-generated-alt true
# View configuration
jina config list
jina config get timeout
jina config path
出力形式
JSON 形式(デフォルト。機械可読):
{
"success": true,
"data": {
"url": "https://example.com",
"content": "# Extracted Content\n\n...",
"title": "Page Title"
}
}
Markdown 形式(人間が読みやすい形式):
jina read -u "https://example.com" --output markdown
よくある使用例
ソーシャルメディアの投稿を読む
# X (Twitter) posts
jina read -u "https://x.com/elonmusk/status/123456" --with-alt
# The --with-alt flag enables VLM image captioning for embedded images
記事やブログを読む
# Standard article
jina read -u "https://blog.example.com/article"
# With specific format
jina read -u "https://example.com" --format text --output markdown
リサーチのワークフロー
# 1. Search for topic
jina search -q "quantum computing 2025" --limit 10
# 2. Read specific results
jina read --file search_results.txt
バッチ処理
1 行につき 1 つの 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 --output markdown
プロジェクト構成
cli/
├── main.go # Root command
├── read.go # read command
├── search.go # search command
├── config.go # config command
└── pkg/
├── api/client.go # Jina API HTTP client
├── config/ # Config file management
└── output/ # JSON/Markdown formatter
実装に関する注意事項
- Go 1.24 以降が必要です
- Cobra を除き、依存関係はありません
- 単一バイナリとして配布します
- 設定はシンプルな
key=value形式で保存されます(YAML ライブラリへの依存はありません)
API の詳細については、cli/pkg/api/client.go を参照してください。
コメント
Markdown 対応