Configuration File Location
The copr-cli configuration file is located at:--config flag:
Obtaining API Token
To use copr-cli, you need an API token from the Copr service.For Fedora Copr
- Visit https://copr.fedorainfracloud.org/api/
- Log in with your Fedora Account
- Copy the configuration snippet provided on the page
- Save it to
~/.config/copr
For Custom Copr Instance
- Visit
https://YOUR.COPR.URL/api/ - Log in to your account
- Copy the configuration snippet
- Save it to
~/.config/copror a custom location
Configuration Format
The configuration file uses INI format:~/.config/copr
Configuration Parameters
Your Copr username
Base64-encoded login credential from the API page
API token for authentication
URL of the Copr instance (default: https://copr.fedorainfracloud.org)
Setting Up Configuration
Create Configuration Directory
Copy Configuration
Set File Permissions
Verifying Configuration
Test that your configuration is working:Authentication Methods
copr-cli supports two authentication methods:1. Token-Based Authentication (Default)
Uses thelogin and token values from the configuration file.
Advantages:
- Simple to set up
- Works on all systems
- Doesn’t require additional packages
2. GSSAPI/Kerberos Authentication
Uses Kerberos tickets for authentication (enabled by default for Fedora Copr). Advantages:- No API token expiration
- Single sign-on with Fedora Account
- More secure for enterprise environments
Regenerating API Token
API tokens expire periodically. To generate a new token:Method 1: Using Web Interface
- Visit the API page: https://copr.fedorainfracloud.org/api/
- Click “Regenerate token”
- Copy the new configuration to
~/.config/copr
Method 2: Using CLI
Multiple Copr Instances
If you work with multiple Copr instances, create separate configuration files:--config flag:
Advanced Configuration Options
Disable GSSAPI
If you want to disable GSSAPI and force token authentication:Connection Retries
The CLI automatically retries failed connections 3 times. This is hardcoded and cannot be changed via configuration.Debug Mode
Enable debug output without modifying the config:Disable Colors
Disable colored output:Troubleshooting
Error: Configuration file not found
Error: Authentication failed
- Check that your token hasn’t expired
- Regenerate your token:
copr-cli new-api-token - Or visit https://copr.fedorainfracloud.org/api/ and copy new credentials
Error: Permission denied
Error: Can’t detect who you are
This means authentication is not configured properly:- Ensure
usernameis set in config, OR - Enable GSSAPI and obtain Kerberos ticket, OR
- Use full project names with
owner/projectformat
Exit Status Codes
copr-cli returns different exit codes based on the result:| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Bad request (wrong project name, insufficient rights, etc.) |
| 2 | Wrong arguments |
| 3 | General error |
| 4 | Build failed or was canceled |
| 5 | Communication error with server |
| 6 | Configuration error |
| 7 | Authentication failed |
Next Steps
Now that you’ve configured copr-cli:- Commands Reference - Learn about available commands
- Examples - See real-world usage examples