{"id":14156654,"url":"https://github.com/oclif/plugin-warn-if-update-available","last_synced_at":"2025-04-12T17:42:38.591Z","repository":{"id":31010377,"uuid":"126631873","full_name":"oclif/plugin-warn-if-update-available","owner":"oclif","description":"warn user if a new CLI version is available","archived":false,"fork":false,"pushed_at":"2025-03-30T08:45:58.000Z","size":3742,"stargazers_count":39,"open_issues_count":1,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T19:15:55.221Z","etag":null,"topics":["oclif","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oclif.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-24T19:09:45.000Z","updated_at":"2025-03-30T08:46:00.000Z","dependencies_parsed_at":"2024-06-18T13:45:45.954Z","dependency_job_id":"46cb97d5-2d31-4b35-a688-d724322817eb","html_url":"https://github.com/oclif/plugin-warn-if-update-available","commit_stats":{"total_commits":654,"total_committers":22,"mean_commits":"29.727272727272727","dds":"0.36544342507645255","last_synced_commit":"e77303a166e6a0af4cf6c0fbd99453a621c31a40"},"previous_names":[],"tags_count":139,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oclif%2Fplugin-warn-if-update-available","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oclif%2Fplugin-warn-if-update-available/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oclif%2Fplugin-warn-if-update-available/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oclif%2Fplugin-warn-if-update-available/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oclif","download_url":"https://codeload.github.com/oclif/plugin-warn-if-update-available/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248608385,"owners_count":21132719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oclif","typescript"],"created_at":"2024-08-17T08:07:34.218Z","updated_at":"2025-04-12T17:42:38.560Z","avatar_url":"https://github.com/oclif.png","language":"TypeScript","funding_links":[],"categories":["typescript"],"sub_categories":[],"readme":"# @oclif/plugin-warn-if-update-available\n\nwarns if there is a newer version of CLI released\n\n[![Version](https://img.shields.io/npm/v/@oclif/plugin-warn-if-update-available.svg)](https://npmjs.org/package/@oclif/plugin-warn-if-update-available)\n[![Downloads/week](https://img.shields.io/npm/dw/@oclif/plugin-warn-if-update-available.svg)](https://npmjs.org/package/@oclif/plugin-warn-if-update-available)\n[![License](https://img.shields.io/npm/l/@oclif/plugin-warn-if-update-available.svg)](https://github.com/oclif/plugin-warn-if-update-available/blob/main/package.json)\n\n\u003c!-- toc --\u003e\n\n- [@oclif/plugin-warn-if-update-available](#oclifplugin-warn-if-update-available)\n- [What is this?](#what-is-this)\n- [How it works](#how-it-works)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Environment Variables](#environment-variables)\n- [Contributing](#contributing)\n\u003c!-- tocstop --\u003e\n\n# What is this?\n\nThis plugin shows a warning message if a user is running an out of date CLI.\n\n![screenshot](./assets/screenshot.png)\n\n# How it works\n\nThis checks the version against the npm registry asynchronously in a forked process once every 60 days by default (see [Configuration](#configuration) for how to configure this). It then saves a version file to the cache directory that will enable the warning. The upside of this method is that it won't block a user while they're using your CLI—the downside is that it will only display _after_ running a command that fetches the new version.\n\n# Installation\n\nAdd the plugin to your project with `yarn add @oclif/plugin-warn-if-update-available`, then add it to the `package.json` of the oclif CLI:\n\n```js\n{\n  \"name\": \"mycli\",\n  \"version\": \"0.0.0\",\n  // ...\n  \"oclif\": {\n    \"plugins\": [\"@oclif/plugin-help\", \"@oclif/plugin-warn-if-update-available\"]\n  }\n}\n```\n\n# Configuration\n\nIn `package.json`, set `oclif['warn-if-update-available']` to an object with\nany of the following configuration properties:\n\n- `timeoutInDays` - Duration between update checks. Defaults to 60.\n- `message` - Customize update message.\n- `registry` - URL of registry. Defaults to following your .npmrc configuration\n- `authorization` - Authorization header value for registries that require auth. Defaults to following your .npmrc configuration\n- `frequency` - The frequency that the new version warning should be shown.\n- `frequencyUnit` - The unit of time that should be used to calculate the frequency (`days`, `hours`, `minutes`, `seconds`, `milliseconds`). Defaults to `minutes`.\n\n## Example configuration\n\n```json\n{\n  \"oclif\": {\n    \"plugins\": [\"@oclif/plugin-warn-if-update-available\"],\n    \"warn-if-update-available\": {\n      \"timeoutInDays\": 7,\n      \"message\": \"\u003c%= config.name %\u003e update available from \u003c%= chalk.greenBright(config.version) %\u003e to \u003c%= chalk.greenBright(latest) %\u003e.\",\n      \"registry\": \"https://my.example.com/module/registry\",\n      \"authorization\": \"Basic \u003cSOME READ ONLY AUTH TOKEN\u003e\"\n    }\n  }\n}\n```\n\n## Notification Frequency\n\nOnce a new version has been found, the default behavior is to notify the user on every command execution. You can modify this by setting the `frequency` and `frequencyUnit` options.\n\n**Examples**\n\nOnce every 10 minutes.\n\n```json\n{\n  \"oclif\": {\n    \"warn-if-update-available\": {\n      \"frequency\": 10\n    }\n  }\n}\n```\n\nOnce every 6 hours.\n\n```json\n{\n  \"oclif\": {\n    \"warn-if-update-available\": {\n      \"frequency\": 6,\n      \"frequencyUnit\": \"hours\"\n    }\n  }\n}\n```\n\nOnce a day.\n\n```json\n{\n  \"oclif\": {\n    \"warn-if-update-available\": {\n      \"frequency\": 1,\n      \"frequencyUnit\": \"days\"\n    }\n  }\n}\n```\n\nOnce every 30 seconds.\n\n```json\n{\n  \"oclif\": {\n    \"warn-if-update-available\": {\n      \"frequency\": 30,\n      \"frequencyUnit\": \"seconds\"\n    }\n  }\n}\n```\n\n# Environment Variables\n\n- `\u003cCLI\u003e_SKIP_NEW_VERSION_CHECK`: Skip this version check\n- `\u003cCLI\u003e_FORCE_VERSION_CACHE_UPDATE`: Force the version cache to update\n- `\u003cCLI\u003e_NEW_VERSION_CHECK_FREQ`: environment variable override for `frequency` setting\n- `\u003cCLI\u003e_NEW_VERSION_CHECK_FREQ_UNIT`: environment variable override for `frequencyUnit` setting\n- `\u003cCLI\u003e_NEW_VERSION_CHECK_TAG`: [distribution tag](https://docs.npmjs.com/adding-dist-tags-to-packages) to check against (defaults to `latest`)\n\n# Contributing\n\nSee [contributing guide](./CONRTIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foclif%2Fplugin-warn-if-update-available","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foclif%2Fplugin-warn-if-update-available","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foclif%2Fplugin-warn-if-update-available/lists"}