Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Contributing to agent-browser

Thank you for your interest in contributing to agent-browser! This document provides guidelines for contributing to the project.

## Table of Contents

- [Development Environment Setup](#development-environment-setup)
- [Coding Style Guidelines](#coding-style-guidelines)
- [Submitting a Pull Request](#submitting-a-pull-request)

## Development Environment Setup

### Prerequisites

- **Node.js** >= 20.x
- **pnpm** >= 9.x (package manager)
- **Rust** >= 1.70 (for native CLI)
- **Git**

### Installation

1. Fork the repository on GitHub
2. Clone your fork:
```bash
git clone https://github.com/YOUR_USERNAME/agent-browser.git
cd agent-browser
```

3. Install dependencies:
```bash
pnpm install
```

4. Install Playwright browsers:
```bash
pnpm exec playwright install --with-deps chromium
```

5. Build the TypeScript:
```bash
pnpm build
```

6. (Optional) Build the Rust CLI:
```bash
pnpm run build:native
```

### Running Tests

```bash
# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run Rust tests only
cargo test --manifest-path cli/Cargo.toml
```

### Running the Development Server

```bash
pnpm dev
```

## Coding Style Guidelines

### TypeScript/JavaScript

- Use **TypeScript** for all new code
- Follow the existing code style (enforced by Prettier)
- Run `pnpm format` before committing
- Run `pnpm typecheck` to ensure type safety

### Rust

- Follow standard Rust formatting (`cargo fmt`)
- Run `cargo clippy` to catch common mistakes
- Ensure all tests pass: `cargo test`

### General

- Write clear, descriptive commit messages
- Add tests for new functionality
- Update documentation as needed
- Keep changes focused and atomic

## Submitting a Pull Request

1. **Create a branch** for your changes:
```bash
git checkout -b feature/your-feature-name
```

2. **Make your changes** following the coding guidelines above

3. **Test your changes**:
```bash
pnpm test
pnpm typecheck
pnpm format:check
```

4. **Commit your changes**:
```bash
git add .
git commit -m "feat: add your feature description"
```

5. **Push to your fork**:
```bash
git push origin feature/your-feature-name
```

6. **Create a Pull Request** on GitHub:
- Go to the original repository
- Click "New Pull Request"
- Select your branch
- Fill in the PR template with:
- Clear description of changes
- Related issue numbers (if applicable)
- Testing performed

7. **Wait for review** - maintainers will review your PR and provide feedback

### PR Checklist

- [ ] Tests pass (`pnpm test`)
- [ ] TypeScript compiles without errors (`pnpm typecheck`)
- [ ] Code is formatted (`pnpm format`)
- [ ] Commit messages are clear and descriptive
- [ ] Documentation is updated (if needed)

## Questions?

Feel free to open an issue for:
- Bug reports
- Feature requests
- Questions about contributing

Thank you for contributing!
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# agent-browser

[![CI](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![npm version](https://img.shields.io/npm/v/agent-browser.svg)](https://www.npmjs.com/package/agent-browser)

Headless browser automation CLI for AI agents. Fast Rust CLI with Node.js fallback.

## Installation
Expand Down