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

blynk-cli

v0.3.5

Published

An utility to manage your Blynk server

Downloads

19

Readme

Blynk CLI

Description

This utility provide a way to manage your blynk server from Command-Line Interface (CLI).

This is a work in progress and fully experimental utility. You should not try to use it in production.

Documentation

Docs are available on https://readthedocs.io/ :

English - Français

Installation

Dependencies

Please, make sure your configuration respect the following pre-requisite:

  • Java 8
  • NodeJS >= 4.6.1
  • npm (or alike)

Installation

You can install Blynk CLI with NPM:

$ npm install -g blynk-cli

Usage

Show help

Once Blynk CLI installed, you can show help about existing commands by typing:

$ blynk-cli
# OR
$ blynk-cli help
# OR
$ blynk-cli --help

Install Blynk Server

Once Blynk CLI installed, you'll have to install Blynk server by running:

$ blynk-cli server install
[INFO] Downloading Blynk server v0.24.5
[INFO] Creating default configuration
[OK] Installation complete

Update Blynk Server

You can update Blynk Server to the latest version by running:

$ blynk-cli server update
[INFO] Update v0.24.6 available. Downloading...
[OK] Update complete
[OK] Backup done! You can find it in /home/booteille/.blynkcli/backup/auto-update/b1045268-2f32-4e24-85a3-fb740266d417

Start/Stop/Restart Server

$ blynk-cli server start

$ blynk-cli server status # Display status of Blynk server

$ blynk-cli server stop

$ blynk-cli server restart

Make a backup

You can backup your data folder by typing:

$ blynkcli backup create BACKUP
[OK] Backup done! You can find it in /home/booteille/.blynkcli/backup/BACKUP/cee3acd3-1190-4501-bfc1-ba10423c1a07

The backup generated is located in the folder you designed in your Blynk CLI configuration.

As you can see in this example, the generated backup is located under BACKUP/cee3acd3-1190-4501-bfc1-ba10423c1a07. Each backup have an Unique Identifier giving ablity to give the same name to different backups.

You can retrieve backup informations in the file backups.lock located in your Backups folder.

Here is what generated the backup we created before:

$ cat /home/booteille/.blynkcli/backup/backups.lock
[
  {
    "name": "BACKUP",
    "uuid": "cee3acd3-1190-4501-bfc1-ba10423c1a07",
    "date": "Thu Jun 01 2017 15:46:50 GMT+0200 (CEST)",
    "server_version": "v0.24.6"
  }
]

Restore from a backup

If you want to restore your data folder from a desired backup, you have to type:

$ blynkcli backup restore BACKUP
[OK] Restored from backup /home/booteille/.blynkcli/backup/BACKUP/cee3acd3-1190-4501-bfc1-ba10423c1a07

Now. Admit we have backups under the same name:

$ blynkcli backup restore BACKUP
[WARN] There are 2 backup found with corresponding names:
BACKUP/812de666-6d21-4f36-8877-cc1f775dab73 Thu Jun 01 2017 15:58:44 GMT+0200 (CEST)
BACKUP/cee3acd3-1190-4501-bfc1-ba10423c1a07 Thu Jun 01 2017 15:46:50 GMT+0200 (CEST)
[ERR]  Please, retry with one of these backups

Think about the backup you want to restore then type the full name (or at least first characters of uuid) to get your restoration:

$ blynkcli backup restore BACKUP/812
[OK] Restored from backup /home/booteille/.blynkcli/backup/BACKUP/812de666-6d21-4f36-8877-cc1f775dab73

You can also restore your backup from the uuid:

$ blynkcli backup restore /cee
[OK] Restored from backup /home/booteille/.blynkcli/backup/BACKUP/cee3acd3-1190-4501-bfc1-ba10423c1a07

Add an user

You can add a new user by typing:

$ blynkcli user add
? Email:  [email protected]
? Password:  [hidden]
? Confirm your password:  [hidden]
? Is super admin?  true
[OK] User [email protected] added

Change user properties

You can change an user property by typing:

$ blynkcli user set [email protected] energy 15000
[OK] Property energy set to 15000
[WARN] You must restart the server to apply the effect

Now we can check the new value:

$ blynkcli user get [email protected] energy
energy: 15000

Clone Projects from one user to another

blynkcli user clone-projects [email protected] [email protected]
[OK] [email protected] projects cloned from [email protected]
[WARN] You must restart the server to apply the effect
[OK] Backup done! You can find it in /home/sephir/.blynkcli/backup/auto-cloneProfile/07221e9e-3f09-46dc-914a-

Change user password

blynkcli user password [email protected]
? Password:  [hidden]
? Confirm your password:  [hidden]
[WARN] You must restart the server to apply the effect