Skip to main content
Perform software composition analysis, dependency management, or detect secrets in your code using Endor Labs.

Download and install endorctl

Use one of the following methods to download and install endorctl on your local system. After you install endorctl, you must authenticate. Then you can start scanning your code.

Install endorctl with Homebrew

Use Homebrew to efficiently install endorctl on macOS and Linux operating systems making it easy to manage dependencies, and track installed packages with their versions. Install endorctl from the Endor Labs tap with Homebrew by running the following commands. The tap is updated regularly with the latest endorctl release.

Install endorctl with npm

Use npm to efficiently install endorctl on macOS, Linux, and Windows operating systems making it easy to manage dependencies, track and update installed packages and their versions.
  1. Make sure that you have npm installed in your local environment and use the following command to install endorctl.
  2. Run the following command to get the npm global bin directory.
  3. Edit your shell configuration file and insert the path you obtained from the previous command.
  4. Reload your shell configuration and verify endorctl is installed.
  5. To update your version of endorctl, run the following command.
endorctl is available as an npm package and is updated regularly with the latest endorctl release.

Download and install the endorctl binary directly

To download the endorctl binary directly use the following commands:
EU SetupIf you’re using a EU tenant, use https://api.eu.endorlabs.com as the API endpoint.
You can also view these instructions via the Endor Labs application user interface:
  1. Select Projects from the left sidebar.
  2. Click Add Project.
  3. Choose CLI.
  4. Follow the on-screen instructions to download and install the appropriate version and architecture of endorctl for your system.

Authenticate to Endor Labs

You can authenticate to Endor Labs in multiple ways:
  1. Using the init command
  2. With an API token

Login with the init command

To log in with your supported authentication provider:
To log in with your supported authentication provider in environments without a browser you can use headless mode:

Login with an API Key

To log in with an API key you’ll need to set the following environment variables:
  • ENDOR_API_CREDENTIALS_KEY - The API key used to authenticate against the Endor Labs API.
  • ENDOR_API_CREDENTIALS_SECRET - The API key secret used to authenticate against the Endor Labs API.
  • ENDOR_NAMESPACE - The Endor Labs namespace you would like to scan against. You can locate the namespace from the top left hand corner of the screen under the Endor Labs logo on the Endor Labs application.
    If you use Endor Labs with an EU tenant, use https://app.eu.endorlabs.com instead of https://app.endorlabs.com.
To get an API Key and secret for use with endorctl, see Managing API Keys. To set your environment variables run the following commands and replace each example with the appropriate value.
Once you’ve exported your environment variables you can test successful authentication by running the following command to list projects in your namespace.
If you do not have any projects in your namespace you will get an empty json output, which means you are successfully authenticated.
Once you have successfully initialized endorctl, you can print your access token with the following command.
The token has an expiration time of 4 hours.

Clone your repository

Upon successful authentication to Endor Labs using endorctl, proceed to clone the repository you intend to scan. If you prefer initiating with a dummy app for scanning, feel free to skip to the next step. To clone a Git repository, use the git clone command followed by the clone link of the repository. You can find the URL on the repository’s page on a platform like GitHub or GitLab. For example,
Replace https://github.com/username/repo-name.git with the actual URL of the Git repository you want to clone. Navigate to the repository you’ve cloned.

Software prerequisites for endorctl scan

The following prerequisites must be met to scan with Endor Labs: For more information, see endorctl commands and working with the API.

Build your software

To run a complete and accurate scan with Endor Labs, ensure that the software can be successfully built, incorporating well-formatted manifest files. To maximize the benefits of an Endor Labs OSS scan, you should perform a comprehensive testing as a post-build step, either locally or in a CI pipeline. Use the following commands to verify that the software can be built successfully with well-formatted manifest files before initiating the scan.

Persistently set environment variables for endorctl

To persistently set an environment variable, append the environment variable and the value to ~/.endorctl/config.yaml. This configuration file is for CLI usage. For example, if your GitHub Enterprise Server URL was https://api.github.com you can set the variable to persist in your configuration using the following command.
See endorctl commands for all supported commands and environment variables.