A CLI and TUI to discover random Go articles, tutorials, and documentation from trusted sources.
- Random article picker with unread-first behavior
- Source filtering across docs, tour, Go by Example, stdlib pkg, blog, and Golang Weekly
- History, bookmarks, and streak tracking
- Interactive TUI with keyboard shortcuts
- Non-interactive output for scripting (
--plain,--json,--no-ui) - Remote sources file with local caching and manual refresh
- Offline HTML snapshots for browser-based reading
go install github.com/AfshinJalili/gorandom/cmd/gorandom@latestgit clone https://github.com/AfshinJalili/gorandom.git
cd gorandom
go install ./cmd/gorandom- Download the binary for your OS and architecture from GitHub Releases.
- Make it executable (macOS/Linux):
chmod +x gorandom - Move it into your
PATH, for example:mv gorandom /usr/local/bin/
# Random unread article
gorandom
# Pick next unread article
gorandom next
# Search by keyword (title or source)
gorandom search generics
# Filter by source
gorandom --source tour
gorandom next --source blog
gorandom search weekly --source golangweekly
# Include already-read articles
gorandom --any# Recent history
gorandom history
gorandom history --limit 20
# Mark read/unread
gorandom mark
gorandom unmark
# Bookmark
gorandom bookmark 1
gorandom bookmarks
# Progress and streak
gorandom stats# Plain text
gorandom random --plain
gorandom history --plain --limit 5
# JSON
gorandom random --json
gorandom history --json --limit 20
# Disable UI (alias of --plain)
gorandom random --no-ui# Fetch or refresh sources
gorandom sources update
# Cache status
gorandom sources status
# Cache HTML snapshots for offline reading
gorandom offline sync --source golangweekly
gorandom offline status
gorandom open --offline https://golangweekly.com/issues/594nor space: next articleoor enter: open in browserm: toggle readb: toggle bookmarky: copy URLh: toggle helpq: quit
Sources are loaded from a JSON file hosted in this repo:
https://raw.githubusercontent.com/AfshinJalili/gorandom/main/data/sources.json
Behavior:
- On first run, the CLI fetches the sources file and caches it locally.
- The cache lives in the config directory:
~/.random-go/sources.json. - Use
gorandom sources updateto refresh. gorandom sources statusshows cache age and staleness (24h TTL indicator).- Offline HTML snapshots live under
~/.random-go/offline. gorandom offline syncstores local HTML snapshots and lightweight assets for browser reading.
Environment variables:
GORANDOM_CONFIG_DIR: override config directoryGORANDOM_SOURCES_URL: override sources JSON URLGORANDOM_SOURCES_TTL: override stale threshold used by status (default24h)GORANDOM_SOURCES_SPINNER=0: disable the fetch spinner
go run ./cmd/gorandomgo test ./...make fmt
make lint
make vet
make race./scripts/install-hooks.shThe pre-commit hook auto-runs gofmt and golangci-lint.
- Sources cache missing: run
gorandom sources update. - Clipboard on Linux: install
xcliporxselto enable copying. - History file location:
~/.random-go/history.json(orGORANDOM_CONFIG_DIR).