rod
Rod Crystal
This is a Crystal port of go-rod/rod, a high-level browser automation library.
The goal is full parity with Go Rod while maintaining Crystal idioms and best practices. The Go source code is available in the vendor/rod submodule and serves as the source of truth for all logic and behavior.
Installation
Add this to your application's shard.yml:
dependencies:
rod:
github: dsisnero/rod
Then run shards install.
Usage
require "rod"
# Connect to existing browser
browser = Rod::Browser.new
browser.connect("ws://localhost:9222/devtools/browser/...")
# Get page and navigate
page = browser.page
page.navigate("https://example.com")
# Find elements and interact
element = page.element("h1")
puts element.text
# Close browser
browser.close
For more examples, see the go-rod documentation and the Crystal tests.
Development
Project Structure
src/rod/- Crystal implementationvendor/rod/- Go source code (submodule)src/cdp/- Generated Chrome DevTools Protocol bindingsspec/- Crystal specs
Development Workflow
- Install dependencies:
make installorshards install - Run tests:
make testorcrystal spec - Format code:
crystal tool format - Lint code:
make lintorameba
Porting Guidelines
This is a port, not a rewrite. Follow these principles:
- Logic must match Go exactly - Only syntax should differ
- Use Crystal idioms - After verifying behavioral equivalence
- Port tests alongside code - Every Go test should have a Crystal spec
- Verify against Go implementation - Use the vendor submodule as reference
See AGENTS.md for detailed agent instructions.
Generating CDP Bindings
CDP (Chrome DevTools Protocol) bindings are generated from the browser protocol definitions:
make generate
This uses the pdlgen tool in vendor/pdlgen to generate Crystal types from the JSON protocol definitions.
Contributing
- Fork the repository
- Create a feature branch
- Make changes following porting guidelines
- Add tests for new functionality
- Run quality gates:
make format && make lint && make test - Submit a pull request
License
MIT - see LICENSE for details.
Attribution
This project ports code from go-rod/rod (MIT licensed). The original source is preserved in the vendor/rod submodule.
rod
- 0
- 0
- 0
- 0
- 4
- 38 minutes ago
- February 23, 2026
Mon, 23 Feb 2026 05:07:55 GMT