Setup CLI
For this tutorial, we will set up the IGUHealth CLI.
Install
To start out, we need to install the cli package via npm.
npm install -g @iguhealth/cli
Setup client application
For CLI authorization, we need to setup a client app with client credentials.
- Login to the cloud admin console or your self-hosted console.
- Click Client Application under the Security Group.
- Set a name and grant the type of client credentials.
- Set a client secret
- Click Actions and click Create.
- Write down the client ID and client secret.
- Click Access Policies under the Security group.
- Click Create New (or, if you have an existing policy you want to use, click that policy).
- Fill in the name and code.
- For full access, set the type property to Full Access; if limited access, set FHIR Rest.
- If not set to full access, click Add Access and set what access you want for CLI.
- Click Add Target and link your client application you created in step 5.
Setup the CLI tenant.
- In the CLI, run
iguhealth config add-tenant
. - Fill in the prompts with values pulled from the Admin Application settings page.
- Set up the client ID and client secret you wrote down in Step 6 of the Setup Client application.
- Switch to the tenant you've setup in
iguhealth config switch-tenant
. - Test your connection with various API commands. Run the following to see the API commands available:
iguhealth api