Using DeepSource CLI

The DeepSource CLI provides multiple commands to help you interact with DeepSource. You can use any of the available commands with the following syntax:

deepsource <command> [<arguments>]

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

Available Commands

report

Report artifacts like test coverage to DeepSource.

deepsource report --analyzer=test-coverage --key=python --value-file=coverage.xml

Flags

  • --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

config

Manage your DeepSource configuration.

Sub-commands

  • generate: Generate starter configuration file, .deepsource.toml, for a repository

    deepsource config generate
    
  • validate: Validate the .deepsource.toml config file

    deepsource config validate
    

auth

Manage authentication with DeepSource.

Sub-commands

  • login: Authenticate with your DeepSource account or create a new one

    deepsource auth login
    
  • logout: Log out of your active DeepSource account

    deepsource auth logout
    
  • refresh: Refresh the stored authentication credentials

    deepsource auth refresh
    
  • status: View the authentication status

    deepsource auth status
    

repo

Work with repositories managed by DeepSource.

Sub-commands

  • status: Show the activation status of a repository on DeepSource

    deepsource repo status
    
  • view: Open the DeepSource dashboard of a repository

    deepsource repo view
    

Flags

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

issues

View issues detected by DeepSource.

Sub-commands

  • list <file_path>: Show the list of issues in a file in a repository.
    deepsource issues list src/main.py
    

Flags

  • --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.

version

Get the version of the installed DeepSource CLI.

deepsource version

help

Display help information for the CLI or a specific command.

deepsource help
deepsource <command> --help

completion

Generate shell completion scripts to enable command autocompletion.

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.

Argument

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

Usage Examples

Reporting Test Coverage

deepsource report --analyzer=test-coverage --key=go --value-file=coverage.out

Checking Repository Status

deepsource repo status

Viewing Issues in a File

deepsource issues list src/main.py --limit 10

Generating a Configuration File

deepsource config generate