Skip to content

DeepSourceCorp/cli

 
 

Repository files navigation

Docs | Get Started | Discuss

The Code Health Platform


CLI

Command line interface to DeepSource

Installation

macOS

DeepSource CLI is available on macOS via Homebrew:

brew install deepsourcelabs/cli/deepsource

Binary Installation

curl https://deepsource.com/cli | sh

This script will detect the operating system and architecture and puts deepsource binary in ./bin/deepsource.

Configuring DSN

In order to report test-coverage to DeepSource using the report command, an environment variable named as DEEPSOURCE_DSN has to be set. It's value will be available under 'Settings' tab of the repository page.

Authentication

Log in to DeepSource using the CLI:

# Browser-based login (interactive)
deepsource auth login

# Token-based login (for CI/CD or non-interactive environments)
deepsource auth login --with-token

# For DeepSource Enterprise instances
deepsource auth login --hostname HOSTNAME

For GitHub Actions, the report command supports OIDC authentication:

deepsource report --analyzer test-coverage --key go --value-file ./cover.out --use-oidc

Usage

The CLI provides access to a wide range of commands. Here is a list of the commands along with their brief description.

Usage:
    deepsource <command> [<arguments>]

Available commands are:
    auth        Authenticate with DeepSource
      login       Log in to DeepSource
      logout      Logout of your account
      refresh     Refresh authentication credentials
      status      View authentication status

    config      Generate and Validate DeepSource config
      generate    Generate .deepsource.toml config
      validate    Validate existing config

    issues      Show the list of issues in a repository
      list        List issues (supports --json, --csv, --sarif export)

    repo        Operations related to the repository
      status      View activation status
      view        Open DeepSource dashboard in browser

    report      Report artifacts to DeepSource
    version     Get the version of the DeepSource CLI

Help:
    Use 'deepsource <command> --help/-h' for more information about the command.

Documentation

For complete documentation, refer to the CLI Documentation

Feedback/Support

Want to share any feedback or need any help regarding the CLI? Feel free to open a discussion in the community forum

License

Licensed under the BSD 2-Clause "Simplified" License.

About

Command line interface to DeepSource

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 23