LinuxCommandLibrary

git-browse-ci

Browse CI results from the command line

TLDR

Open the current repository's CI configuration on its upstream website

$ git browse-ci
copy

Open the current repository's CI configuration on its upstream website for a specific remote
$ git browse-ci [remote]
copy

SYNOPSIS

git browse-ci [] [--provider ] [--open] [--help]

PARAMETERS


    The Git commit, branch, or tag to browse CI results for. If omitted, defaults to the current branch.

--provider
    Specifies the CI provider to use. If omitted, the script attempts to autodetect based on the repository. Common providers include Travis CI, GitLab CI, and GitHub Actions.

--open
    Automatically opens the CI results link in your default web browser.

--help
    Displays the help message.

DESCRIPTION

The `git-browse-ci` command helps you quickly access Continuous Integration (CI) build results directly from your Git repository. It identifies the relevant CI system(s) configured for your project (e.g., Travis CI, GitLab CI, GitHub Actions), retrieves the build status and link to logs for the specified commit or branch, and opens the link in your default web browser. This streamlines the debugging process by allowing you to investigate build failures directly from your terminal without manually searching for the corresponding CI run. The script tries to auto-detect based on git repository information but allows overriding parameters.

PROVIDER DETECTION

The script uses heuristics based on the contents of `.git/config` (remote URLs) and the presence of files like `.travis.yml` or `.gitlab-ci.yml` to automatically detect the CI provider. This may not always be accurate, so using the `--provider` flag is recommended for more reliable results.
The heuristics are likely to rely on remote names 'origin'.

DEPENDENCIES

The command requires Python and likely the `requests` library, and xdg-open. It also needs to read git configuration. The browser opening capability depends on `xdg-open`, `open`, `start` (platform-dependent commands).

SEE ALSO

git(1), git-log(1), xdg-open(1)

Copied to clipboard