Code Monkey home page Code Monkey logo

wikibase-cli's Introduction

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)

npm install -g [email protected]

or just request the latest version

npm install -g wikibase-cli@latest

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:

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

wikibase-cli's People

Contributors

maxlath avatar waldyrious avatar nichtich avatar tmtmtmtm avatar addshore avatar rwst avatar simon04 avatar almereyda avatar pdehaye avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.