Cross-platform command line client for CloudGen Access Enterprise Console APIs.
access-cli enables interaction with the CloudGen Access Console using the command line. It is designed with both interactive usage and scripting in mind.
access-cli is written in Go and supports different architectures. We provide pre-built i386 and x86-64 Windows and Linux binaries and x86-64 macOS binaries. deb and rpm packages are also provided. You can use access-cli in other architectures by compiling from source.
access-cli supports most operations possible with the web version of the CloudGen Access Enterprise Console, enabling batch mode for certain operations (like adding multiple users from a CSV file or a JSON dump). The following operations are implemented:
access-cli will be continually updated to support new management console features.
If you use Homebrew on Linux or Mac, we recommend installing access-cli through our Homebrew tap - instructions in the tap repo.
If you are using an operating system and architecture for which we provide pre-built binaries, we recommend using those. Just download the appropriate archive from the releases page. We also provide deb and rpm packages. The access-cli binaries are statically compiled and have no external dependencies.
Inside each archive, you'll find the executable for the corresponding platform, a copy of this document and the license. Simply extract the executable and place it where you find most convenient (for example, in most Linux distros, you could use /usr/local/bin
for a system-wide install).
Don't forget to add the executable to $PATH
, or equivalent, if desired.
If we do not provide a pre-built binary for your platform, or if you want to make changes to access-cli, you can compile it yourself, following the instructions in the documentation.
When run without arguments, access-cli presents a list of available commands. It will also show where it is going to save and look for the configuration files, unless overridden.
To use the client with an endpoint other than the default, you should start by setting the endpoint:
$ access-cli endpoint set accessconsole.example.com
Endpoint changed to accessconsole.example.com.
Credentials cleared, please login again using `access-cli login`
See this page for more information about using different endpoints.
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
.
All commands provide a help text with the available subcommands and flags.
For example, running access-cli resources
will let you know about the get
, list
, add
, edit
and delete
subcommands, and access-cli resources list --help
will list all available flags for the list resources command, including pagination, sorting and filtering flags.
access-cli supports different output formats for different use cases:
--output=table
)--output=csv
)--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 failedWhen adding or editing records, access-cli can receive input in three different ways:
--from-file=filename.json --file-format=json
(--file-format=json
is the default and can be omitted)
--from-file=filename.csv --file-format=csv
The expected formats when using JSON and CSV files are documented in the access-cli docs.
When creating, editing or deleting multiple records in one go, by default access-cli will stop on the first error.
However, one may want to perform the operation in 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.
You can see existing issues and report new ones on GitHub.
access-cli is Copyright © 2023 Barracuda Networks, Inc. and is licensed under the Apache License, Version 2.0, a OSI-approved license.