> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olostep.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Olostep CLI

> コマンドラインインターフェースでスクレイプ、検索、マップ、クロール、回答、バッチを実行 — スクリプト、CI、AIエージェント向けのJSON出力

**NPMパッケージ:** [olostep-cli](https://www.npmjs.com/package/olostep-cli)
**リポジトリ:** [github.com/olostep-api/olostep-cli](https://github.com/olostep-api/olostep-cli)

[Olostep API](https://www.olostep.com/)用のCLI — ターミナルからウェブを**スクレイプ**、**検索**、**マップ**、**クロール**、**回答**、**バッチ**。すべてのコマンドが**JSON**を返し、`jq`、エージェント、CIにクリーンにパイプできます。

純粋なJavaScript、Node 18+、ダウンロードするネイティブバイナリなし。1秒未満でインストール、約200msで起動、約100KBの単一バンドルとして提供。

## インストール

**要件:** Node.js **18+**。

<Tabs>
  <Tab title="npm (推奨)">
    ```bash theme={null}
    npm install -g olostep-cli
    olostep init
    ```
  </Tab>

  <Tab title="ワンライナー (macOS / Linux)">
    ```bash theme={null}
    curl -fsSL https://olostep.com/install.sh | sh
    olostep init
    ```

    スクリプトはNode 18+をチェックし、`npm install -g olostep-cli`を実行し、必要に応じて`sudo`にフォールバックします。
  </Tab>

  <Tab title="ワンライナー (Windows)">
    ```powershell theme={null}
    iwr -useb https://olostep.com/install.ps1 | iex
    olostep init
    ```

    macOS/Linuxスクリプトと同じ考え方ですが、PowerShell用です。
  </Tab>

  <Tab title="インストールなし (npx)">
    ```bash theme={null}
    npx -y olostep-cli@latest --help
    ```

    グローバルインストールなしで単一のコマンドを試すのに適しています。
  </Tab>
</Tabs>

`olostep init`は推奨される次のステップです — サインインし、OlostepスキルをAIエージェントにインストールし、MCPサーバーを設定します。ワンライナースクリプトは、Node 18+チェックと`sudo`フォールバックを含む`npm install -g olostep-cli`をラップしているため、ローカル設定が不明な場合でも動作します。

**プラットフォーム:** macOS (Apple SiliconとIntel)、Linux (x64とarm64)、Windows (x64とarm64)。

## セットアップ

1つのコマンドですべてを実行 — サインイン、スキルのインストール、MCPサーバーのインストール：

```bash theme={null}
olostep init
```

フラグ: `--skills-only`, `--mcp-only`, `--no-browser`, `--relogin`.

**サインインのみ**を行う場合（スキル/MCPなし）：

```bash theme={null}
olostep login
olostep login --no-browser     # URLを表示（SSH経由で便利）
```

ブラウザがOlostep認証ページを開き、**Authorize**をクリックすると、CLIがローカルにキーを保存します。

**代替方法 — 環境変数を設定。** CIに適しています：

```bash theme={null}
export OLOSTEP_API_KEY=your_key_here
```

[APIキーのダッシュボード](https://www.olostep.com/dashboard/api-keys)からキーを取得します。

**キーの保存場所**（`olostep login`後）：

| OS      | パス                                                           |
| ------- | ------------------------------------------------------------ |
| macOS   | `~/Library/Application Support/olostep-cli/credentials.json` |
| Linux   | `~/.config/olostep-cli/credentials.json`                     |
| Windows | `%USERPROFILE%\AppData\Roaming\olostep-cli\credentials.json` |

## サインアウト

```bash theme={null}
olostep logout            # 確認を促し、credentials.jsonを削除
olostep logout --dry-run  # プレビューのみ — 何が起こるかを見る
olostep logout --yes      # 確認をスキップ（スクリプト用）
olostep logout --json     # 機械可読な出力
```

`logout`は、`OLOSTEP_API_KEY` / `OLOSTEP_API_TOKEN`環境変数や現在のディレクトリにある`.env`ファイルがまだキーを保持している場合に警告します — これらはcredentialsファイルより優先されるため、ファイルを削除するだけでは不十分かもしれません。出力には、PowerShellとbash/zsh用の正確なunsetコマンドが含まれています。

## クイックスタート

```bash theme={null}
olostep login

olostep search "best web scraping APIs 2025" --limit 5
olostep answer "What does Olostep do?"
olostep map "https://example.com" --top-n 20
olostep scrape "https://example.com" --formats markdown
olostep crawl "https://docs.example.com" --max-pages 50
olostep batch-scrape urls.csv --formats markdown,html
```

すべてのコマンドはデフォルトでそのJSON結果をstdoutに出力します。`--out <path>`を指定してファイルに保存します。

## 何ができるのか？

| あなたがしたいこと       | コマンド                            | Olostep製品                                       |
| --------------- | ------------------------------- | ----------------------------------------------- |
| ウェブを検索          | `search`                        | [Searches](/features/search)                    |
| 調査された回答を得る      | `answer`                        | [Answers](/features/answers)                    |
| サイト上のURLを発見     | `map`                           | [Maps](/features/maps)                          |
| 1ページを取得         | `scrape`                        | [Scrapes](/features/scrapes)                    |
| サイト上のすべてのページを取得 | `crawl`                         | [Crawls](/features/crawls)                      |
| CSVから複数のURLを取得  | `batch-scrape`                  | [Batches](/features/batches)                    |
| 構造化されたフィールドを抽出  | `--parser-id` on `batch-scrape` | [Parsers](/features/structured-content/parsers) |
| IDで結果を再取得       | `scrape-get`                    | [Scrapes](/features/scrapes)                    |
| バッチをタグ付け/整理     | `batch-update`                  | [Batches](/features/batches)                    |

## 出力

すべてのコマンドはデフォルトでそのJSON結果を**stdout**に出力します。

| フラグ            | 動作                                |
| -------------- | --------------------------------- |
| *(なし)*         | JSONを**stdout**に出力（UTF-8、インデント付き） |
| `--out <path>` | そのファイルにJSONを書き出す                  |
| `--out -`      | 明示的にstdout（デフォルトと同じ）              |

進行状況とログ行は**stderr**に送られるため、stdoutはパイプ用にクリーンに保たれます。

```bash theme={null}
olostep map "https://example.com" --top-n 20 | jq '.urls[:10]'
olostep scrape "https://example.com" | jq .result.markdown_content
olostep search "topic" --json | jq '.links[].url'
```

**選択する際のポイント:**

* **`search`** — クエリに対する関連するURLとスニペットのリストが欲しい場合。CLIがウェブを検索します。
* **`answer`** — 生のページコンテンツではなく、合成された回答が欲しい場合。CLIが調査を行います。
* **`scrape`** — すでにURLを持っていて、クリーンなコンテンツを取得したい場合。
* **`crawl`** — サイト上のすべてのページ（またはフィルタされたサブセット）を手動でURLを列挙せずに取得したい場合。
* **`batch-scrape`** — URLのリストを持っていて、それらを並行して処理したい場合。

## コマンド

すべてのオプションについては`olostep <command> --help`を使用してください。

### `search`: ライブウェブ検索

重複を排除したオーガニックリンク（URL、タイトル、説明）を返します。

| オプション               | 説明                    |
| ------------------- | --------------------- |
| `--limit`           | 結果の数、デフォルト12、最大25     |
| `--include-domains` | 結果を制限するためのカンマ区切りのドメイン |
| `--exclude-domains` | 除外するカンマ区切りのドメイン       |
| `--out`             | ファイルまたは`-`            |
| `--json`            | 機械可読な出力               |

```bash theme={null}
olostep search "TypeScript CLI tools" --limit 10
olostep search "open source projects" --include-domains "github.com" --limit 5
olostep search "AI agents" --json | jq '.links[].url'
```

### `answer`: 調査された回答

同期 — 回答が準備できたら返します。

| オプション           | 説明                    |
| --------------- | --------------------- |
| `--out`         | ファイルまたは`-`            |
| `--json-format` | 構造化出力のためのオプションのJSON形式 |

```bash theme={null}
olostep answer "What does this company build?" --out answer.json
olostep answer "Extract facts" --json-format '{"company":"","year":""}' --out -
```

### `map`: URLを発見

| オプション                                            | 説明                |
| ------------------------------------------------ | ----------------- |
| `--out`                                          | ファイルパスまたは`-`      |
| `--top-n`                                        | 返す最大URL数          |
| `--search-query`                                 | 発見を導くためのオプションのクエリ |
| `--include-subdomain` / `--no-include-subdomain` | サブドメイン            |
| `--include-url` / `--exclude-url`                | 繰り返し可能なURLパターン    |
| `--cursor`                                       | ページネーションカーソル      |

```bash theme={null}
olostep map "https://example.com" --top-n 100 --search-query "blog"
```

### `scrape`: 1つのURL

**フォーマット:** `html`, `markdown`, `text`, `json`, `raw_pdf`, `screenshot`（カンマ区切り; デフォルトは`markdown`）。

| オプション                               | 説明                                                                                            |
| ----------------------------------- | --------------------------------------------------------------------------------------------- |
| `--formats`                         | カンマ区切り                                                                                        |
| `--country`                         | 国コード（例: `US`, `GB`）                                                                           |
| `--wait-before-scraping`            | スクレイプ前の待機時間（ms）                                                                               |
| `--payload-json` / `--payload-file` | JSONとしての高度なオプション（例: `"max_age": 86400`でキャッシュにオプトイン — [Caching](/features/scrapes#caching)を参照） |

```bash theme={null}
olostep scrape "https://example.com" --formats markdown,html
olostep scrape "https://example.com" --payload-file options.json --out -
```

### `scrape-get`: IDで取得

```bash theme={null}
olostep scrape-get "scrape_abc123" --out -
```

### `crawl`: サイト全体

クロールを開始し、完了するまでポーリングし、ページコンテンツを取得します。

**取得フォーマット:** `markdown`, `html`, `json`.

注目すべきフラグ: `--max-pages`, `--max-depth`, `--include-subdomain`, `--include-external`, `--include-url`, `--exclude-url`, `--search-query`, `--top-n`, `--webhook`, `--crawl-timeout`, `--formats`, `--pages-limit`, `--pages-search-query`, `--poll-seconds`, `--poll-timeout`, `--dry-run`.

```bash theme={null}
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`\*\*列を持つヘッダ行が必要です。

```csv theme={null}
custom_id,url
example,https://example.com
iana,https://iana.org
docs,https://docs.olostep.com
```

| オプション                                            | 説明                                 |
| ------------------------------------------------ | ---------------------------------- |
| `--formats`                                      | `markdown`, `html`, `json`（カンマ区切り） |
| `--country`                                      | オプションの国コード                         |
| `--parser-id`                                    | 構造化抽出のためのパーサID                     |
| `--poll-seconds`, `--log-every`, `--items-limit` | ポーリングとページング                        |
| `--dry-run`                                      | ペイロードを表示して終了                       |

```bash theme={null}
olostep batch-scrape urls.csv --formats markdown,html
olostep batch-scrape urls.csv --parser-id "<PARSER_ID>" --out results.json
```

同期 — バッチが完了するまでポーリングし、その後すべてのアイテムを取得します。

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

**`--metadata-json`または`--metadata-file`（JSONオブジェクト）のいずれかが必要です。**

```bash theme={null}
olostep batch-update "batch_abc123" --metadata-json '{"team":"growth"}'
olostep batch-update "batch_abc123" --metadata-file meta.json
```

## 認証コマンド

```bash theme={null}
olostep login                      # ブラウザPKCEサインイン
olostep logout                     # 保存された資格情報を削除
olostep status                     # 認証状態、設定パス、バージョンを表示

olostep auth login                 # olostep loginと同じ
olostep auth logout                # olostep logoutと同じ
olostep auth status                # olostep statusと同じ
olostep auth set-key <key>         # APIキーを直接保存（ブラウザなし）
```

`auth set-key`はCIやスクリプトに便利です — ブラウザフローを経ずにキーを直接書き込みます。

## MCPサーバーのインストール

CLIはOlostep MCPサーバーをエージェントの設定に書き込みます — JSON編集不要。

```bash theme={null}
olostep mcp install                          # エージェントを検出し、ホストされたエンドポイント
olostep mcp install --agent cursor           # カーソルのみ
olostep mcp install --transport stdio        # ローカルnpxを使用（ホストされていない）
olostep mcp install --no-global              # 現在のプロジェクトに書き込み
olostep mcp install --dry-run --json         # プランのみ
olostep mcp uninstall                        # olostepエントリを削除
olostep list mcp                             # どのエージェントが持っているかを表示
```

| オプション                              | 説明                                                                                                                                |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `--agent`                          | 特定のエージェント、繰り返し可能。サポートされているもの: `cursor`, `claude`, `claude-desktop`, `windsurf`, `vscode`, `kilo`, `opencode`, `continue`, `codex` |
| `--all-agents` / `--no-all-agents` | 検出されたすべてのエージェントを対象（デフォルト）                                                                                                         |
| `--transport`                      | `http`（ホストされている、推奨）または`stdio`（ローカル`npx olostep-mcp`）                                                                              |
| `--global` / `--no-global`         | ユーザーごとの設定（デフォルト）対プロジェクトローカル                                                                                                       |
| `--api-key`                        | 埋め込むキー; デフォルトは解決された資格情報                                                                                                           |
| `--dry-run`                        | プランを表示して書き込みなし                                                                                                                    |
| `--json`                           | 機械可読な出力                                                                                                                           |

ホストされたエンドポイント`https://mcp.olostep.com/mcp`は`Authorization: Bearer <key>`を使用します — ローカルNodeプロセスは不要です。CLIは既存の設定に`olostep`キーのみをマージします。インストール後にエージェントを再起動してください。

## AIエージェントのスキル

CLIは**13のOlostepスキル**を提供します — Claude Code、Cursor、その他のエージェントにインストールされ、Olostepが何をできるか、いつ使用するかを知ることができます。

```bash theme={null}
olostep add skills                     # 検出されたすべてのエージェントにインストール
olostep skills install                 # 同じ（エイリアス）
olostep skills update                  # すべてのスキルを再インストール/更新
olostep skills list                    # インストールされているものとその場所を表示
olostep skills uninstall               # すべてのスキルを削除
```

インストールするものをフィルタリング：

```bash theme={null}
olostep add skills --category usage    # コアウェブデータスキルのみ
olostep add skills --skill scrape --skill map
olostep add skills --agent cursor --agent claude
```

完全なリストとオプションについては[Skills](/features/skills)を参照してください。

## ヘルスチェック

```bash theme={null}
olostep doctor                         # すべてのチェックを実行
olostep doctor --skip-network          # 認証+設定のみ、HTTPコールなし
olostep doctor --json                  # NDJSON — チェックごとに1レコード（CIに適しています）
olostep doctor --fail-on-warn          # 警告でもexit 1
```

チェック: APIキーの存在、APIキーの到達可能性、MCPエンドポイントの到達可能性、検出された各エージェントの設定ファイルの存在。

CI使用法:

```bash theme={null}
olostep doctor --json --skip-network | jq 'select(.status == "fail")'
```

## バージョンと更新

```bash theme={null}
olostep version                        # CLIバージョン、Nodeバージョン、チャンネル
olostep version --json                 # 機械可読: { cli, node, channel }
olostep update                         # 最新に更新（npm install -g olostep-cli@latest）
olostep update --check                 # 新しいバージョンが利用可能かどうかを確認し、インストールしない
```

## 環境変数

| 変数                          | 効果                                    |
| --------------------------- | ------------------------------------- |
| `OLOSTEP_API_KEY`           | APIキー                                 |
| `OLOSTEP_API_TOKEN`         | APIキー（レガシーエイリアス）                      |
| `OLOSTEP_JSON=1`            | すべてのコマンドでJSON出力を強制（グローバルに`--json`と同じ） |
| `OLOSTEP_NO_UPDATE_CHECK=1` | "更新可能"通知を無音化                          |
| `OLOSTEP_CLI_CONFIG_DIR`    | 資格情報ディレクトリをオーバーライド                    |

## Windows / PowerShellの注意点

PowerShellは`,`と`*`をbashとは異なる方法でトークン化します — 引数を引用符で囲んでください：

```powershell theme={null}
olostep scrape "https://example.com" --formats "markdown,html"
olostep map   "https://example.com" --include-url "/*"
olostep answer "Extract facts" --json-format '{"company":"","year":""}'
```

JSON値にはシングルクォートが最も安全です（`$`の補間なし）。

## インストールされているものを確認

```bash theme={null}
olostep list skills    # インストールされたOlostepスキルとどのエージェントが持っているか
olostep list mcp       # どのエージェントがOlostep MCPサーバーを持っているか、そしてトランスポート
```

## グローバルフラグ

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

`--out`, `--timeout`, および `--api-key`はすべてのデータコマンドで利用可能です。

## セキュリティ

APIキーをソース管理から外し、漏洩した場合はローテーションしてください。`olostep logout`はローカルの資格情報ファイルを削除し、環境変数のソースがまだキーを保持しているかどうかを通知します。

## 関連

* [Maps](/features/maps) · [Crawls](/features/crawls) · [Batches](/features/batches) · [Answers](/features/answers) · [Searches](/features/search) · [Skills](/features/skills) · [MCP Server](/integrations/mcp-server)
