3 releases
new 0.1.2 | May 11, 2025 |
---|---|
0.1.1 | May 11, 2025 |
0.1.0 | May 11, 2025 |
#768 in Command line utilities
43KB
741 lines
Scholar CLI
A command-line tool for accessing Google Scholar data using SerpApi.
Features
- Search for scholarly articles
- Find author profiles
- Get detailed author information including publications and citation metrics
- Retrieve citation information in various formats
Installation
Prerequisites
Install via Cargo
The easiest way to install is directly from crates.io:
cargo install scholar_cli
Building from Source
Alternatively, you can build from source:
-
Install Rust and Cargo
-
Clone this repository
git clone https://github.com/chriscarrollsmith/scholar_cli.git cd scholar_cli
-
Build the project
cargo build --release
-
The binary will be available at
target/release/scholar_cli
Usage
Setting your API Key
You can provide your SerpApi API key in one of three ways:
-
Store it persistently in your config file:
scholar_cli config set-key YOUR_API_KEY
-
As a command-line parameter:
scholar_cli --api-key YOUR_API_KEY <command>
-
As an environment variable:
export SERPAPI_API_KEY=YOUR_API_KEY scholar_cli <command>
You can also create a .env
file in the directory where you run the command:
SERPAPI_API_KEY=YOUR_API_KEY
To view your current configuration:
scholar_cli config show
Commands
Search for Articles
scholar_cli search --query "machine learning" --num 5
Additional options:
--start-year
: Filter for papers published after this year--end-year
: Filter for papers published before this year--lang
: Specify language (default: "en")
Search for Author Profiles
scholar_cli profiles --mauthors "Andrew Ng"
Get Author Details
scholar_cli author --author-id "IY53lNkAAAAJ"
Get Citation Information
scholar_cli cite --q "10.1126/science.aaa8415"
Search for Recent Papers
Search for recent papers on climate change:
scholar_cli search --query "climate change" --start-year 2020
License
MIT
Acknowledgments
- SerpApi for providing the API
- The Rust community for the excellent libraries used in this project
Dependencies
~8–24MB
~280K SLoC