Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Future: Support searching crates by GitHub URL #4

Description

@nikomatsakis

Overview

Allow users to search for examples directly from GitHub repositories, bypassing crates.io entirely.

Use Cases

  • Explore unreleased versions or development branches
  • Search private repositories (with authentication)
  • Analyze forks or experimental versions
  • Research crates that aren't published to crates.io

Proposed API

// Search a GitHub repository directly
let result = Eg::github_repo("tokio-rs/tokio")
    .branch("main")  // optional, defaults to default branch
    .pattern(r"spawn")?
    .search().await?;

// Or with full URL
let result = Eg::github_url("https://github.com/tokio-rs/tokio")
    .pattern(r"async")?
    .search().await?;

Implementation Notes

  • Clone/download repository to local cache
  • Use same search infrastructure as crate extraction
  • Handle authentication via GITHUB_TOKEN
  • Support branch/tag/commit specification
  • Consider rate limiting and caching strategies

Priority

Low - the current crates.io approach covers 95% of use cases. This is a nice-to-have enhancement for power users.

Related

This was originally part of the GitHub fallback feature that was removed in favor of the simpler full-extraction approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions