Source location - lifeomic/cli
- Project Status
- Getting Started
- node version >= 12.0.0
npm install -g @lifeomic/cli yarn global add @lifeomic/cli
or you can download and install the binary from the latest release.
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.
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_REFRESH_TOKEN environment variables. With these set, you can bypass using
To use an API key for authentication, follow the Setting 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.
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.
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
Getting the Source¶
This project is hosted on GitHub. You can clone this project directly using this command:
git clone firstname.lastname@example.org:lifeomic/cli.git
Run tests with
npm test yarn test
This project uses Semantic Versioning.
This project is licensed under the MIT License - see LICENSE file for details.
See the list of contributors who participate in this project.
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