Skip to content

Xpos587/gdr-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdr-cli

CI Python 3.12+ License: MIT

Gemini Deep Research CLI — run Google's Deep Research from the terminal. Shares authentication with notebooklm-mcp-cli.

Features

  • Deep Research — Run Gemini's multi-source deep research investigations (currently uses regular chat due to upstream API limitations)
  • Chat — Interactive REPL and single-message chat with Gemini (works in non-interactive environments)
  • Session Management — List, view, and continue past conversations
  • Model Selection — Choose specific Gemini models, check availability and subscription tier
  • Shared Auth — Login once, use with both gdr and nlm
  • CDP Login — Browser-based authentication via Chrome DevTools Protocol

Install

uv tool install git+https://github.com/Xpos587/gdr-cli.git

Or from source:

git clone https://github.com/Xpos587/gdr-cli.git
cd gdr-cli
uv sync
uv run gdr --help

Requirements

  • Python 3.12+
  • uv
  • Chrome/Chromium (for login)
  • Gemini Advanced subscription (for Deep Research)

Quick Start

Login

gdr login

Opens Chrome for Google authentication. Cookies are saved to ~/.notebooklm-mcp-cli/profiles/default/.

Deep Research

gdr research "AI safety research landscape 2026"
gdr research "quantum computing applications" --no-confirm
gdr research "Rust vs Go for systems programming" -o report.md
gdr research "long topic" --timeout 60 --poll 15

Research prints the chat CID immediately on start. If something goes wrong, you can open the research in the browser at https://gemini.google.com/app/<cid> (e.g. https://gemini.google.com/app/1975e4a9e33a362).

Chat

# Interactive REPL
gdr chat

# Single message (works in scripts, pipes, Claude Code, etc.)
gdr chat "Explain the difference between TCP and UDP"

# Continue last conversation
gdr chat -c

# Continue specific conversation (with or without c_ prefix)
gdr chat -c <chat-id>

Session Management

# List recent chats
gdr chats list

# View conversation history
gdr chats show <chat-id>

# Limit turns displayed
gdr chats show <chat-id> -n 10

Chat IDs are displayed without the c_ prefix (e.g. 1975e4a9e33a362). This is the same ID used in Gemini web URLs: https://gemini.google.com/app/1975e4a9e33a362. The c_ prefix is added automatically when needed for API calls.

Models

gdr models

Lists available Gemini models, shows which are accessible for your account, and detects your subscription tier (free, plus, advanced). Probing uses metadata requests only — no inference, no limit consumption.

Doctor

gdr doctor

Checks auth, cookies, Gemini connectivity, subscription tier, and Deep Research availability.

Commands

Command Description
gdr research <query> Run Deep Research on a topic
gdr chat [prompt] Interactive chat REPL or single message
gdr chats list List recent chat sessions
gdr chats show <cid> View conversation history
gdr models List available models and subscription tier
gdr login Authenticate via Chrome CDP
gdr doctor Diagnose auth and connectivity

Global Options

  • --profile, -p — Auth profile name (default: default)
  • --version, -v — Show version
  • --debug, -d — Enable debug logging from gemini_webapi

Research Options

  • --timeout, -t — Max research time in minutes (default: 30)
  • --poll — Status polling interval in seconds (default: 10)
  • --no-confirm, -n — Skip plan confirmation and start immediately
  • --output, -o — Write report to file
  • --output-dir — Auto-save to DIR/{date}-{slug}.md
  • --model, -m — Model name, e.g. gemini-3-pro-advanced (default: auto)

Chat Options

  • --continue, -c [CID] — Continue a chat by ID (omit for last chat). Accepts 1975e4a9e33a362 or c_1975e4a9e33a362

  • --model, -m — Model name, e.g. gemini-3-pro-advanced (default: auto)

  • --limit, -n — Number of turns to display (default: 20)

Auth Sharing with nlm

gdr-cli stores authentication in the same directory as notebooklm-mcp-cli:

~/.notebooklm-mcp-cli/
├── profiles/
│   └── default/
│       ├── cookies.json
│       └── metadata.json
└── gdr-config.json

Login once with either tool, both can use the same Google cookies.

Known Limitations

Deep Research API Status: The gemini_webapi library's deep_research() and create_deep_research_plan() APIs are currently non-functional (they hang indefinitely). As a workaround, gdr research uses regular chat with your research query. This still provides helpful responses, but lacks the structured deep research experience (planning, status updates, multi-step investigation). This will be fixed once the upstream library is updated.

Development

Setup

git clone https://github.com/Xpos587/gdr-cli.git
cd gdr-cli
uv sync

Tooling

  • Ruff — Fast Python linter and formatter (linting + formatting)
  • BasedPyright — Static type checker (type checking)
  • pytest — Testing framework with async support
  • EditorConfig — Consistent editor settings

Commands

# Install dev dependencies
uv sync --group dev

# Run all quality checks
go-task check

# Fix all auto-fixable issues
go-task fix

# Run type checker
go-task typecheck

# Run linter
go-task lint

# Format code
go-task fmt

# Run tests
go-task test

# Run tests with coverage
go-task test:cov

License

MIT

About

Gemini Deep Research CLI — interactive multi-turn chat and deep research via HTTP

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages