メインコンテンツへスキップ
NPMパッケージ: olostep-cli Olostep API用のCLI: mapanswerscrapescrape-getcrawlbatch-scrapebatch-update。レスポンスはスクリプト、CI、エージェント向けにJSON(整形済み)です。 このパッケージをインストールすると、OSに対応したスタンドアロンバイナリがダウンロードされます。olostepを実行するのにPythonは必要ありません。
インストール時に、ポストインストールステップでパッケージのGitHubリリースから対応するバイナリがダウンロードされます。失敗した場合は、このパッケージバージョンとプラットフォームに対応するリリースが存在することを確認し、再インストールしてください。

インストール

要件: Node.js 16+npm / npx のみ; CLI自体はネイティブバイナリです)。
npm install -g olostep-cli
グローバルインストールなしで実行:
npx -y olostep-cli@latest --help
プラットフォーム: macOS (Apple SiliconとIntel)、Linux x64、Windows x64。

APIキー

環境に**OLOSTEP_API_KEY**を設定するか、olostepを実行するディレクトリに.envファイルを作成してください。 キーの作成: Olostep API Keys
export OLOSTEP_API_KEY=your_key_here
olostep --help

出力

フラグ動作
--out <path>JSONをファイルに書き込む(必要なら親ディレクトリも作成)。
--out -JSONをstdoutのみに書き込む(UTF-8、インデント付き)。パイプやサブプロセスキャプチャに最適。
進行状況とログ行はstderrに出力されるため、stdoutは解析可能なままです。
olostep map "https://example.com" --top-n 20 --out - | jq '.urls[:10]'
olostep scrape "https://example.com" --out - | jq .result.markdown_content
--outを省略した場合、ファイルはoutput/に保存されます(デフォルトの--outパスを参照)。

コマンド

すべてのオプションについてはolostep <command> --helpを使用してください。ほとんどのコマンドは--timeout(HTTP、秒)を受け付けます。

map: URLの発見

オプション説明
--outファイルパスまたは-
--top-n最大URL数
--search-query発見をガイド
--include-subdomain / --no-include-subdomainサブドメイン
--include-url / --exclude-url繰り返し可能なパターン
--cursorページネーション
--limit(削除済み)ではなく--top-nを使用してください。
olostep map "https://example.com" --top-n 100 --search-query "blog"

answer: 調査済みの回答

回答が準備できるまでポーリングします。
オプション説明
--outファイルまたは-
--json-formatオプションの構造化出力ヒント(JSONオブジェクト文字列)
--poll-interval / --poll-timeoutポーリング(秒)
--model(削除済み)ではなく--json-formatを使用してください。
olostep answer "What does this company build?" --out answer.json
olostep answer "Extract facts" --json-format '{"company":"","year":""}' --out -

scrape: 1つのURL

フォーマット: htmlmarkdowntextjsonraw_pdfscreenshot(カンマ区切り; デフォルトはmarkdown)。
オプション説明
--formatsカンマ区切り
--country国コード
--wait-before-scrapingスクレイプ前に待機するミリ秒
--payload-json高度なオプションをJSONオブジェクト文字列として
--payload-file同じく、ファイルから(--payload-jsonと一緒には使用不可)
olostep scrape "https://example.com" --formats markdown,html
olostep scrape "https://example.com" --payload-file scrape-options.json --out -

scrape-get: スクレイプIDで

olostep scrape-get "scrape_abc123" --out -

crawl: サイトクロール

取得フォーマット: markdownhtmljson 注目すべきフラグ: --max-pages--max-depth--include-subdomain--include-external--include-url--exclude-url--search-query--top-n--webhook--crawl-timeout--follow-robots-txt / --ignore-robots-txt--formats--pages-limit--pages-search-query--poll-seconds--poll-timeout--dry-run(ペイロードを表示、リクエストなし)。
olostep crawl "https://docs.example.com" --max-pages 50 --formats markdown,html
olostep crawl "https://example.com" --max-pages 10 --dry-run

batch-scrape: CSV

CSV列: custom_idまたはid、および**url**。
オプション説明
--formatsmarkdownhtmljson
--countryオプション
--parser-id構造化抽出パーサー
--poll-seconds--log-every--items-limitポーリング / ページング
--dry-runペイロードのみを表示
olostep batch-scrape urls.csv --formats markdown,html

batch-update: バッチメタデータ

--metadata-jsonまたは--metadata-file(JSONオブジェクト)のいずれかが必要です。
olostep batch-update "batch_abc123" --metadata-json '{"team":"growth"}'

デフォルトの--outパス

--outを省略した場合:
コマンドデフォルト
mapoutput/map.json
answeroutput/answer.json
scrapeoutput/scrape.json
scrape-getoutput/scrape_get.json
crawloutput/crawl_results.json
batch-scrapeoutput/batch_results.json
batch-updateoutput/batch_update.json

グローバルフラグ

フラグ説明
-V, --versionバージョン
-h, --helpヘルプ

関連ドキュメント

リポジトリ: github.com/olostep-api/CLI

セキュリティ

APIキーはソース管理から外し、漏洩した場合はローテーションしてください。