Installation
Copr provides two main client tools for interacting with the build service: the command-line interface (copr-cli) and the Python client library (python-copr). Choose the tool that best fits your workflow.
copr-cli
Thecopr-cli tool is a command-line interface for managing Copr projects, submitting builds, and monitoring build status.
Install on Fedora
On Fedora systems, install copr-cli using DNF:Install on RHEL/CentOS
For RHEL and CentOS systems, first enable EPEL:Install from PyPI
You can also install copr-cli using pip:Verify installation
Check that copr-cli is installed correctly:Configuration
Generate API token
Before using copr-cli, you need to configure authentication:Log in to Copr
Visit copr.fedorainfracloud.org and log in with your FAS account.
Get your API token
Navigate to the API page.
~/.config/copr
Alternative: Use GSSAPI authentication
If you have Kerberos configured, copr-cli can use GSSAPI authentication automatically without an API token:GSSAPI authentication is enabled by default in copr-cli. You can disable it in your configuration file by adding
gssapi = False.python-copr
Thepython-copr library provides programmatic access to Copr functionality. Use this library to integrate Copr into your Python applications and automation scripts.
Install on Fedora
Install the Python 3 client library:Install on RHEL/CentOS
First enable EPEL, then install:Install from PyPI
Install using pip:Verify installation
Test the installation in Python:Basic usage
copr-cli examples
python-copr examples
Here’s a basic example using the python-copr library:Building from Git with python-copr
Shell completion
Enable shell completion for copr-cli to get command and argument suggestions.Bash
Add to your~/.bashrc:
Zsh
Add to your~/.zshrc:
Shell completion requires the
argcomplete package. Install it with pip install argcomplete if not already available.Getting help
Command-line help
View available commands:Man pages
Read the manual page:Python library documentation
The python-copr library includes comprehensive documentation:- API documentation: python-copr.readthedocs.org
- Source code: github.com/fedora-copr/copr/tree/main/python
Troubleshooting
Command not found
Ifcopr-cli command is not found after installation:
- Verify the package is installed:
rpm -q copr-cli - Check your PATH includes
/usr/bin - Try logging out and back in
Authentication failures
- Verify your
~/.config/coprfile exists and has correct permissions - Check that the token hasn’t expired (regenerate from web UI if needed)
- Ensure the file format matches the example above
- Try with
--debugflag for more details:copr-cli --debug list
Import errors (Python)
If you getImportError: No module named copr:
- Verify installation:
pip list | grep coprorrpm -q python3-copr - Check you’re using the correct Python version
- If using virtual environments, ensure the package is installed in the active environment
SSL certificate errors
If you encounter SSL certificate verification errors:Next steps
Quickstart
Follow the quickstart guide to create your first project and build
API reference
Explore the full Copr API documentation
Build sources
Learn about different build source types and methods
Automation
Set up webhooks and automated builds