LinuxCommandLibrary

copr-cli

Manage and build software using COPR repositories

TLDR

Show user logged in to copr

$ copr-cli whoami
copy

Build a local spec file on copr
$ copr-cli build [repository] [path/to/spec_file]
copy

Check status of builds
$ copr-cli list-builds [repository]
copy

Trigger a copr build of a spec-file from public (Git) repository
$ copr-cli buildscm [repository] --clone-url [https://git.example.org/repo] --spec [spec_file_name]
copy

SYNOPSIS

copr-cli [GLOBAL_OPTIONS] <command> [COMMAND_OPTIONS] [ARGUMENTS]

PARAMETERS

-h, --help
    Show a help message and exit for the main command or a specific subcommand.

--config-file CONFIG_FILE
    Specify an alternative path to the configuration file (default: /etc/copr/copr-cli.conf, ~/.config/copr/copr-cli.conf).

--no-config-file
    Prevent copr-cli from using any configuration files.

--result-url
    When applicable, show a URL to the build result or other resource.

--api-url API_URL
    Specify the URL of the Copr API endpoint to connect to.

--auth-url AUTH_URL
    Specify the URL of the Copr Authentication server.

--token TOKEN
    Provide an authentication token directly. This overrides any token found in configuration files.

--login LOGIN
    Log in to the Copr service, typically used to obtain a new authentication token.

--proxy PROXY
    Use a specified HTTP/HTTPS proxy for all network requests.

--no-ssl-verify
    Disable SSL certificate verification. Use with caution, as it can expose you to security risks.

--ca-file CA_FILE
    Specify a custom CA certificate file for SSL verification.

--debug
    Enable debug output, providing more detailed information for troubleshooting.

--verbose
    Enable verbose output, showing more information about operations.

DESCRIPTION

The copr-cli command is a powerful command-line interface tool designed to interact with the Copr build system. Copr is a Fedora infrastructure service that provides a public build service for RPM-based Linux distributions, including Fedora, RHEL, CentOS Stream, and EPEL.

copr-cli allows users to manage their Copr projects and builds directly from the terminal, bypassing the need for the web interface. It enables tasks such as creating new projects, submitting new package builds (from SRPMs, Git repositories, or existing dist-git repos), monitoring build statuses, managing project permissions, and listing existing projects or builds. This utility is particularly useful for developers, packagers, and maintainers who frequently build and test software, providing an efficient way to integrate Copr into their automated workflows and CI/CD pipelines.

CAVEATS

Successful interaction with the Copr service typically requires an active internet connection and a valid Copr account with appropriate permissions. For most operations, an API token or a successful login is mandatory. Be cautious when using --no-ssl-verify as it compromises security. The functionality of copr-cli is tightly coupled with the Copr API, meaning changes to the API might require updates to the client.

SUBCOMMANDS

copr-cli operates using a subcommand-based architecture. After the global options, you must specify a command that defines the action to be performed. Each subcommand has its own set of specific options and arguments. Common subcommands include:
build: Manage package builds (e.g., submit, monitor, cancel).
create: Create and manage Copr projects.
delete: Remove Copr projects, builds, or other resources.
list: List various Copr resources (projects, builds, repositories).
monitor: Continuously track the status of builds.
permissions: Manage user permissions for a project.
repo: Manage project repositories.
update: Modify existing projects.
To see options for a specific subcommand, use copr-cli <command> --help (e.g., copr-cli build --help).

AUTHENTICATION

To interact with the Copr service, you typically need to authenticate. This is most commonly done by obtaining an API token from the Copr web interface and storing it in your configuration file or providing it via the --token option. The --login option can also be used to facilitate interactive authentication.

HISTORY

The Copr build system was initiated as a Fedora project to provide flexible and accessible build services for RPM packages. As the service grew in popularity and functionality, the need for a robust command-line interface became apparent. copr-cli was developed as the official client, providing a programmatic way to interact with the Copr API. Its development has mirrored the evolution of the Copr service itself, with new features and commands being added to support expanded capabilities like enhanced build management, project permissions, and different source input types. It has become an indispensable tool for Fedora contributors, independent packagers, and anyone looking to distribute RPMs efficiently.

SEE ALSO

dnf(8), yum(8), rpm(8), mock(1), git(1)

Copied to clipboard