Skip to content

thylong/znews

Repository files navigation

📰 znews

Read today's world news — translated to simplified Chinese, right in your terminal.

znews is a CLI tool for Chinese learners who want to practice reading real content. It pulls live RSS feeds, translates headlines and articles into beginner-friendly simplified Chinese (HSK 3.0 level 3 vocabulary), and lets you flip between Chinese and pinyin with a single keypress — all powered by a local LLM via Ollama, so nothing leaves your machine.


Features

  • 📡 Live news from France24, BBC, China Daily & New York Times
  • 🀄 Auto-translation to simplified Chinese using HSK 3.0 level 3 vocabulary — simple words, no jargon
  • 🔤 Pinyin toggle — press tab at any time to flip between characters and romanisation
  • 🔗 Article translation — paste a URL and translate the full article body
  • 🏎️ Streaming output — translations appear token by token, no staring at a blank screen
  • 🔒 Fully local — powered by Ollama, your data never leaves your computer

Demo

┌─────────────────────────────────────────────────────────────────┐
│ 📰 Top News - France24, BBC, China Daily & New York Times [Chinese]│
│                                                                   │
│ ▶ [France24] 以色列和 (Hamas) 同意新的停战计划               │
│   [France24] 欧洲 (EU) 领导人在 (Brussels) 开会讨论经济     │
│   [BBC]      英国政府宣布新的气候变化计划                    │
│   [China Daily] 中国经济今年增长很快                         │
│   [NYT]      美国总统 (Trump) 谈新的贸易协议                │
│                                                                   │
│ ↑/k up • ↓/j down • tab toggle pinyin • enter select • q quit   │
└─────────────────────────────────────────────────────────────────┘

Setup

Prerequisites

Install the model

ollama pull qwen3:4b-instruct-2507-q4_K_M

Any Ollama model works via --model. qwen3:4b-instruct-2507-q4_K_M is the default — a well-rounded choice for HSK-level output. Use a larger variant if you want higher quality.

Build & run

git clone https://github.com/thylong/znews
cd znews
make build-bin
./build/znews news

Or install directly with Go:

go install github.com/thylong/znews@latest
znews news

Usage

Browse the news

znews news
Key Action
/ k Move up
/ j Move down
tab Toggle Chinese ↔ Pinyin
enter Open article detail
q / ctrl+c Quit

Filter sources with --medias (comma-separated: france24, bbc, chinadaily, nyt):

znews news --medias bbc,nyt

Translate anything

Translate a sentence:

znews translate "The economy grew faster than expected"

Translate a full article from a URL:

znews translate "https://www.bbc.com/news/world/..."

Both stream tokens live so you see the translation build up as it is generated.

Pick a model

znews news --model qwen3:4b-instruct-2507-q4_K_M
znews translate "Hello" --model gemma3:1b

Why znews?

Most Chinese learning tools use canned sentences. znews gives you real news, today, simplified to a vocabulary level you can actually read. The pinyin toggle means you can check your reading without fully switching context. It is the flashcard deck that updates itself every morning.


Contributing

Contributions are very welcome — the project is small, the code is readable, and there is plenty of low-hanging fruit.

Get started

git clone https://github.com/thylong/znews
cd znews
go mod download

# Install pre-commit hooks (linting + license headers)
make pre-commit-hooks-install

Run tests & lint

make test-unit   # unit tests with coverage
make lint        # golangci-lint
make test        # everything: lint + security scan + benchmarks + unit tests

Project layout

cmd/          CLI commands (cobra)
pkg/
  article/    URL fetching & readability extraction
  animation/  Terminal spinner
  news/       RSS fetching, Bubble Tea model, pinyin conversion
  render/     Lipgloss UI components
  translate/  Bubble Tea model for the translate command
  translation/ Ollama client, streaming, batch translation

Ideas for contributions

  • 🌐 Add more news sources (Al Jazeera, Le Monde, Reuters…)
  • 📊 HSK level selector (1–6) to adjust vocabulary difficulty
  • 💾 Offline cache so you can read on the train
  • 🎨 Themes / colour schemes
  • 📱 Export to Anki flashcards

Guidelines

  • Keep it simple — the goal is a fast, focused CLI tool
  • Run make test before opening a PR
  • All Go files need the MIT license header (the pre-commit hook checks this automatically)
  • Open an issue first for large changes so we can discuss

License

MIT — see LICENSE.

About

Learn Chinese by reading the news in your terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors