3.1. CLI Quickstart

3.1.1. Install the package

$ pip install axonius-api-client

See also

Installation for more details.

3.1.2. Setup connection information

$ echo "AX_URL=x" >> .env
$ echo "AX_KEY=x" >> .env
$ echo "AX_SECRET=x" >> .env
$ chmod 600 .env

See also

API Key and Secret to get the values for AX_KEY and AX_SECRET.

Connection Options for more details.

3.1.3. Use the axonshell CLI

After installing this package, a script called axonshell will be added to the scripts directory for python.

Show the main help page:

$ axonshell

Show the help pages for main command groups:

$ axonshell devices
$ axonshell users
$ axonshell adapters
$ axonshell tools

3.1.4. Quick Get Assets Example

Get a report of all device assets matching a query that shows all assets seen in the last 3 days. Also include the columns for AWS device type and OS Type:

$ axonshell devices get \
  --query '(specific_data.data.last_seen >= date("NOW - 3d"))' \
  --field aws:aws_device_type \
  --field os.type

See also

CLI Commands for the list of all commands across all command groups.