Nitrate Processed Mincemeat

wikidata-cli

7.0.2 • Public • Published

Wikidata-CLI

The Command-line interface interface to Wikidata

This project is funded by a Wikimedia Project Grant.

wikidata

NPM DockerHub Badge

License Node JavaScript Style Guide

Summary

Dependencies

General

  • NodeJs >= v6.4.0 (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 wikidata-cli

Installing globally allows to make the command wikidata-cli and its alias wd accessible from your shell $PATH

via docker

# Might require to be run with sudo depending on your Docker installation 
docker run --rm -t maxlath/wikidata-cli
# You can make an alias out of it: 
alias wd="docker run --rm -t maxlath/wikidata-cli"
# You're then ready to use it as in the documentation examples 
wd label Q1

That would work, but all operations using cached data (such as the list of all properties) would need to re-fetch those data for each operations, and all operations editing Wikidata would require you to enter your username and password 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/wikidata-cli
alias wd='docker run --rm --volume "$HOME/.local/share/wikidata-cli:/wikidata-cli/local" -t maxlath/wikidata-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 mass edit Wikidata), you should probably rather use the NPM package directly for long series of commands

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.io? It's a web app to share books with your friends, built on top of Wikidata! And its libre software too.

License

MIT

Keywords

install

npm i wikidata-cli

Downloadsweekly downloads

37

version

7.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability