Need help with wikibase-cli?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

maxlath
155 Stars 14 Forks MIT License 1.1K Commits 9 Opened issues

Description

read and edit a Wikibase instance from the command line

Services available

!
?

Need anything else?

Contributors list

# 104,824
HTML
CSS
wiki-pa...
npm
1083 commits
# 5,427
Koa
yml
lisp-in...
imagema...
6 commits
# 355,755
Shell
wikidat...
simplif...
sed
4 commits
# 342,738
HTML
Shell
CSS
civic-t...
3 commits
# 117,722
PHP
c-plus-...
wikiped...
Qt
2 commits
# 7,020
webpack...
Ruby
test-fr...
webpack...
1 commit
# 218,152
c-plus-...
Shell
MATLAB
floatin...
1 commit
# 411,284
nexus
C
Shell
CSS
1 commit
# 90,595
Arduino
geospat...
cpluspl...
Erlang
1 commit

wikibase-cli

The Command-line interface interface to Wikibase instances.

This tool is mostly a CLI interface to the JS modules wikibase-edit and wikibase-sdk, + some treats for the CLI lovers. And a batch mechanism to process millions of edits.

It was primarily developed to target Wikidata, but as then been decoupled to support any Wikibase instance.

This project received a Wikimedia Project Grant.


wikibase           wikidata

NPM DockerHub Badge

License Node JavaScript Style Guide

Show your support by adding

{{#babel:Wikibase CLI}}
to your Wikidata user page

userbox_wikibase_cli

Summary

Changelog

See CHANGELOG.md for version info

Dependencies

General

  • NodeJs >= v8 (recommended way to install it: use the awesome NVM)
  • Git

Per feature

  • to use the clipboard option: see copy-paste dependencies

Installation

via npm

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
.

If you later need to update the package to a different version, you can run the same command but specifying the version you want (here

12.2.0
)
sh
npm install -g [email protected]
or just request the latest version
sh
npm install -g wikib[email protected]

via docker

# 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 -it 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:

sh
mkdir -p $HOME/.config/wikibase-cli $HOME/.cache/wikibase-cli
alias wb='docker run --rm -v "$HOME/.config/wikibase-cli:/root/.config/wikibase-cli" -v "$HOME/.cache/wikibase-cli:/root/.cache/wikibase-cli" -it maxlath/wikibase-cli'

NB: Beware that using wikibase-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

Commands

Read operations

See Read operations

wd summary Q1

Write operations

See Write operations

Config

Allows to persist options

See Config

See Also

You may also like

inventaire banner

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.

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.