Skip to content

Contributing

Thank you for your interest in contributing to rewget!

Getting Started

Prerequisites

  • Rust 1.75 or later
  • Git
  • wget (for testing)

Clone and Build

git clone https://github.com/neul-labs/rewget
cd rewget
cargo build

Run Tests

cargo test

Run with Debug Output

cargo run -- --rewget-debug https://example.com/

Project Structure

rewget/
├── crates/
│   ├── rewget/           # CLI binary
│   ├── rewgetd/          # Daemon binary
│   └── rewget-core/      # Shared library
├── documentation/       # MkDocs documentation
├── Formula/            # Homebrew formula
└── scripts/            # Build scripts

How to Contribute

Reporting Bugs

  1. Check existing issues first
  2. Create a new issue with:
  3. rewget version (rewget --rewget-version)
  4. Operating system and version
  5. Steps to reproduce
  6. Debug output (--rewget-debug)
  7. Expected vs actual behavior

Suggesting Features

  1. Open a new issue
  2. Describe the feature and use case
  3. Explain why it would be useful

Submitting Code

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/my-feature
    
  3. Make your changes
  4. Run tests:
    cargo test
    cargo clippy
    cargo fmt --check
    
  5. Commit with a clear message:
    git commit -m "Add feature: description"
    
  6. Push and create a Pull Request

Code Style

Rust Style

  • Follow the Rust Style Guide
  • Use cargo fmt before committing
  • Run cargo clippy and address warnings
  • Add tests for new functionality

Commit Messages

Use clear, descriptive commit messages:

Add Stage 2 timeout configuration

- Add --rewget-timeout-stage2 flag
- Default to 15 seconds
- Update documentation

Documentation

  • Update docs when adding features
  • Include doc comments for public APIs
  • Keep README.md in sync with changes

Development Workflow

Adding a New CLI Flag

  1. Add to crates/rewget/src/args.rs:

    "my-flag" => {
        let v = value.ok_or_else(|| anyhow!("--rewget-my-flag requires a value"))?;
        config.my_setting = v.parse()?;
    }
    

  2. Add to crates/rewget-core/src/config.rs:

    pub struct Config {
        pub my_setting: String,
    }
    

  3. Add to crates/rewget/src/cli.rs for completions:

    .arg(
        Arg::new("my-flag")
            .long("rewget-my-flag")
            .value_name("VALUE")
            .help("Description of my flag")
    )
    

  4. Update documentation

Adding a Detection Pattern

Edit crates/rewget-core/src/detection.rs:

pub const BLOCK_PATTERNS: &[&str] = &[
    "existing-pattern",
    "your-new-pattern",
];

Adding a Browser Profile

  1. Create profile JSON following the format in profiles.md
  2. Add to crates/rewget-core/src/profile.rs:
    fn default_profiles() -> Vec<Profile> {
        vec![
            // existing profiles...
            Profile { name: "my_browser", ... },
        ]
    }
    

Testing Against Real Sites

For development, you can test against sites known to have bot protection:

# Test impersonation
cargo run -- --rewget-debug https://nowsecure.nl/

# Test different profiles
cargo run -- --rewget-profile=firefox_136 --rewget-debug https://example.com/

Areas for Contribution

High Priority

  • [ ] Browser profile capture automation
  • [ ] Connection pooling in Stage 2
  • [ ] Performance benchmarks
  • [ ] Integration tests for fallback scenarios

Medium Priority

  • [ ] Additional detection patterns
  • [ ] Windows installer (winget/chocolatey)
  • [ ] Configuration file support
  • [ ] Proxy support improvements

Documentation

  • [ ] More examples in user guide
  • [ ] Video tutorials
  • [ ] Translation to other languages

Testing

  • [ ] Golden test suite for wget compatibility
  • [ ] Fuzzing for argument parser
  • [ ] Performance regression tests

Release Process

  1. Update version in Cargo.toml
  2. Update CHANGELOG.md
  3. Create git tag: git tag v1.0.1
  4. Push: git push origin v1.0.1
  5. GitHub Actions builds and publishes release

Code of Conduct

  • Be respectful and inclusive
  • Focus on constructive feedback
  • Help newcomers feel welcome
  • Report unacceptable behavior to maintainers

License

By contributing, you agree that your contributions will be licensed under the MIT License.

Getting Help

Thank you for contributing to rewget!