# Dependencies for Running AI Berkshire: Complete Setup Guide

> Discover the essential dependencies for running AI Berkshire, including Python, Playwright, Claude Code or Codex CLI, Bash, and Git. Complete your setup with this guide.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: getting-started
- Published: 2026-06-29

---

**AI Berkshire requires Python ≥3.7, optional Playwright for web scraping, and either Claude Code or Codex CLI tools installed via Node.js/npm, along with Bash and Git.**

Setting up the **xbtlin/ai-berkshire** repository involves installing a minimal core runtime and selecting your preferred AI CLI client. Understanding the **dependencies for running AI Berkshire** ensures you can execute the financial analysis tools and research skills without environment errors.

## Core Runtime Dependencies

### Python ≥3.7 Standard Library

The foundation of AI Berkshire relies solely on Python's built-in modules. According to the source code in [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py), the scripts use only standard library components such as `argparse`, `json`, and `decimal` for financial calculations. No external Python packages are required for the core utilities.

### Bash Shell and Git

All installation scripts in the `scripts/` directory are POSIX-compatible Bash scripts that use `set -euo pipefail` for strict error handling. You will need **Git** to clone the repository and **Bash** (available natively on macOS/Linux, or via WSL on Windows) to execute the [`install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/install-claude-commands.sh) and [`install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/install-codex-skills.sh) scripts.

## Optional Web Scraping Dependencies

### Playwright for Xueqiu Scraper

If you plan to use the Xueqiu scraper functionality, you must install **Playwright**. The file [`tools/xueqiu_scraper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/xueqiu_scraper.py) imports `playwright.async_api` to drive a headless browser for data extraction. This dependency is only required for web scraping tasks.

Install Playwright:

```bash
pip install playwright
playwright install

```

## CLI Client Dependencies

You must choose between two AI CLI interfaces to interact with the 18 research skills provided by AI Berkshire.

### Claude Code Setup

Install **Claude Code** via npm to map the skill markdown files to executable commands. The script [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) copies the skill files into Claude Code's command directory.

```bash
npm install -g @anthropic-ai/claude-code

```

### Codex Setup

Alternatively, install **Codex** using either the official install script or npm. The [`scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-skills.sh) wrapper generates Codex skill packages and registers them with your CLI.

```bash

# Option 1: Install script

curl -fsSL https://chatgpt.com/codex/install.sh | sh

# Option 2: npm

npm install -g @openai/codex

```

## Quick Start Installation Guide

Follow these steps to install all **dependencies for running AI Berkshire**:

1. Clone the repository:

```bash
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire

```

2. Verify Python ≥3.7 is installed (most systems include this by default).

3. Install Playwright (optional, only for scraping):

```bash
pip install playwright
playwright install

```

4. Install your preferred CLI client:

```bash

# For Claude Code

npm install -g @anthropic-ai/claude-code

# For Codex

curl -fsSL https://chatgpt.com/codex/install.sh | sh

```

5. Register the skills:

```bash

# Claude Code users

./scripts/install-claude-commands.sh

# Codex users

./scripts/install-codex-skills.sh

# Optional: ./scripts/install-codex-prompts.sh

```

## Verifying Your Installation

Test the core utilities without external dependencies:

```bash
python3 tools/financial_rigor.py verify-market-cap \
  --price 510 --shares 9.11e9 --reported 4.65e12 --currency HKD

```

Test Playwright integration (if installed):

```bash
python3 tools/xueqiu_scraper.py --symbol 600519 --days 30

```

## Summary

- **Python ≥3.7** with standard library support is the only mandatory runtime requirement.
- **Playwright** is optional and only needed for [`tools/xueqiu_scraper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/xueqiu_scraper.py) functionality.
- **Node.js and npm** are required to install either Claude Code (`@anthropic-ai/claude-code`) or Codex (`@openai/codex`).
- **Bash** and **Git** are necessary for cloning and executing installation scripts.
- Core tools like [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) run without external Python packages.

## Frequently Asked Questions

### Do I need Node.js to run AI Berkshire?

Yes, if you want to use the AI CLI clients. Node.js is required to install either Claude Code via `@anthropic-ai/claude-code` or Codex via `@openai/codex`. However, the core Python tools in [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) run without Node.js.

### Can I run AI Berkshire without Playwright?

Absolutely. Playwright is only required for the Xueqiu web scraper in [`tools/xueqiu_scraper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/xueqiu_scraper.py). All other financial analysis tools use only Python's standard library and function without Playwright installed.

### What Python version is required for AI Berkshire?

The repository requires **Python ≥3.7**. The tools rely exclusively on built-in modules like `argparse`, `json`, and `decimal`, ensuring compatibility with any Python 3.7+ installation without additional pip packages.

### How do I install the Claude Code CLI for AI Berkshire?

Install Claude Code globally using npm: `npm install -g @anthropic-ai/claude-code`. Then run [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) to register the AI Berkshire skills with your CLI environment.