Skip to content

Commit ec00e55

Browse files
CyrusNuevoDiaclaude
andcommitted
docs: add comprehensive Getting Started guide and .env.example
- Add Getting Started section with mise requirement and `just claude` setup - Document all available just commands (dev, deploy, logs, claude, gemini, etc) - Create .env.example template with all required environment variables - Update S3 environment variable names to be more generic (S3_ prefix) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent a72d2b1 commit ec00e55

File tree

4 files changed

+108
-42
lines changed

4 files changed

+108
-42
lines changed

.claude/settings.local.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git add:*)",
5+
"Bash(git commit:*)"
6+
],
7+
"deny": [],
8+
"ask": []
9+
}
10+
}

.env.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# AI Gateway Configuration (required)
2+
# Get these from your Cloudflare AI Gateway dashboard
3+
AI_GATEWAY_URL="https://gateway.ai.cloudflare.com/v1/{account_id}/ai-gateway"
4+
AI_GATEWAY_TOKEN="your-gateway-token" # for authorization
5+
6+
# Kernel Platform (required)
7+
# Get your API key from the Kernel platform dashboard
8+
KERNEL_API_KEY="sk_xxxxx"
9+
10+
# Cloudflare R2 Storage (or other S3-compatible) for file uploads (required)
11+
# Configure these in your Cloudflare R2 settings
12+
S3_BUCKET="browser-agent"
13+
S3_ACCESS_KEY_ID="your-access-key"
14+
S3_ENDPOINT_URL="https://{account_id}.r2.cloudflarestorage.com"
15+
S3_SECRET_ACCESS_KEY="your-secret-key"
16+
17+
# Optional Configuration
18+
# Set to "debug" for verbose browser-use logging
19+
BROWSER_USE_LOGGING_LEVEL="info"
20+
21+
# Set to "false" to disable anonymous telemetry
22+
ANONYMIZED_TELEMETRY="false"

README.md

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,54 @@ The browser-agent microservice provides AI-powered browser automation capabiliti
1717
- **Trajectory tracking**: Records and stores complete execution history for analysis
1818
- **Cloudflare AI Gateway integration**: Unified LLM provider routing w/ caching
1919

20-
## Quick Start
20+
## Getting Started
2121

2222
### Prerequisites
2323

24-
- Python 3.11+
25-
- `uv` package manager
26-
- `just` task runner
27-
- Node.js with `bun` (for deployment tools)
24+
- [mise](https://mise.jdx.dev/) - Development environment manager
25+
- Python 3.11+ (managed via mise)
26+
- Node.js with `bun` (for deployment tools, managed via mise)
2827

29-
### Installation
28+
### Quick Setup
29+
30+
The easiest way to get started is to use the automated setup command:
3031

3132
```bash
32-
# Install dependencies
33-
uv install
33+
# Install mise if you haven't already
34+
curl https://mise.run | sh
35+
36+
# Clone the repository
37+
git clone <repository-url>
38+
cd browser-agent
39+
40+
# Automated setup - installs everything you need
41+
just claude
42+
```
3443

35-
# Install development dependencies
44+
The `just claude` command will:
45+
- Install Python, Node.js, and other tools via mise
46+
- Set up the Python virtual environment with uv
47+
- Install all dependencies
48+
- Create a `.env` template file
49+
50+
### Manual Setup
51+
52+
If you prefer to set up manually:
53+
54+
```bash
55+
# Install development tools
56+
mise install
57+
58+
# Install Python dependencies
3659
uv install --group dev
60+
61+
# Copy environment template
62+
cp .env.example .env
3763
```
3864

39-
### Environment Setup
65+
### Environment Configuration
4066

41-
Create a `.env` file with the required environment variables:
67+
Edit your `.env` file with the required values:
4268

4369
```bash
4470
# AI Gateway Configuration (required)
@@ -48,33 +74,23 @@ AI_GATEWAY_TOKEN="your-gateway-token"
4874
# Kernel Platform (required)
4975
KERNEL_API_KEY="sk_xxxxx"
5076

51-
# Cloudflare R2 Storage for file uploads (required)
52-
R2_S3_BUCKET="browser-agent"
53-
R2_S3_ACCESS_KEY_ID="your-access-key"
54-
R2_S3_ENDPOINT_URL="https://{account_id}.r2.cloudflarestorage.com"
55-
R2_S3_SECRET_ACCESS_KEY="your-secret-key"
56-
57-
# Optional
58-
BROWSER_USE_LOGGING_LEVEL="debug"
59-
ANONYMIZED_TELEMETRY="false"
77+
# Cloudflare R2 Storage (required)
78+
S3_BUCKET="browser-agent"
79+
S3_ACCESS_KEY_ID="your-access-key"
80+
S3_ENDPOINT_URL="https://{account_id}.r2.cloudflarestorage.com"
81+
S3_SECRET_ACCESS_KEY="your-secret-key"
6082
```
6183

62-
### Local Development
84+
### Verify Setup
6385

64-
```bash
65-
# Run local development server
66-
just dev
67-
68-
# Format and lint code
69-
just fmt
70-
```
71-
72-
### Production
86+
Test that everything is working:
7387

7488
```bash
75-
just deploy
89+
# Start the development server
90+
just dev
7691

77-
just logs
92+
# In another terminal, check the service is running
93+
curl http://localhost:8080/health
7894
```
7995

8096
## API Reference
@@ -179,22 +195,40 @@ just logs
179195
}
180196
```
181197

182-
## Deployment
198+
## Available Commands
199+
200+
This project uses [just](https://just.systems) as a task runner. All commands are defined in the `justfile`.
183201

184202
### Development Commands
185203

186204
```bash
187-
just fmt # Format and lint code with ruff
188-
just dev # Run local development server
189-
just logs # View browser-agent logs
205+
just dev # Run local development server on port 8000
206+
just fmt # Format and lint code with ruff (auto-fix issues)
207+
just lint # Check code formatting and linting (no auto-fix)
208+
```
209+
210+
### Deployment Commands
211+
212+
```bash
213+
just deploy # Deploy main.py to Kernel platform
214+
just logs # View browser-agent logs with follow mode
190215
```
191216

192-
### Production Deployment
217+
### AI Tool Integration
193218

194219
```bash
195-
just deploy # Deploy to Kernel platform
220+
just claude # Run Claude Code CLI (setup and development assistant)
221+
just gemini # Run Google Gemini CLI
196222
```
197223

224+
### Kernel Platform Commands
225+
226+
```bash
227+
just kernel <cmd> # Run any Kernel CLI command (e.g., 'just kernel status')
228+
```
229+
230+
## Deployment
231+
198232
The deployment process:
199233
1. Runs formatting and linting checks
200234
2. Deploys `src/app.py` to the Kernel platform

lib/storage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
from lib.asyncio import asyncify
1111

12-
BUCKET = env.get("R2_S3_BUCKET", "browser-agent")
12+
BUCKET = env.get("S3_BUCKET", "browser-agent")
1313
PRESIGNED_URL_EXPIRES_IN = 24 * 60 * 60 # 12 hours
1414

1515
client = boto3.client(
1616
service_name="s3",
17-
endpoint_url=env["R2_S3_ENDPOINT_URL"],
18-
aws_access_key_id=env["R2_S3_ACCESS_KEY_ID"],
19-
aws_secret_access_key=env["R2_S3_SECRET_ACCESS_KEY"],
17+
endpoint_url=env["S3_ENDPOINT_URL"],
18+
aws_access_key_id=env["S3_ACCESS_KEY_ID"],
19+
aws_secret_access_key=env["S3_SECRET_ACCESS_KEY"],
2020
region_name="auto",
2121
config=Config(signature_version="s3v4"),
2222
)

0 commit comments

Comments
 (0)