Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
GDELT CLI
The command-line interface for the GDELT Project — built for agents, optimized for automation.
What is GDELT?
The GDELT Project monitors news media from nearly every country in 100+ languages, updating every 15 minutes. It's the largest open dataset of global human society, tracking events, sentiment, themes, and entities across the world's news.
Why GDELT CLI?
Traditional GDELT access requires complex API calls and manual data wrangling. GDELT CLI provides:
- Agent-First Design — Structured JSON output, machine-readable help, predictable exit codes
- Local Analytics — DuckDB-powered queries on downloaded data, no API limits
- Smart Caching — SQLite cache reduces redundant API calls
- MCP Server — Expose GDELT as tools for AI assistants (Claude, etc.)
- Zero Config — Sensible defaults, works out of the box
Quick Start
Installation
# One-line install (downloads binary or builds from source)
|
# Or with Cargo
# Or build locally
First Commands
# Search recent news
# Get geographic data for events
# Download and sync local data
# Query local events database
# Get machine-readable help
Agent & Automation Features
GDELT CLI is designed for programmatic use by AI agents, scripts, and automation pipelines.
Structured Output
All commands support multiple output formats:
Machine-Readable Help
# Get complete command schema as JSON
# Get schema for a specific command
# List all available tools (MCP-compatible)
Predictable Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Validation error |
| 3 | Network error |
| 4 | API error |
| 5 | Rate limited |
| 10 | Database error |
| 11 | Cache error |
| 20 | Not found |
Environment Variables
GDELT_OUTPUT=json # Default output format
GDELT_QUIET=1 # Suppress non-essential output
GDELT_NO_CACHE=1 # Bypass cache
GDELT_TIMEOUT=60 # Request timeout in seconds
Command Reference
DOC API — News Article Search
# Full-text search
# With filters
# Timeline analysis
# Word cloud data
GEO API — Geographic Search
# Point data for mapping
# Heatmap data
TV API — Television News
# Search TV clips
# Station coverage
Local Data & Analytics
# Download historical data
# Sync latest updates
# Query local events
# Query GKG (Global Knowledge Graph)
# Trend analysis
# Entity extraction
# Sentiment analysis
Database Management
# View statistics
# Export data
# Run custom SQL
# Optimize database
MCP Server (AI Assistant Integration)
GDELT CLI can run as an MCP (Model Context Protocol) server, exposing GDELT data as tools for AI assistants.
# Start MCP server (stdio transport)
# With configuration
Available Tools
When running as an MCP server, the following tools are exposed:
gdelt_search— Search news articlesgdelt_timeline— Get volume/tone over timegdelt_geo— Geographic event datagdelt_events_query— Query local events databasegdelt_gkg_query— Query Global Knowledge Graphgdelt_analytics— Run trend/sentiment analysis
Claude Desktop Integration
Add to ~/.config/claude/claude_desktop_config.json:
Background Daemon
Run GDELT sync as a background service:
# Start daemon
# Check status
# View logs
# Stop daemon
# Install as system service
Configuration
Configuration file: ~/.config/gdelt/config.toml
[]
= "json"
= "UTC"
[]
= 30
= 3
= 5.0
[]
= true
= 500
[]
= "1h"
= "24h"
[]
= "2GB"
[]
= "24h"
= 75
= "hybrid-rel"
Data Storage
| Directory | Contents |
|---|---|
~/.local/share/gdelt/ |
DuckDB database, downloaded files |
~/.cache/gdelt/ |
API response cache (SQLite) |
~/.config/gdelt/ |
Configuration files |
Development
Building from Source
# Clone repository
# Build debug
# Build release
# Run tests
# Build with MCP support
Project Structure
src/
├── api/ # GDELT API clients (DOC, GEO, TV)
├── analytics/ # Trend, sentiment, entity analysis
├── cli/ # Command definitions and handlers
├── config/ # Configuration schema
├── daemon/ # Background sync service
├── data/ # Download and import logic
├── db/ # DuckDB and SQLite interfaces
├── mcp/ # MCP server implementation
├── models/ # Data models and CAMEO codes
└── error/ # Error types and exit codes
Running Tests
# All tests
# With output
# Specific test
CAMEO Event Codes
GDELT uses CAMEO (Conflict and Mediation Event Observations) codes. Quick reference:
| Code | Category | Goldstein |
|---|---|---|
| 01 | Make public statement | 0.0 |
| 02 | Appeal | 3.0 |
| 03 | Express intent to cooperate | 4.0 |
| 04 | Consult | 1.0 |
| 05 | Diplomatic cooperation | 3.5 |
| 06 | Material cooperation | 6.0 |
| 07 | Provide aid | 7.0 |
| 08 | Yield | 5.0 |
| 09 | Investigate | -0.5 |
| 10 | Demand | -5.0 |
| 11 | Disapprove | -2.0 |
| 12 | Reject | -4.0 |
| 13 | Threaten | -7.0 |
| 14 | Protest | -6.5 |
| 15 | Exhibit force posture | -7.5 |
| 16 | Reduce relations | -6.0 |
| 17 | Coerce | -7.0 |
| 18 | Assault | -9.0 |
| 19 | Fight | -10.0 |
| 20 | Mass violence | -10.0 |
# List all codes
# Search codes
# Describe a code
License
MIT License — see LICENSE for details.