Command Line Interface (CLI)

DeepSource CLI helps you access and interact with DeepSource right from your terminal.



  • To install the DeepSource CLI with homebrew, run:
brew install deepsourcelabs/cli/deepsource


  • To directly install the CLI as a binary, run:
curl | sh

This script will detect the operating system and architecture and puts deepsource binary in ./bin/deepsource. You can set a custom location for the CLI installation script to download the binary to using an environment variable, BINDIR. The default location is ./.bin/deepsource (the .bin directory will be created if it doesn't already exist).

This can be helpful when you want the CLI to be installed to a directory in the PATH, like ~/.local/bin or /usr/local/bin to make it accessible from anywhere:

BINDIR=~/.local/bin curl | sh


  • Download compressed binary here.
  • Decompress the binary.
  • To invoke the binary, run:
.\deepsource report --analyzer=test-coverage --key=go --value-file=coverage.out.

The CLI requires that the tests are run inside a git repo, and that the git binary is installed. The DEEPSOURCE_DSN value needs to be set in the environment, too.

Supported operating systems

  • Linux
  • Darwin
  • Windows
  • FreeBSD
  • OpenBSD
  • NetBSD

Supported architectures

  • i386
  • x86_64
  • arm64


DeepSource CLI is used in two scenarios:

Text-based User Interface (TUI)

To use DeepSoure CLI in your local environment (terminal , run deepsource auth login to authenticate the CLI with DeepSource. C

deepsource auth login

Please copy your one-time code: XYZXYZ
Press enter to open in your browser...

Report code coverage


You can use an of the available commands with the following syntax:

./bin/deepsource <command> [<arguments>]


See ./bin/deepsource <command> --help to read about a specific subcommand or concept right from the CLI.



Report artifacts to DeepSource.


  • --key: Shortcode of the language (example: python, go, javascript, ruby, java, scala, php, csharp, cxx, rust)
  • --analyzer: Name of the analyzer (example: test-coverage)
  • --value: Value of the artifact
  • --value-file: Path to the artifact value file


The --help flag can be used with any command to display the help for that command. When used alone, the help command displays general help for the entire CLI.



  • generate: Generate starter configuration file, .deepsource.toml, for a repository
  • validate: Validate the .deepsource.toml config file



  • login: Authenticate with your DeepSource account or create a new one
  • logout: Log out of your active DeepSource account
  • refresh: Refresh the stored authentication credentials
  • status: View the authentication status



  • status: Show the activation status of a repository on DeepSource
  • view: Open the DeepSource dashboard of a repository


  • --repo/-r: URL of the repository. If not specified, the repo command respects the repository corresponding to the current working directory.



  • list <file_path>: Show the list of issues in a file in a repository.


  • --repo/-r: URL of the repository to fetch issues from
  • --limit/-l: Number of issues to display at once. By default, the limit is set to 30.


Get the version of the installed DeepSource CLI.


The DeepSource CLI supports autocompletion for macOS and Linux to make it easier to use the right commands with the CLI with the Bash and ZSH shells. Get the autocompletion script by running deepsource completion <shell> and add it to the corresponding shell config to get autocompletion for various deepsource CLI commands.


Shell completion scripts are not currently supported on Windows.


  • shell: The shell for which autocompletion commands will be generated. Shells that are currently supported are: bash, fish, powershell and zsh.