modality user
Command: modality user
Create, manage, and retrieve information about users. This command's functionality is exposed via subcommands:
modality user create
modality user inspect
modality user inspect-auth-token
modality user list
modality user mint-auth-token
modality user use
# modality user create
Command: modality user create <user name>
Add a new user.
# Example
$ modality user create jsmith
Created user 'jsmith'
$ modality user create jdoe --format json
{
"is_default": false,
"user": "jdoe"
}
# Options
<user name>
- Name for the new user.
-f, --format <text | json>
- The printed output format. Defaults to text
.
--use
- Set the newly created user as the default user. This is equivalent to running modality user create <name> && modality user use <name>
.
# modality user inspect
Command: modality user inspect [user name]
Print detailed information about the given user. If no user name is specified this command prints information about the current default user (set with modality user use
).
# Example
$ modality user inspect jdoe
User: jdoe
Tokens: 1
allow-http-api=true
allow-ingest=true
allow-mutation=true
# Options
[user name]
- Name of the user to inspect. If not specified this command prints information about the current default user (set with modality user use
).
-f, --format <text | json>
- The printed output format. Defaults to text
.
# modality user inspect-auth-token
Command: modality user inspect-auth-token [auth token]
Print detailed information about the given auth token. If no auth token is specified this command prints information about the token that is currently in scope, if any.
# Example
$ modality user inspect-auth-token .user-auth-token
User: jdoe
allow-http-api=true
allow-ingest=true
allow-mutation=true
# Options
[auth token]
- Auth token to inspect. This can either be a path to an auth token file or an auth hex token string. If not specified this command prints information about the token that is currently in scope, if any.
-f, --format <text | json>
- The printed output format. Defaults to text
.
# modality user list
Command: modality user list
List all known users, as well as the current default user, if any.
# Example
$ modality user list
Current user: 'jdoe'
Users: 4
'foo'
'bar'
'jsmith'
'jdoe'
# Options
-f, --format <text | json>
- The printed output format. Defaults to text
.
# modality user mint-auth-token
Command: modality user mint-auth-token <output path>
Create a new auth token file for a user. Auth tokens are required to use the CLI (via the modalityd
HTTP API) and to add data to the modality database.
The CLI automatically looks for an auth token file named .user_auth_token
in the default modality config directory, generally ~/.config/modality_cli
. In addition, the CLI will look for an auth token hex string in the environment variable MODALITY_AUTH_TOKEN
. This auth token must have been created with --allow-http-api
.
For getting data into the modality database use the modality-reflector
command. This command looks for an auth token in a file named .modality-reflector-auth-token
in the current working directory. It will also look for an auth token hex string in the same place as the modality CLI, the MODALITY_AUTH_TOKEN
environment variable. This auth token must have been created with --allow-ingest
.
Since the modality
analysis CLI and the modality-reflector
data collection command both look for an auth token hex string in the same environment variable, if you are using the same machine for data collection and analysis it is recommended to create an auth token with both --allow-ingest
and allow-http-api
if you use the environment variable.
# Example
$ modality user mint-auth-token --allow-ingest .modality-reflector-auth-token
Minted auth token for user 'jdoe'
# Options
<output path>
- Output file path for the created auth token.
--allow-http-api
- Give the newly created auth token permission to use the modality
analysis CLI.
--allow-ingest
- Give the newly created auth token permission to use the modality-reflector
data collection commands.
-f, --format <text | json>
- The printed output format. Defaults to text
.
--user <user name>
- Link the auth token to the given user rather than to the current default user (set with modality user use
).
# modality user use
Command: modality user use <user name>
Set the default user.
# Example
$ modality user use jdoe
Using 'jdoe' as the default user
# Options
<user name>
- Name of the user to use as default.
--force
- Use the given name as the default user even if it doesn't currently exist. Attempts to create the given user if necessary.
-f, --format <text | json>
- The printed output format. Defaults to text
.