The Command-line interface interface to Wikibase instances.
It was primarily developed to target Wikidata, but as then be decoupled to support any Wikibase instance.
This project received a Wikimedia Project Grant.
Show your support by adding {{#babel:Wikibase CLI}}
to your Wikidata user page
See CHANGELOG.md for version info
- to use the clipboard option: see copy-paste dependencies
npm install -g wikibase-cli
Installing globally allows to make the command wb
(and wd
, the Wikidata-bound verion of wb
) accessible from your shell $PATH
.
# Might require to be run with sudo depending on your Docker installation
docker run --rm -t maxlath/wikibase-cli
# You can make an alias out of it:
alias wb="docker run --rm -t maxlath/wikibase-cli"
# You're then ready to use it as in the documentation examples
wb label Q1
That would work, but all operations cached data (such as the list of all properties) would need to re-fetch those data for each operations, and all write operations would require you to re-enter your credentials everytime. To work around this, you can allow this container to persist some files on your system, using shared volumes:
mkdir -p $HOME/.local/share/wikibase-cli
alias wb='docker run --rm --volume "$HOME/.local/share/wikibase-cli:/wikibase-cli/local" -t maxlath/wikibase-cli'
NB: Beware that using wikidata-cli through a Docker container has a performance cost of something like 1s per command, so if you need to run many commands (for instance in a script to make mass edit on the desired Wikibase instance), you should probably rather use the NPM package directly
See Read operations
See Write operations
Allows to persist options
See Config
- wikibase-sdk: A javascript tool suite to query and work with Wikibase data, heavily used by wikibase-cli
- wikibase-edit: Edit Wikibase from NodeJS, used in wikibase-cli for all write operations
- wikidata-filter: A command-line tool to filter a Wikidata dump by claim
- wikidata-subset-search-engine: Tools to setup an ElasticSearch instance fed with subsets of Wikidata
- wikidata-taxonomy: A command-line tool to extract taxonomies from Wikidata
- import-wikidata-dump-to-couchdb: Import a subset or a full Wikidata dump into a CouchDB database
- Other Wikidata external tools
Do you know Inventaire? It's a web app to share books with your friends, built on top of Wikidata! And its libre software too.