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

# WebSearch

> Web search fallback for third-party providers

# WebSearch Fallback

Third-party profiles cannot use Anthropic's native WebSearch. CCS provides automatic web search via CLI tools with intelligent fallback.

## Overview

CCS intercepts WebSearch requests from Claude Code and routes them through available CLI tools.

> [tab] Dark Theme
>
> ![WebSearch Configuration - Dark](https://mintcdn.com/ccs-7e541244/ZIh-b3XKOoSIE-qm/assets/screenshots/websearch.webp?fit=max\&auto=format\&n=ZIh-b3XKOoSIE-qm\&q=85\&s=a7c221c86fb69f8a40fd004b28dfb502)

> [tab] Light Theme
>
> ![WebSearch Configuration - Light](https://mintcdn.com/ccs-7e541244/ZIh-b3XKOoSIE-qm/assets/screenshots/websearch-light.webp?fit=max\&auto=format\&n=ZIh-b3XKOoSIE-qm\&q=85\&s=133e84ddab7e1385e86b577a97949f6e)

## How It Works

| Profile Type | WebSearch Method |
| - | - |
| Claude (native) | Anthropic WebSearch API |
| Third-party profiles | CLI Tool Fallback Chain |

## Fallback Chain

CCS tries tools in priority order until one succeeds:

| Priority | Tool | Auth | Install |
| - | - | - | - |
| 1st | Gemini CLI | OAuth (free) | `npm install -g @google/gemini-cli` |
| 2nd | OpenCode | OAuth (free) | `curl -fsSL https://opencode.ai/install \| bash` |
| 3rd | Grok CLI | API Key | `npm install -g @vibe-kit/grok-cli` |

## Configuration

Configure via dashboard (**Settings** page) or `~/.ccs/config.yaml`:

```yaml theme={null}
websearch:
  enabled: true                    # Enable/disable (default: true)
  providers:
    gemini:
      enabled: true                # Use Gemini CLI (default: true)
      model: gemini-2.5-flash      # Model to use
    opencode:
      enabled: true                # Use OpenCode as fallback
    grok:
      enabled: false               # Requires XAI_API_KEY
```

CCS resolves one configuration snapshot for each new Claude launch. Provisioning,
hook environment, and steering for that launch all use the same snapshot; a later
config edit does not change the already prepared session.

If you set `websearch.enabled: false`, third-party Claude launches still keep
native `WebSearch` disallowed. CCS omits its steering prompt and marks the
managed hook to skip execution for that launch, so no active WebSearch hook state
or provider fallback runs.

## Setup

**1. Install Gemini CLI**

```bash theme={null}
npm install -g @google/gemini-cli
```

**2. Authenticate**

Run once to complete OAuth:

```bash theme={null}
gemini
```

**3. Verify**

Check that websearch works:

```bash theme={null}
ccs codex "search for the latest TypeScript features"
```

## Provider Details

> [accordion] Gemini CLI (Recommended)
>
> * **Auth**: Free Google OAuth
> * **Limit**: 1000 requests/day
> * **Quality**: Excellent search relevance
> * **Setup**: `gemini` to authenticate via browser

> [accordion] OpenCode
>
> * **Auth**: Free OAuth
> * **Limit**: Varies
> * **Quality**: Good for code-related searches
> * **Setup**: Follow installer prompts

> [accordion] Grok CLI
>
> * **Auth**: Requires `XAI_API_KEY`
> * **Limit**: Based on API plan
> * **Quality**: Real-time web access
> * **Setup**: Set env var and install

## Troubleshooting

> [accordion] Search not working
>
> Verify CLI tools are installed:
>
> ```bash theme={null}
> which gemini opencode grok
> ```

> [accordion] Auth errors
>
> Re-authenticate the failing tool:
>
> ```bash theme={null}
> gemini  # Opens browser for OAuth
> ```

> [accordion] Slow responses
>
> Switch to a faster fallback:
>
> ```yaml theme={null}
> websearch:
>   providers:
>     gemini:
>       model: gemini-2.0-flash-lite
> ```

> [!TIP]
>
> **Gemini CLI** is recommended - free OAuth authentication with 1000 requests/day. Just run `gemini` once to authenticate via browser.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.