| NVCHECKER(1) | General Commands Manual | NVCHECKER(1) |
nvchecker - New version checker for software releases
nvchecker (short for new version checker) is for checking if a new version of some software has been released.
This is the version 2.0 branch. For the old version 1.x, please switch to the v1.x branch.
To install:
pip3 install nvchecker
To use the latest code, you can also clone this repository and run:
python3 setup.py install
To see available options:
nvchecker --help
Run with one or more software version files:
nvchecker -c config_file.toml
A simple config file may look like:
[nvchecker] source = "github" github = "lilydjwg/nvchecker" [python-toml] source = "pypi" pypi = "toml"
You normally will like to specify some "version record files"; see below.
With --logger=json or --logger=both, you can get a structured logging for programmatically consuming. You can use --json-log-fd=FD to specify the file descriptor to send logs to (take care to do line buffering). The logging level option (-l or --logging) doesn't take effect with this.
The JSON log is one JSON string per line. The following documented events and fields are stable, undocumented ones may change without notice.
There are several backward-incompatible changes from the previous 1.x version.
Version record files record which version of the software you know or is available. They are a simple JSON object mapping software names to known versions.
This command helps to manage version record files. It reads both old and new version record files, and a list of names given on the commandline. It then update the versions of those names in the old version record file.
This helps when you have known (and processed) some of the updated software, but not all. You can tell nvchecker that via this command instead of editing the file by hand.
This command will help most if you specify where you version record files are in your config file. See below for how to use a config file.
This command compares the newver file with the oldver one and prints out any differences as updates, e.g.:
$ nvcmp -c sample_source.toml Sparkle Test App None -> 2.0 test 0.0 -> 0.1
The software version source files are in toml
<https://toml.io/>
format. The key name is the name of the software. Following fields are
used to tell nvchecker how to determine the current version of that
software.
See sample_source.toml
<https://github.com/lilydjwg/nvchecker/blob/master/sample_config.toml>
for an example.
A special table named __config__ provides some configuration options.
Relative path are relative to the source files, and ~ and environmental variables are expanded.
Currently supported options are:
Sample keyfile.toml:
[keys] # https://github.com/settings/tokens # scope: repo -> public_repo github = "ghp_<stripped>"
The following options apply to every check sources. You can use them in any item in your configuration file.
If both prefix and from_pattern/to_pattern are used, prefix is applied first.
If from_pattern is not found, the version string remains unchanged and no error is emitted.
Set it to "" (empty string) to override the global setting.
This only works when the source implementation uses the builtin HTTP client, and doesn't work with the aur source because it's batched (however the global proxy config still applies).
This only works when the source implementation uses the builtin HTTP client.
In the keyfile add httptoken_{name} token.
The following options apply to sources that return a list. See individual source tables to determine whether they are supported.
source = "regex"
Search through a specific webpage for the version string. This type of version finding has these fields:
It can have zero or one capture group. The capture group or the whole match is the version string.
When multiple version strings are found, the maximum of those is chosen.
This source supports List Options.
source = "httpheader"
Send an HTTP request and search through a specific header.
It can have zero or one capture group. The capture group or the whole match is the version string.
When multiple version strings are found, the maximum of those is chosen.
source = "htmlparser"
Send an HTTP request and search through the body a specific xpath.
NOTE:
Search with an JSON Parser (jq) ~~~~~~~~~~~~~~~~~~~~~~~~~~
source = "jq"
Send an HTTP request and search through the body with a specific jq filter.
This source supports List Options.
NOTE:
source = "cmd"
Use a shell command line to get the version. The output is striped first, so trailing newlines do not bother.
source = "aur"
Check Arch User Repository <https://aur.archlinux.org/>
for updates. Per-item proxy setting doesn't work for this because several
items will be batched into one request.
source = "github"
Check GitHub <https://github.com/>
for updates. The version returned is in date format %Y%m%d.%H%M%S,
e.g. 20130701.012212, unless use_latest_release or
use_max_tag is used. See below.
GitHub releases are not the same with git tags. You'll see big version names and descriptions in the release page for such releases, e.g. zfsonlinux/zfs's <https://github.com/zfsonlinux/zfs/releases> , and those small ones like nvchecker's <https://github.com/lilydjwg/nvchecker/releases>
are only git tags that should use use_max_tag below.
Will return the release's tag name instead of date. (For historical reasons it doesn't return the release name. See below to change.)
This returns the release names (not the tag names).
This requires a token because it's using the v4 GraphQL API.
This requires a token because it's using the v4 GraphQL API.
An authorization token may be needed in order to use use_latest_tag, include_prereleases or to request more frequently than anonymously.
To set an authorization token, you can set:
This source supports List Options when use_max_tag is set.
source = "gitea"
Check Gitea <https://gitea.com/>
for updates. The version returned is in date format %Y%m%d, e.g.
20130701, unless use_max_tag is used. See below.
To set an authorization token, you can set:
This source supports List Options when use_max_tag is set.
source = "bitbucket"
Check BitBucket <https://bitbucket.org/>
for updates. The version returned is in date format %Y%m%d, e.g.
20130701, unless use_max_tag is used. See below.
for examples). The string does not need to be escaped.
for examples). Defaults to -target.date (sorts tags in descending order by date).
This source supports List Options when use_max_tag or use_sorted_tags is set.
source = "gitlab"
Check GitLab <https://gitlab.com/>
for updates. The version returned is in date format %Y%m%d, e.g.
20130701, unless use_max_tag is used. See below.
To set an authorization token, you can set:
This source supports List Options when use_max_tag is set.
source = "pypi"
Check PyPI <https://pypi.python.org/>
for updates.
This source supports List Options.
NOTE:
source = "gems"
Check RubyGems <https://rubygems.org/>
for updates.
This source supports List Options.
source = "npm"
Check NPM Registry <https://registry.npmjs.org/>
for updates.
To configure which registry to query, a source plugin option is available. You can specify like this:
[__config__.source.npm] registry = "https://registry.npm.taobao.org"
source = "hackage"
Check Hackage <https://hackage.haskell.org/>
for updates.
source = "cpan"
Check MetaCPAN <https://metacpan.org/>
for updates.
source = "cran"
Check CRAN <https://cran.r-project.org/web/packages/>
for updates.
source = "packagist"
Check Packagist <https://packagist.org/>
for updates.
source = "cratesio"
Check crates.io <https://crates.io/>
for updates.
This source supports List Options.
source = "pacman"
This is used when you run nvchecker on an Arch Linux system and the program always keeps up with a package in your configured repositories for <Pacman> .
source = "archpkg"
This enables you to track the update of Arch Linux official packages <https://www.archlinux.org/packages/> , without needing of pacman and an updated local Pacman databases.
source = "debianpkg"
This enables you to track the update of Debian Linux official packages <https://packages.debian.org> , without needing of apt and an updated local APT database.
source = "ubuntupkg"
This enables you to track the update of Ubuntu Linux official packages <https://packages.ubuntu.com/> , without needing of apt and an updated local APT database.
source = "repology"
This enables you to track updates from Repology
<https://repology.org/>
(repology.org).
This source supports List Options.
source = "anitya"
This enables you to track updates from Anitya
<https://release-monitoring.org/>
(release-monitoring.org).
Note that either anitya or anitya_id needs to be specified, anitya_id is preferred when both specified.
source = "android_sdk"
This enables you to track updates of Android SDK packages listed in sdkmanager --list.
This source supports List Options.
source = "sparkle"
This enables you to track updates of macOS applications which using Sparkle framework <https://sparkle-project.org/> .
source = "pagure"
This enables you to check updates from Pagure <https://pagure.io> .
This source returns tags and supports List Options.
source = "apt"
This enables you to track the update of an arbitrary APT repository, without needing of apt and an updated local APT database.
Note that either pkg or srcpkg needs to be specified (but not both) or the item name will be used as pkg.
source = "git"
This enables you to check tags or branch commits of an arbitrary git repository, also useful for scenarios like a github project having too many tags.
When this source returns tags (use_commit is not true) it supports List Options.
source = "mercurial"
This enables you to check tags of an arbitrary mercurial (hg) repository.
This source returns tags and supports List Options.
source = "container"
This enables you to check tags of images on a container registry like Docker.
registry and container are the host and the path used in the pull command. Note that the docker command allows omitting some parts of the container name while this plugin requires the full name. If the host part is omitted, use docker.io, and if there is no slash in the path, prepend library/ to the path. Here are some examples:
| Pull command | registry | container |
| docker pull quay.io/prometheus/node-exporter | quay.io | prometheus/node-exporter |
| docker pull quay.io/prometheus/node-exporter:master | quay.io | prometheus/node-exporter:master |
| docker pull openeuler/openeuler | docker.io | openeuler/openeuler |
| docker pull openeuler/openeuler:20.03-lts | docker.io | openeuler/openeuler:20.03-lts |
| docker pull python | docker.io | library/python |
| docker pull python:3.11 | docker.io | library/python:3.11 |
If no tag is given, this source returns tags and supports List Options.
source = "alpm"
Check package updates in a local ALPM database.
NOTE:
source = "alpmfiles"
Search package files in a local ALPM files database. The package does not need to be installed. This can be useful for checking shared library versions if a package does not list them in its provides.
source = "openvsx"
Check Open Vsx <https://open-vsx.org/>
for updates.
source = "vsmarketplace"
Check Visual Studio Code Marketplace
<https://marketplace.visualstudio.com/vscode/>
for updates.
source = "go"
Check Go packages and modules <https://pkg.go.dev/>
for updates.
source = "combiner"
This source can combine results from other entries.
Example:
[entry-1] source = "cmd" cmd = "echo 1" [entry-2] source = "cmd" cmd = "echo 2" [entry-3] source = "combiner" from = ["entry-1", "entry-2"] format = "$1-$2"
source = "manual"
This enables you to manually specify the version (maybe because you want to approve each release before it gets to the script).
It's possible to extend the supported sources by writing plugins. See plugin for documentation.
| 2024-12-12 | 2.16 |