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

barracks-cli

v2.0.4

Published

A CLI tool for Barracks

Downloads

17

Readme

Build Status Coverage Status npm version

Barracks logo

Barracks CLI

The Command Line Interface tool to interact with the Barracks API

Requirements

Node.js >= 6.x

Installation

$ npm install -g barracks-cli

Usage

At any moment, if you want to know what you can do with the CLI or if you need any help about a specific command, you can use the help command:

$ barracks help

  Usage: barracks [options] [command]


  Commands:

    login          Authenticate to Barracks
    account        Get account information
    update [cmd]   Manage updates
    device [cmd]   Manage devices
    segment [cmd]  Manage segments
    token [cmd]    Manage tokens
    check-update   Check for an update the same way a device would
    help [cmd]     display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

You need to login to Barracks before using any other command:

$ barracks login
email: [email protected]
password:
Authentication successful

Barracks V2 support

Enable the V2 flag to access new features of Barracks. To do so, just enable the V2 flag :

$ export BARRACKS_ENABLE_V2=1

Now, you have access to all V2 features

$ barracks help

  Usage: barracks [options] [command]


  Commands:

    login          Authenticate to Barracks
    account        Get account information
    device [cmd]   Manage devices
    filter [cmd]   Manage filters
    package [cmd]  Manage packages
    token [cmd]    Manage tokens
    help [cmd]     display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Features

Currently, the following features are available through the CLI:

  • Login to your Barracks account
  • Display account information
  • Manage updates
    • List all updates
    • Create a new update
    • Edit an update draft
    • Publish an update
    • Archive an update
    • Schedule an update
  • Manage devices
    • List all registered devices
    • Display detailed information of a device
    • List event history of a device
  • Manage segments
    • List all segments
    • Create a new segment
    • Edit an existing segment
    • Change active segments
  • Manage API tokens
    • List all API tokens
    • Create a new API token
    • Revoke an existing API token
  • Simulate a device checking for update

With Barracks V2 enabled

  • Login to your Barracks account
  • Display account information
  • Manage devices
    • List all registered devices
    • Display detailed information of a device
    • List event history of a device
  • Manage filters
    • List all filters
    • Create a new filter
    • Display filter information
    • Remove an existing filter
  • Manage packages
    • List all existing packages
    • Create a new package
    • Display detailed information of a package
    • Publish a deployment plan for a package
    • Display detailed information of a deployment plan
    • List all versions of a packages
    • Create a new version of a package
    • Display detailed information of a version
  • Manage API tokens
    • List all API tokens
    • Create a new API token
    • Revoke an existing API token

Docs & Community

Examples

Create a new update

$ barracks update create --title "My Update" --segment Other --versionId v0.0.14 --package /home/barracks/packages/0.0.14/update.zip

Get event history of a device

$ barracks device get "unit_qwerty1234"

Emulate a device checking for an update

barracks check-update --unitId EmulatedDeviceId --versionId "0.1"
barracks check-update --unitId EmulatedDeviceId --versionId "0.1" --customClientData '{ "key1":"value1", "key2":"value2" }'
barracks check-update --unitId EmulatedDeviceId --versionId "0.1" --customClientData '{ "key1":"value1", "key2":"value2" }' --download ~/Downloads/update.sh

With Barracks V2 enabled

Get event history of a device

$ barracks device get "unit_qwerty1234"

Create a filter

$ barracks filter create --name "exampleFilter" --query '{ "regex": { "unitId": ".*qwerty.*" } }'

Get all devices matching a filter

$ barracks device ls --filter "exampleFilter"

Create a package

$ barracks package create --reference io.barracks.app1 --name "Barracks Appli 1"

Create a version for a package

$ barracks package version create --versionId v1 --name "App 1 - Version 1" --packageReference io.barracks.app1 --file ~/versions/app1_v1_.sh

Publish a deployment plan for a package

$ barracks package plan publish --file ~/ressources/app1_plan.json
$ cat ~/ressources/app1_plan.json | barracks package plan publish

License

Apache License, Version 2.0