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

@lifeomic/cli

v13.13.0

Published

CLI for interacting with the LifeOmic PHC API.

Downloads

268

Readme

CLI

This command line interface provides functionality offered by LifeOmic's Precision Health Cloud APIs inside an interactive terminal or in a scripted environment.

CLI Demo

  1. Project Status
  2. Getting Started
    1. Dependencies
    2. Installation
    3. Configuration
    4. Authentication
      1. API Keys
      2. SSO
  3. Usage
  4. Contributing
    1. Getting the Source
    2. Running Tests
    3. Release Process
    4. Versioning
  5. License
  6. Authors
  7. Acknowledgements

Project Status

License Downloads Version PRs Welcome

Back to top

Getting Started

Dependencies

  • node version >= 12.0.0

Installation

Install via npm or yarn:

npm install -g @lifeomic/cli

yarn global add @lifeomic/cli

or you can download and install the binary from the latest release.

Configuration

Run lo setup to configure the default environment and account you wish to use. You can later override the default account using the -a option for commands.

Authentication

Use lo auth to obtain access credentials when using username / password authentication. A browser will be opened and you can enter your credentials in the LifeOmic login view.

You can also use the client credentials grant flow for obtaining access tokens. To do this, create a custom authentication client here and be sure to select the Client credentials flow under the Allowed OAuth Flows section. Run lo setup again and choose Y to use a custom authentication client and enter the client ID and secret and then choose Y again to use client credentials for authentication. Note that for this option, you do not need to run lo auth as username and password credentials are not used for this credentials grant.

You can also provide an API key or access and refresh tokens in the PHC_ACCESS_TOKEN and PHC_REFRESH_TOKEN environment variables. With these set, you can bypass using lo auth.

API Keys

To use an API key for authentication, follow the Set Up API Keys instructions to create the key. You can also use the command lo api-keys-create. Be sure to capture the value of the API key when it is created as you will not be able to retrieve the value after the first attempt. Run lo setup and choose 'Y' to use an API key and provide the API key value.

SSO

If you wish to use SSO, then you need to create a custom authentication client here and configure your SAML 2.0 identity provider. For the callback URL on the authentication client, be sure to add http://localhost:8787. Then run lo setup again and choose 'Y' to use a custom authentication client and provide the client ID and secret (if a private client was created). When running lo auth again, a browser should open and be redirected to the identity provider being used for SSO.

Usage

lo <command> [options]

lo offers many commands and those can be displayed by using the -h / --help command line option. For example:

❯ lo --help

  Usage: lo <command> [options]

  Options:

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

  Commands:

    accounts [options]                 List accounts
    accounts-get [options] <account>   Fetch an account
    ...
    </abbreviated>

Get help for a specific command:

❯ lo <command> --help

❯ lo tasks --help

  Usage: tasks [options] <datasetId>

  List tasks

  Options:

    -a, --account <account>            Override the default LifeOmic account
    --json                             Print output as JSON
    --prefix <prefix>                  Filter tasks where the name begins with a prefix
    --state <state>                    Filter tasks by state
    --view <view>                      Specify MINIMAL to just get task state
    --page-size <pageSize>             Number of items to return (default: 25)
    --next-page-token <nextPageToken>  Next page token
    -h, --help                         output usage information

Back to top

Contributing

We encourage public contributions! Please review CONTRIBUTING.md and CODE_OF_CONDUCT.md for details on our code of conduct and development process.

Getting the Source

This project is hosted on GitHub. You can clone this project directly using this command:

git clone [email protected]:lifeomic/cli.git

Running Tests

Run tests with npm or yarn:

npm test

yarn test

Release Process

Releases are created by making a PR, incrementing the version in package.json, merging the PR, and then finally tagging master with a tag like v4.5.3.

Packages for each release are published to npm. See CHANGELOG.md for release notes.

Versioning

This project uses Semantic Versioning.

Back to top

License

This project is licensed under the MIT License - see LICENSE file for details.

Back to top

Authors

See the list of contributors who participate in this project.

Back to top

Acknowledgements

This project is built with the following:

  • axios - Promise based HTTP client for the browser and node.js
  • yargs - CLI argument parser
  • configstore - Easily load and persist config without having to think about where and how
  • ava - Testing framework

Back to top