The Local News CLI
Get the latest news straight from your terminal. Powered by NewsAPI.org.
- Top headlines by country or topic
- Full-text keyword search with
AND/OR/NOT - Articles from the past 7 days only
- Open any article in your browser directly from the CLI
Install
pip install news-cli
Or with uv:
uv tool install news-cli
Setup
Get a free API key at newsapi.org/register, then set it as an environment variable:
export NEWS_API_KEY=your_key_here
Add that line to your ~/.zshrc or ~/.bashrc to make it permanent.
Usage
news [OPTIONS]
Options:
-s, --search TEXT Keywords to search for. Supports AND/OR/NOT.
-c, --country TEXT 2-letter country code: us, gb, in, fr, de, au, ...
-t, --topic TEXT business | entertainment | general | health |
science | sports | technology
-l, --lang TEXT Article language: en, fr, de, es, ar, zh, ... [default: en]
--sort TEXT relevancy | popularity | date [default: popularity]
(only applies to --search without --country/--topic)
-n, --limit INT Number of articles to show (1–100) [default: 20]
--json Output as JSON for scripting
--verbose Enable debug logging
--help Show this message and exit
Examples
# Top headlines (defaults to US)
news
# Headlines for a specific country
news --country gb
news -c in
# Headlines by topic
news --topic technology
news -t health
# Search for a keyword
news --search "climate change"
news -s "AI AND regulation"
# Combine: search within a country or topic
news --search "election" --country us
news -s "startup" -t technology
# Filter by language
news --search "économie" --lang fr
# Sort search results by date
news --search "SpaceX" --sort date
# Show more results
news -n 50
# Pipe to jq or other tools
news --json | jq '.[].title'
Troubleshooting
No API key found — set the NEWS_API_KEY environment variable (see Setup above).
No articles found — the combination of filters returned nothing. Try a broader country, drop the topic filter, or change the language.
Results seem old — the CLI only shows articles from the past 7 days. For older content, use the NewsAPI directly.
Metadata
Release files for news-cli 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| news_cli-2.0.1.tar.gz | 12.0 kB | Without provenance | Details for news_cli-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| news_cli-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for news_cli-2.0.1-py3-none-any.whl |
Total release size: 25.0 kB
Release files / news_cli-2.0.1.tar.gz
| Download URL | news_cli-2.0.1.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ef5f2c2f2fca0490c2955a385cc809867ff4e3551fbf8d72de0bae55f724cda
|
|
BLAKE2b-256 checksum How to use checksums |
ae1f2079e9faef8c0b4835a44a2b44d39ce991b5f0c7aaf7ef861058f82bed10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / news_cli-2.0.1-py3-none-any.whl
| Download URL | news_cli-2.0.1-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb61c92249d1ed9090e2b5e73e54899f902388e3980928d97548de192886a0fc
|
|
BLAKE2b-256 checksum How to use checksums |
3890fb0edb66079a8784f493e11260769debd2fc1421e62e2af1a6d0d492f11c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for news-cli 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.