npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wikibase-cli

v18.2.2

Published

A command-line interface to Wikibase

Downloads

417

Readme

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.

Supported systems: any system that can run NodeJS (Linux, Mac OS, Windows, and more)

This project received a Wikimedia Project Grant.

NPM DockerHub Badge

License Node JavaScript Style Guide

Download stats

Show your support by adding {{#babel:Wikibase CLI}} to your Wikidata user page

Summary

Changelog

See CHANGELOG.md for version info

Dependencies

General

  • NodeJs >= v14 (recommended way to install it: use the awesome NVM to install the latest LTS version nvm install --lts)
  • 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

Debug

To get debugging informations, set the DEBUG environment variable:

# Print all wikibase-cli-specific debugging information
export DEBUG=wikibase-cli ; wb
# Also print wikibase-edit debugging information
export DEBUG=wikibase-* ; wb
# Print only request debugging information
export DEBUG=wikibase-cli:request ; wd label Q1

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