{"id":25883171,"url":"https://github.com/maxlath/wikibase-cli-template-collection","last_synced_at":"2026-06-07T04:31:34.528Z","repository":{"id":37764088,"uuid":"317566767","full_name":"maxlath/wikibase-cli-template-collection","owner":"maxlath","description":"A collection of wikibase-cli templates","archived":true,"fork":false,"pushed_at":"2026-05-09T17:40:02.000Z","size":52,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-09T19:30:48.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxlath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-01T14:27:12.000Z","updated_at":"2026-05-09T17:40:06.000Z","dependencies_parsed_at":"2022-09-01T06:11:27.700Z","dependency_job_id":null,"html_url":"https://github.com/maxlath/wikibase-cli-template-collection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxlath/wikibase-cli-template-collection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fwikibase-cli-template-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fwikibase-cli-template-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fwikibase-cli-template-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fwikibase-cli-template-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxlath","download_url":"https://codeload.github.com/maxlath/wikibase-cli-template-collection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fwikibase-cli-template-collection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34009201,"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-06-07T02:00:07.652Z","response_time":124,"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":[],"created_at":"2025-03-02T16:31:48.711Z","updated_at":"2026-06-07T04:31:34.504Z","avatar_url":"https://github.com/maxlath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wikibase-cli template collection\n\nA collection of [wikibase-cli](https://github.com/maxlath/wikibase-cli) templates:\n* [templates to create entities](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/create)\n* [templates to edit entities](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/edit)\n* [templates to generate and run SPARQL requests](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/request)\n\nThe aim of this collection is to\n* document best practices\n* offer general purpose templates\n* offer more niche templates as examples of what's possible\n\nSome (if not most) templates might be targeting a specific Wikibase instance (most likely Wikidata).\n\nContributions and [template requests](https://github.com/maxlath/wikibase-cli-template-collection/issues/new) welcome!\n\n\n## Summary\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Install](#install)\n- [Create / Edit entities](#create--edit-entities)\n- [Qualifiers](#qualifiers)\n- [Request](#request)\n- [See also](#see-also)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Install\n\nFirst, you need to have [NodeJS \u003e= v8](https://nodejs.org/), which should come with the npm package manager.\n\nIf [wikibase-cli](https://github.com/maxlath/wikibase-cli) isn't already installed and configured:\n```sh\nnpm install --global wikibase-cli\n\n# Set the default Wikibase instance\nwb config instance https://www.wikidata.org\n# If you want to use templates to create/edit entities, you need to setup credentials\n# Get the credential prompt for the desired target instance\nwb config credentials https://www.wikidata.org\n```\n\nGet a copy of those templates\n```sh\ngit clone https://github.com/maxlath/wikibase-cli-templates\ncd wikibase-cli-templates\n# Required for templates that `require` dependencies, see the list in package.json\nnpm install\n```\n\nAnd now let's get started!\n\n## Create / Edit entities\n\n```sh\ncd wikibase-cli-templates/edit\n\n# Display the help menu of a template\nwb edit-entity ./clear_language_terms.js --help\n\n# Get a preview of the generated edit\nwb edit-entity ./clear_language_terms.js Q4115189 fr --dry\n\n# Actually make the edit\nwb edit-entity ./clear_language_terms.js Q4115189 fr\n```\n\nAdapting the example above for batch mode:\n```sh\n# Make a batch of arguments for the template\necho '\nQ4115189 fr\nQ4115189 en\nQ4115189 de\nQ13406268 fr\nQ13406268 en\nQ13406268 de\n' \u003e ids_and_langs_to_clear\n\n# Get a preview of the generated edits\ncat ids_and_langs_to_clear | wb edit-entity ./clear_language_terms.js --batch --dry\n# Actually run the edit batch\ncat ids_and_langs_to_clear | wb edit-entity ./clear_language_terms.js --batch --summary 'clear all those undesired terms'\n```\n\nTemplates:\n* [templates to create entities](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/create)\n* [templates to edit entities](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/edit)\n\nLearn more:\n* [`wb create-entity`](https://github.com/maxlath/wikibase-cli/blob/master/docs/write_operations.md#wb-create-entity)\n* [`wb edit-entity`](https://github.com/maxlath/wikibase-cli/blob/master/docs/write_operations.md#wb-edit-entity), specifically [Generate an edit object from a JS template function](https://github.com/maxlath/wikibase-cli/blob/master/docs/write_operations.md#generate-an-edit-object-from-a-js-template-function)\n* [batch mode](https://github.com/maxlath/wikibase-cli/blob/master/docs/write_operations.md#batch-mode)\n* [`wb generate-template`](https://github.com/maxlath/wikibase-cli/blob/master/docs/read_operations.md#wd-generate-template)\n\n## Qualifiers\n```sh\n# Remove all P1106 qualifiers on the 'Q4115189$7CCCA1D1-CD2B-4243-A9E1-652EA5F41AE0' claim\nwb remove-qualifier ./qualifiers/remove_qualifiers_by_property.js 'Q4115189$7CCCA1D1-CD2B-4243-A9E1-652EA5F41AE0' P1106\n```\n\n## Request\n\n```sh\ncd wikibase-cli-templates/request\n\n# Display the help menu of a template\nwb sparql ./all_instances.js Q34770 --help\n\n# Get a preview of the generated SPARQL request\nwb sparql ./all_instances.js Q34770 --dry\n\n# See that request on the Query Service webpage\nwb sparql ./all_instances.js Q34770 --open\n\n# Save the generated SPARQL request\nwb sparql ./all_instances.js Q34770 --dry \u003e Q34770_instances.rq\n\n# Run the query and save as a list of ids\nwb sparql ./all_instances.js Q34770 \u003e Q34770_instances\n\n# Same but with a JSON output. Available formats: json, xml, tsv, csv, binrdf, table\nwb sparql ./all_instances.js Q34770 --format json \u003e Q34770_instances.json\n```\n\nTemplates:\n* [request template collection](https://github.com/maxlath/wikibase-cli-template-collection/tree/master/request)\n\nLearn more:\n* [`wb sparql`](https://github.com/maxlath/wikibase-cli/blob/master/docs/read_operations.md#wb-sparql), specifically [dynamic request from a JS template](https://github.com/maxlath/wikibase-cli/blob/master/docs/read_operations.md#dynamic-request-from-a-js-template)\n\n\n## See also\n* [wikidata-scripting](https://github.com/maxlath/wikidata-scripting): examples of scripts to edit Wikidata\n* [wikidata-misc](https://github.com/generalist/wikidata-misc): various Wikidata maintenance/upload scripts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlath%2Fwikibase-cli-template-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlath%2Fwikibase-cli-template-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlath%2Fwikibase-cli-template-collection/lists"}