Dependencies for Running AI Berkshire: Complete Setup Guide

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, 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 and 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 imports playwright.async_api to drive a headless browser for data extraction. This dependency is only required for web scraping tasks.

Install Playwright:

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 copies the skill files into Claude Code's command directory.

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 wrapper generates Codex skill packages and registers them with your CLI.


# 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:
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire
  1. Verify Python ≥3.7 is installed (most systems include this by default).

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

pip install playwright
playwright install
  1. Install your preferred CLI client:

# For Claude Code

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

# For Codex

curl -fsSL https://chatgpt.com/codex/install.sh | sh
  1. Register the skills:

# 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:

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

Test Playwright integration (if installed):

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 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 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 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. 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 to register the AI Berkshire skills with your CLI environment.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →