diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..21dd49f0e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,77 @@ +# Contributing to agent-browser + +Thank you for your interest in contributing! This guide covers everything you need. + +## Development Setup + +### Prerequisites +- Node.js 18+ and npm +- Rust toolchain (for native CLI): `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` +- Chrome for Testing (auto-installed via `agent-browser install`) + +### Getting Started +```bash +git clone https://github.com/dextonai/agent-browser.git +cd agent-browser +npm install +agent-browser install +``` + +### Running Tests +```bash +npm test +``` + +### Building from Source +```bash +# Build the Rust CLI +cargo build --release + +# Build the npm package +npm run build +``` + +## Coding Style + +### TypeScript/JavaScript +- Use strict TypeScript (`strict: true`) +- Prefer `const` over `let`; avoid `var` +- Use async/await over raw promises +- Add JSDoc comments to exported functions +- Follow existing formatting (Prettier defaults) + +### Rust +- Follow `rustfmt` defaults: `cargo fmt` +- Run Clippy before submitting: `cargo clippy -- -D warnings` +- Add doc comments (`///`) to public items +- Handle errors with `Result`, never panic in library code + +## Submitting Changes + +1. Fork this repository +2. Create a feature branch: `git checkout -b feature/my-change` +3. Make focused, atomic commits with clear messages +4. Add or update tests for your changes +5. Run the full test suite: `npm test && cargo test` +6. Open a Pull Request with: + - Clear description of the change + - Link to any related issues + - Steps to test manually if applicable + +## Pull Request Guidelines + +- Keep PRs small and focused — one concern per PR +- Include tests for new functionality +- Update documentation if behavior changes +- Be responsive to review feedback + +## Reporting Issues + +- Search existing issues before opening a new one +- Include: Node.js version, Rust version, OS +- Provide minimal reproduction steps +- Show relevant logs or error output + +## Questions? + +Open an issue or start a discussion on this repo. diff --git a/README.md b/README.md index 8ede376c9..a75ac28f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # agent-browser -Browser automation CLI for AI agents. Fast native Rust CLI. +Browser automation for AI agents should be fast, native, and invisible. Not a +Docker container running a full Chromium that takes three seconds to start and +burns 500MB of RAM. Not a Puppeteer wrapper that leaks memory across sessions. +Just a Rust binary that opens a page, reads the DOM, and gets out of the way. + +agent-browser is a native Rust CLI that gives AI agents a fast, lightweight +browser surface. It downloads Chrome from Chrome for Testing on first run, +handles session lifecycle automatically, and returns clean page content in +milliseconds instead of seconds. It exists because browser automation tools +were built for humans writing test suites, not for agents making dozens of +rapid page reads in a single conversation turn. ## Installation