Skip to main content

Getting Started

Once you have installed the Carium CLI, you can use it to interact with the Carium platform.

However, if you try to run a crm command without logging in, you will receive an error.

crm sw-patient list
Can not find login information. Have you logged in? `crm login`

Logging In

From time to time, you will need to log in to Carium via the CLI. This is done with the crm login command.

If this is the first time you are using the CLI, you will be prompted to create a file at ~/.carium/sdk.yaml with your Carium username and password. This file will be used to authenticate you with the Carium API when crm login is run.

$ crm login
Carium SDK Configuration File not found at "~/.carium/sdk.yaml"!
Resolve this by running:
...
Finally, edit ~/.carium/sdk.yaml and insert your Carium username and password.
(~/.carium/sdk.yaml is absolutely located at /home/username/.carium/sdk.yaml)

Once you have created the ~/.carium/sdk.yaml file and entered your Carium username and password, further crm login commands will log your account in.

info

If your account has MFA enabled, you will receive an error when you login unless you provide the MFA code by appending ---mfa-totp 0123435 to the crm login command.

$ crm login
400 MfaRequired -- Multi-factor Authentication Required; Supply MFA token with --mfa-totp=012345

$ crm login --mfa-totp 987654

After login successfully, you should be able to see the login status with whoami command.

$ crm whoami
api-host : https://api.carium.com
docs : {'source-url': 'http://carium-prod-staticfiles.s3-website-us-west-2.amazonaws.com/static/overlord'}
email : user1@carium.com
first-name :
individual : 11111111-2222-3333-4444-555555555555
last-name :
locale : en_US
locale-explicit: True
multi-organization: False
organization : 99999999-9999-9999-9999-999999999999 acme1
organizations : ['99999999-9999-9999-9999-999999999999']
session-id : 44444444-4444-4444-4444-444444444444
tz : America/Los_Angeles
tz-explicit : True
user-id : 00000000-1111-2222-3333-444444444444
username : user1@carium.com

Logging Out

At any time, you can log out of the Carium CLI with the crm logout command.

$ crm logout

This will invalidate your session and require you to log in again with crm login.

Tips and Tricks