Giter VIP home page Giter VIP logo

cli's Introduction

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

cli's People

Contributors

alexccl avatar anthonyroach avatar atolivero avatar bmamlin avatar cluebbehusen avatar david-wb avatar dependabot[bot] avatar dmmiller612 avatar evanheisler avatar greenkeeper[bot] avatar hemp avatar indigocarmen avatar jagoda avatar jhbeard avatar jjbeavers-lifeomic avatar joedimarzio avatar keeslinp avatar leothelocust avatar loscm avatar markdlv avatar mdlavin avatar mjtieman avatar morpheusnephew avatar mschroering avatar playdohdoh avatar rmneidermyer avatar rob-snyder avatar ryanratcliff avatar swain avatar taylordeatri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.