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

@hardenize/cli

v0.53.0

Published

Hardenize CLI Tool

Downloads

89

Readme

Hardenize CLI Tool

This tool provides easy access to the Hardenize API.

Install

$ sudo npm i -g @hardenize/cli

Or:

$ git clone https://github.com/hardenize/hardenize-cli
$ cd hardenize-cli
$ sudo npm i -g

Updating

To see if there is a newer version (no output means you are):

$ sudo npm outdated -g @hardenize/cli

To upgrade to the latest version if you're not:

$ sudo npm i -g @hardenize/cli

Usage

Run without arguments or with help/--help/-h to see the list of options:

$ hardenize help
hardenize <command>

Commands:
  hardenize bash                      Show bash auto-completion script
  hardenize certs <command>           Manage certificates
  hardenize config <command>          Manage configuration at Hardenize
  hardenize dns-zones <command>       Manage dns zones
  hardenize events <command>          Manage events
  hardenize groups <command>          Manage groups
  hardenize hdb <command>             Search HDB
  hardenize hosts <command>           Manage hosts
  hardenize local_config <command>    Manage local configuration
  hardenize network-ranges <command>  Manage network ranges
  hardenize reports0 <command>        Manage reports (unstable)
  hardenize suborgs <command>         Manage organizations
  hardenize users <command>           Manage users

Options:
  --version     Show version number                                    [boolean]
  --config, -c  Path to configuration file
                                   [string] [default: "/home/picard/.hardenize"]
  --org         Organization (falls back to config default_org)         [string]
  --format      Output format (falls back to config "default_format", otherwise
                "table")
                      [choices: "table", "table-per-row", "yaml", "json", "csv"]
  --debug, -d   Displays debug information about API requests and responses
                                                                       [boolean]
  --help        Show help                                              [boolean]

Find our API documentation at https://www.hardenize.com/docs/api/v1/

You can also get additional help on a per-command basis. E.g:

hardenize certs <command>

Manage certificates

Commands:
  hardenize certs create        Create a certificate. (Reads PEM from stdin)
  hardenize certs get <sha256>  Get a certificate
  hardenize certs ls [host]     List certificates

Options:
  --version     Show version number                                     [boolean]
  --config, -c  Path to configuration file
                                    [string] [default: "/home/picard/.hardenize"]
  --org         Organization (falls back to config default_org)          [string]
  --format      Output format (falls back to config "default_format", otherwise
                "table")                [choices: "table", "yaml", "json", "csv"]
  --debug, -d   Displays debug information about API requests and responses
                                                                        [boolean]
  --help        Show help                                               [boolean]
$ hardenize certs create help
hardenize certs create

Create a certificate. (Reads PEM from stdin)

Options:
  --version     Show version number                                     [boolean]
  --config, -c  Path to configuration file
                                    [string] [default: "/home/picard/.hardenize"]
  --org         Organization (falls back to config default_org)          [string]
  --format      Output format (falls back to config "default_format", otherwise
                "table")                [choices: "table", "yaml", "json", "csv"]
  --debug, -d   Displays debug information about API requests and responses
                                                                        [boolean]
  --help        Show help                                               [boolean]
  --file, -f    Read cert from disk instead of stdin                     [string]

Configuration

Before you can run most commands, you will need to configure your credentials and a few other things by running hardenize local_config init

$ hardenize local_config init
* API Username: your api username
* API Password: your api password
  Default organization: your default org
  Default output format [table]: json
Configuration saved

Details will be saved to ~/.hardenize by default. Unless you specify the --config command line option to indicate a different path.

Many commands take an optional "--org" option. If you do not supply that arg, it will use the configured default org instead, or fail if there is none.

You can override configuration values using environment variables prefixed with HZ_. For example, to override a configuration item named "username", you would set the environment variable HZ_USERNAME

Most command simply display the results as returned from the API. By specifying --format on the command line, you can choose for them to be displayed in either table, table-per-row, yaml, json or csv format. The output defaults to your configs default_format option, or table if that does not exist.

Development

If you are a core developer of this library (you almost certainly aren't, unless you work for Hardenize Limited), you should check out DEVELOPMENT.md