/crawl4ai:setup
Set up the Crawl4AI plugin for Claude Code.
Instructions
Guide the user through setup:
- •
Check current config: Read
~/.crawl4ai/claude_config.jsonif it exists. Report current mode and whether API key is set. - •
Choose mode: Ask the user:
- •Cloud mode (default): Uses the Crawl4AI cloud API. Requires an API key from https://crawl4ai.com. Fast, no local browser needed.
- •Local mode: Uses OSS crawl4ai with a local Chromium browser. Free, no API key needed. Requires
pip install crawl4ai && crawl4ai-setup.
- •
Configure based on choice:
For cloud mode:
- •Ask for API key (starts with
sk_live_orsk_test_) - •Write config to
~/.crawl4ai/claude_config.json:json{"mode": "cloud", "api_key": "sk_live_xxx"} - •Or suggest setting
CRAWL4AI_API_KEYenv var
For local mode:
- •Check if crawl4ai is installed:
python3 -c "import crawl4ai; print(crawl4ai.__version__)" - •If not installed, run:
pip install crawl4ai && crawl4ai-setup - •Write config:
{"mode": "local"}
- •Ask for API key (starts with
- •
Verify setup: Use the
crawlMCP tool to crawl https://example.com. Confirm it returns markdown content. - •
Report status: Tell the user their setup is complete and which mode is active.