{"id":51641091,"url":"https://github.com/tamnd/wikipedia-cli","last_synced_at":"2026-07-13T19:03:18.550Z","repository":{"id":364560003,"uuid":"1268369396","full_name":"tamnd/wikipedia-cli","owner":"tamnd","description":"A command line for Wikipedia and Wikimedia. Read articles, search full text, query Wikidata, fetch metrics, stream dumps.","archived":false,"fork":false,"pushed_at":"2026-06-29T12:13:41.000Z","size":589,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T14:12:48.153Z","etag":null,"topics":["cli","command-line-tool","golang","json","open-data","scraper","wayback","wikidata","wikimedia","wikipedia"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tamnd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-13T12:58:24.000Z","updated_at":"2026-06-29T12:13:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tamnd/wikipedia-cli","commit_stats":null,"previous_names":["tamnd/wikipedia-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tamnd/wikipedia-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fwikipedia-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fwikipedia-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fwikipedia-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fwikipedia-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tamnd","download_url":"https://codeload.github.com/tamnd/wikipedia-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamnd%2Fwikipedia-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35432829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-tool","golang","json","open-data","scraper","wayback","wikidata","wikimedia","wikipedia"],"created_at":"2026-07-13T19:03:11.154Z","updated_at":"2026-07-13T19:03:18.534Z","avatar_url":"https://github.com/tamnd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wiki\n\n[![CI](https://github.com/tamnd/wikipedia-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/tamnd/wikipedia-cli/actions/workflows/ci.yml)\n[![Release](https://img.shields.io/github/v/release/tamnd/wikipedia-cli)](https://github.com/tamnd/wikipedia-cli/releases/latest)\n[![Go Reference](https://pkg.go.dev/badge/github.com/tamnd/wikipedia-cli.svg)](https://pkg.go.dev/github.com/tamnd/wikipedia-cli)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tamnd/wikipedia-cli)](https://goreportcard.com/report/github.com/tamnd/wikipedia-cli)\n[![License](https://img.shields.io/github/license/tamnd/wikipedia-cli)](./LICENSE)\n\nA command line for Wikipedia. `wiki` reads public Wikipedia and Wikimedia data\nand prints clean, pipeable records. One pure-Go binary, no API key, no login.\n\n[Install](#install) • [Commands](#commands) • [Usage](#usage) • [Resource URIs](#use-it-as-a-resource-uri-driver)\n\n![wiki searching and reading Wikipedia from the command line](docs/static/demo.gif)\n\nIt talks to the public Wikimedia APIs over plain HTTPS. Every request is paced,\nretried on transient failures, and sent with an honest User-Agent. Responses are\ncached on disk so re-running a command is instant and easy on the servers.\n\n`wiki` is an independent tool. It is not affiliated with or endorsed by the\nWikimedia Foundation. Article content is licensed by its authors under\n[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/); please respect\nthe [Wikimedia API etiquette](https://www.mediawiki.org/wiki/API:Etiquette) and\nattribute your sources.\n\n## Install\n\n```bash\ngo install github.com/tamnd/wikipedia-cli/cmd/wiki@latest\n```\n\nOr grab a prebuilt binary from the [releases](https://github.com/tamnd/wikipedia-cli/releases),\nor run the container image:\n\n```bash\ndocker run --rm ghcr.io/tamnd/wiki:latest read \"Alan Turing\"\n```\n\nShell completion is built in: `wiki completion bash|zsh|fish|powershell`.\n\n## Commands\n\n| Command | Reads |\n| --- | --- |\n| `wiki read \u003ctitle\u003e` | an article as paged text, or `--markdown`, `--html`, `--wikitext` |\n| `wiki get \u003ctitle \\| -\u003e` | the same for pipelines; reads titles on stdin |\n| `wiki summary \u003ctitle\u003e` | a one-paragraph extract |\n| `wiki open \u003ctitle\u003e` | open the article in the browser, or `--print` its URL |\n| `wiki search \u003cquery\u003e` | full-text search; CirrusSearch operators pass through |\n| `wiki suggest \u003cprefix\u003e` | prefix autocomplete |\n| `wiki random` | one or more random articles |\n| `wiki related \u003ctitle\u003e` | pages a reader is likely to want next |\n| `wiki links \u003ctitle\u003e` | internal links; `--external` for URLs |\n| `wiki backlinks \u003ctitle\u003e` | pages that link here |\n| `wiki categories \u003ctitle\u003e` | categories the page belongs to |\n| `wiki category \u003cname\u003e` | members of a category; `--type page\\|subcat\\|file` |\n| `wiki media \u003ctitle\u003e` | files used on a page; `--download` to save them |\n| `wiki references \u003ctitle\u003e` | external sources cited |\n| `wiki cite \u003ctitle\u003e` | a formatted citation; `--format bibtex\\|ris\\|mla\\|apa` |\n| `wiki langs \u003ctitle\u003e` | the same article in other languages |\n| `wiki info \u003ctitle\u003e` | page metadata |\n| `wiki revisions \u003ctitle\u003e` | revision history, newest first; `--user` |\n| `wiki diff \u003cfrom\u003e [to]` | unified diff between revisions |\n| `wiki featured [date]` | the daily featured content |\n| `wiki onthisday [date]` | historical events; `--type all\\|births\\|deaths\\|holidays` |\n| `wiki top [date]` | most-viewed articles for a day or month |\n| `wiki pageviews \u003ctitle\u003e` | per-article pageview time series |\n| `wiki geosearch \u003clat,lon\u003e` | articles near a coordinate; `--radius` |\n| `wiki nearby \u003ctitle\u003e` | articles near another article; `--radius` |\n| `wiki entity \u003cid \\| title\u003e` | a Wikidata entity; `--props`, `--lang` |\n| `wiki sparql \u003cquery \\| @file \\| -\u003e` | SPARQL against the Wikidata Query Service |\n| `wiki dump list` | files of a dump; `--wiki`, `--date` |\n| `wiki dump download \u003cfile\u003e` | download with resume and sha1 verify |\n| `wiki dump pages \u003cfile\u003e` | stream-parse a pages-articles dump |\n| `wiki dump grep \u003cpattern\u003e \u003cfile\u003e` | pages matching a regexp |\n| `wiki dump export [file]` | convert a dump to a Markdown or text corpus |\n| `wiki sites` | known Wikimedia projects and example hosts |\n| `wiki stats` | statistics for the selected wiki |\n| `wiki convert \u003cfile \\| -\u003e` | convert HTML or wikitext offline |\n\nFull reference and guides live at [wikipedia-cli.tamnd.com](https://wikipedia-cli.tamnd.com).\n\n## Usage\n\n```bash\nwiki read \"Alan Turing\"\nwiki search \"turing machine\"\nwiki summary \"Quantum computing\"\nwiki info \"Mars\"\nwiki entity Q937 --props P569,P570       # Einstein's birth and death dates\nwiki sparql 'SELECT ?c ?p WHERE { ?c wdt:P31 wd:Q515; wdt:P1082 ?p } ORDER BY DESC(?p) LIMIT 5'\nwiki geosearch 51.5074,-0.1278 --radius 1000\nwiki dump list --wiki dewiki\n```\n\nRecords come out as a list (the default on a terminal), table, markdown, JSON,\nJSONL, CSV, TSV, url, or raw. The output is colored on a terminal and a progress\nspinner marks slow reads; pipe it and the bytes are plain:\n\n```bash\nwiki info \"Mars\" -o table\nwiki search \"physics\" -n 10 --fields title,description -o csv\nwiki links \"Alan Turing\" -o url | head\nwiki revisions \"Climate change\" --user Jimbo -o jsonl\nwiki search \"quantum\" -n 5 -o jsonl | jq .title\n```\n\nSwitch wikis with `-l/--lang`, `--project`, or `--site`. A pasted URL picks the\nright wiki automatically:\n\n```bash\nwiki read \"Berlin\" -l de                        # German Wikipedia\nwiki search \"café\" --project wiktionary -l fr   # French Wiktionary\nwiki read https://de.wikipedia.org/wiki/Berlin  # URL auto-selects\n```\n\n### Global flags\n\n```\n-o, --output      list|table|markdown|json|jsonl|csv|tsv|url|raw   (auto: list on a TTY, jsonl when piped)\n    --fields      comma-separated columns to include\n    --no-header   omit the heading in list, or the header row in csv/tsv/markdown\n    --template    Go text/template applied per record\n-n, --limit       max records (0 = command default)\n-l, --lang        wiki language subdomain (default en)\n    --project     Wikimedia project (default wikipedia)\n    --site        explicit wiki host; overrides --lang and --project\n-q, --quiet       suppress the progress spinner\n    --color       auto|always|never  (color on a terminal, off when piped)\n    --rate        min spacing between requests (default 150ms)\n    --timeout     per-request timeout (default 1m)\n    --retries     retry attempts on 429/5xx (default 4)\n    --no-cache    bypass the on-disk response cache\n    --ua          override the User-Agent\n```\n\n## Exit codes\n\n```\n0  success, at least one record\n1  error\n2  usage error\n3  no results (a valid empty response)\n4  not found (the article or entity does not exist)\n```\n\n## Use it as a resource-URI driver\n\nThe `wiki` package ships a driver that makes Wikipedia pages addressable as\nresource URIs, the way a database driver registers with `database/sql`. A host\nprogram such as [ant](https://github.com/tamnd/ant) blank-imports the package:\n\n```go\nimport _ \"github.com/tamnd/wikipedia-cli/wiki\"\n```\n\nThen `ant` (or any program that links the package) dereferences `wikipedia://`\nURIs:\n\n```bash\nant get wikipedia://page/Alan_Turing       # the article summary\nant cat wikipedia://page/Alan_Turing       # just the extract text\nant ls  wikipedia://page/Alan_Turing       # the articles it links to\nant ls  wikipedia://category/Computability # the articles in a category\nant url wikipedia://page/Alan_Turing       # back to the live URL\n```\n\nEvery listed link and category member is itself a `wikipedia://page/` URI, so a\nhost can walk the graph. See the [driver guide](https://wikipedia-cli.tamnd.com/guides/resource-uris/)\nfor the record shapes and the full URI grammar.\n\n## Development\n\n```\ncmd/wiki/    thin main entry point\ncli/         cobra commands, output rendering, and the progress spinner\nwiki/        HTTP client, API calls, models, and the wikipedia:// driver\ndocs/        documentation site (Hugo, tago-doks theme)\n```\n\n```bash\nmake build   # ./bin/wiki\nmake test    # go test ./...\nmake vet     # go vet ./...\n```\n\nRequires Go 1.26+.\n\n## Releasing\n\nPush a version tag and GitHub Actions runs GoReleaser, which builds the\narchives, Linux packages, the multi-arch GHCR image, checksums, SBOMs, and a\ncosign signature:\n\n```bash\ngit tag -a v0.3.0 -m \"v0.3.0\"\ngit push --tags\n```\n\nThe image tag carries no `v` prefix (`ghcr.io/tamnd/wiki:0.3.0`).\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamnd%2Fwikipedia-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamnd%2Fwikipedia-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamnd%2Fwikipedia-cli/lists"}