Skip to main content
Using access-cli
Barracuda Admin avatar
Written by Barracuda Admin
Updated over a year ago

When run without arguments, access-cli presents a list of available commands. It also shows where it will save and look for the configuration files, unless overridden. To use the client with a CloudGen Access Enterprise Console ('console') endpoint other than the default (enterprise.fyde.com), you should start by setting the endpoint.

You can then proceed to log in with your console credentials:

$ access-cli login
Email address: you@example.com
Password:
Logged in successfully, access token stored in (...)access/access-cli/auth.yaml

You can now use other commands. For example, to list users, you can use:

access-cli users list

W hen using files to import data, to prevent errors, make sure that encoding of the file is verified as UTF-8. Other encodings may not necessarily work and can lead to errors such as "Error: name: can't be blank".

Command Help

All commands provide a help text with the available sub-commands and flags. For example, running access-cli resources will let you know about the get, list, add, edit and delete sub-commands, and access-cli resources list --help will list all available flags for the list resources command, including pagination, sorting, and filtering flags.

Output Formats

access-cli supports different output formats for different use cases:

  • Table, for interactive usage (--output=table)

  • CSV (--output=csv)

  • JSON (--output=json or --output=json-pretty)

By default, when an interactive terminal is detected, table output is used. Otherwise, json is used. JSON output generally contains the most information, sometimes including nested objects; CSV output corresponds to a CSV version of the table output.

All output formats are subject to pagination parameters, when those are available.

Additional output options are available for record creation and editing commands:

  • --errors-only - output will be restricted to records whose creation/editing failed.

Example: Export all user

$ access-cli users list --list-all --output=json

Input Formats

In addition to receiving input through the command line, when adding or editing records, access-cli can read record information from JSON or CSV files. For more information, see the documentation on Batch Mode Operations.

Behavior on Error

When creating, editing, or deleting multiple records at one time, access-cli will, by default, stop on the first error. However, you may want to perform the operation on a “best effort” basis, where access-cli will continue processing the remaining records/arguments regardless of previous server-issued errors. This can be enabled using the --continue-on-error flag. When this flag is passed, access-cli never exits with a non-zero code, as long as the input is correctly formatted and all errors come from server-side operations.

Did this answer your question?