| Crates.io | gemini-map |
| lib.rs | gemini-map |
| version | 0.1.2 |
| created_at | 2025-04-05 05:04:36.883261+00 |
| updated_at | 2025-04-05 08:16:29.06518+00 |
| description | A command-line tool to run files in parallel through Google Gemini |
| homepage | https://github.com/spoj/gemini-map |
| repository | |
| max_upload_size | |
| id | 1621548 |
| size | 160,018 |
A command-line tool to apply a Gemini prompt to multiple files or URLs concurrently.
cargo run --package gemini-map -- \
-p <prompt> \
-m <model_name> \
[-c <concurrency>] \
[-s | --split-pdf] \
[-t <temperature>] \
<file_or_url1> [<file_or_url2> ...]`
# Example:
cargo run --package gemini-map -- \
-p "Summarize the key points in this document." \
-m "gemini-pro" \
-t 0.7 \
report.txt notes.md chapter1.txt
# Example with custom concurrency:
cargo run --package gemini-map -- \
-p "Extract action items." \
-m "gemini-pro" \
-c 10 \
meeting_minutes/*.log
cargo run --package gemini-map --
-p "What is the main topic of this page?"
-m "flash"
https://example.com/some/webpage.html
# Example splitting a PDF into individual pages:
cargo run --package gemini-map -- \
-p "Describe the content of this page." \
-m "gemini-pro-vision" \
-s \
multi_page_document.pdf
# Build and install locally from the workspace root
cargo install --path crates/gemini-map
# Then run the installed binary
gemini-map -p <prompt> -m <model> [-s] [-t <temperature>] <files_or_urls...>
Requires the GEMINI_API_KEY environment variable to be set for authenticating with the Google Gemini API.
export GEMINI_API_KEY="YOUR_API_KEY_HERE"
--split-pdf)Using the -s or --split-pdf flag processes each page of a PDF input individually. It uses the lopdf crate to extract each page into a separate, single-page PDF document in memory before sending it for processing. If the flag is not used, the entire PDF file is processed as a single binary blob (application/pdf). This feature does not require any external libraries like PDFium.
This crate includes integration tests that use wiremock to mock the Gemini API.
To run tests:
cargo test --package gemini-map
You might need to set the GEMINI_API_ENDPOINT_OVERRIDE environment variable for certain tests if they rely on a specific mock server endpoint.