42Crunch CLI client

While user interface is great for visualisation, it can also come in the way. It may take longer and more clicks to do things on an UI, and you cannot automate it.

42Crunch CLI (command line interface) client lets you use the main features of 42Crunch Platform directly from the command line. This way you can choose which way of working you like best or which suits your needs.

This feature is currently available as a beta, and its development is still ongoing.

The CLI client lets you, for example, audit and scan you APIs or manage your API collections like before. It also lets you import OpenAPI definitions as a batch or, if you are an organization administrator, invite multiple users at one go to the platform. The help of the CLI client provides you more details on the available commands and how to use them.

The CLI client and the platform UI are not identical in terms of functions they offer: some things possible on the UI are not possible on the CLI, and the CLI has some functions not yet implemented on the UI.

Supported operating systems

The CLI client is available as a binary for the following operating systems:

If your operating system is not yet supported, do contact us, for example, at 42Crunch support.

You must have an account in 42Crunch Platform that you can use for the CLI client. If you do not yet have an account, click here to sign up.

If you run the CLI client as a binary, we recommend that you store your password in the default password manager of your operating system, and set your CLI client to use it from there. Your username is stored as part of your client configuration.

For added security, we also recommend using API tokens on the CLI client as much as possible. However, some commands require user credentials and cannot be run with API tokens. The commands that require user credentials are any commands under users, invitations, audit-summaries, tokens, and login.

For more details how to install and configure the CLI client, see Use 42Crunch Platform from CLI.

Listing resources on the CLI

The CLI client offers commands for listing several different resources you have access to in your organization, such as APIs, API collections, and teams.

Most of the commands are very straightforward: either the list command does not require parameters, or you supply the UUID of your target in a flag. However, as teams bring together multiple separate things (users, API collections, and team collaboration), using the list command has more options, too.

First, you must decide how to list teams:

  • List teams that have access to a particular API collection
  • List teams based on defined search criteria

If you list teams based on an API collection, you point the CLI to the collection you want using its UUID as per usual. You can also filter the teams based on the type of access they have (read-only or read/write)

To list teams based on search criteria, you can use two optional flags, team-filter and search:

  • team-filter: This flag defines how you want to search for a team: use name to search with the team name or leader to search with the team leader's email address.
  • search: This flag provides the string or pattern that CLI matches the property you have defined in team-filter. The string or pattern is case-sensitive and matching is started from the beginning.

The flags team-filter and search cannot be used separately, you must always define both if you want to search by teams.

You cannot combine listing by API collection and listing by search, including the flags specific for each method. Doing so results in an error.