Skip to content

Commit 802b387

Browse files
update readme
1 parent 640c790 commit 802b387

File tree

1 file changed

+49
-21
lines changed

1 file changed

+49
-21
lines changed

README.md

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,67 @@ await stagehand.agent.execute("book a reservation for 2 people for a trip to the
6262

6363
## Installation
6464

65-
Install the Python package via pip:
65+
**Recommended:** Install using `uv` (fast Python package manager):
66+
67+
```bash
68+
uv add stagehand
69+
```
70+
71+
Alternatively, install via pip:
6672

6773
```bash
6874
pip install stagehand
6975
```
76+
77+
### Installing with uv
78+
79+
[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver. If you don't have uv installed, you can install it with:
80+
81+
```bash
82+
# On macOS and Linux
83+
curl -LsSf https://astral.sh/uv/install.sh | sh
84+
85+
# On Windows
86+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
87+
88+
# Or via pip
89+
pip install uv
90+
```
91+
92+
For new projects, you can create a new project with uv:
93+
94+
```bash
95+
uv init stagehand-project
96+
cd stagehand-project
97+
uv add stagehand
98+
```
99+
70100
## Requirements
71101

72102
- Python 3.9+
73-
- httpx (for async client)
74-
- requests (for sync client)
75-
- asyncio (for async client)
76-
- pydantic
77-
- python-dotenv (optional, for .env support)
78-
- playwright
79-
- rich (for `examples/` terminal support)
103+
- All dependencies are automatically handled when installing via `uv` or `pip`
80104

81-
You can simply run:
105+
The main dependencies include:
106+
- httpx (for async HTTP client)
107+
- requests (for sync HTTP client)
108+
- pydantic (for data validation)
109+
- playwright (for browser automation)
110+
- python-dotenv (for environment variable support)
111+
- browserbase (for Browserbase integration)
112+
113+
### Development Dependencies
114+
115+
For development, install with dev dependencies:
82116

83117
```bash
84-
pip install -r requirements.txt
118+
uv add stagehand --dev
85119
```
86120

87-
**requirements.txt**
88-
```txt
89-
httpx>=0.24.0
90-
asyncio>=3.4.3
91-
python-dotenv>=1.0.0
92-
pydantic>=1.10.0
93-
playwright>=1.42.1
94-
requests>=2.31.0
95-
rich
96-
browserbase
97-
```
121+
Or install dev dependencies separately:
98122

123+
```bash
124+
uv add --dev pytest pytest-asyncio pytest-mock pytest-cov black isort mypy ruff rich
125+
```
99126

100127
## Environment Variables
101128

@@ -106,6 +133,7 @@ export BROWSERBASE_API_KEY="your-api-key"
106133
export BROWSERBASE_PROJECT_ID="your-project-id"
107134
export MODEL_API_KEY="your-openai-api-key" # or your preferred model's API key
108135
export STAGEHAND_API_URL="url-of-stagehand-server"
136+
export STAGEHAND_ENV="BROWSERBASE" # or "LOCAL" to run Stagehand locally
109137
```
110138

111139
You can also make a copy of `.env.example` and add these to your `.env` file.

0 commit comments

Comments
 (0)