Pulp CLI is a command-line interface for managing Pulp 3 resources and interacting with Pulpcore's REST API. It serves as a client for various Pulp plugins (e.g., pulp_ansible, pulp_file, pulp_rpm) to perform tasks like listing repositories, synchronizing content, and managing distributions. Currently at version 0.39.0, the library is under active development, and its status is considered 'beta', implying that future releases may introduce backwards-incompatible changes.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
The Pulp CLI requires initial configuration to connect to a Pulp 3 server. This typically involves setting the base URL, username, and password, which can be done via `pulp config create` or environment variables. After configuration, you can verify the connection with `pulp status` and interact with various Pulp resources.
import os
# Configure Pulp CLI. This creates or updates ~/.config/pulp/cli.toml
# In a real scenario, avoid hardcoding credentials. Use environment variables or a .netrc file.
# Example using environment variables:
# export PULP_BASE_URL="http://localhost:8080"
# export PULP_USERNAME="admin"
# export PULP_PASSWORD="password"
base_url = os.environ.get('PULP_BASE_URL', 'http://localhost:8080')
username = os.environ.get('PULP_USERNAME', 'admin')
password = os.environ.get('PULP_PASSWORD', 'password')
# This command is meant to be run in a shell, not directly via Python subprocess
# For demonstration, it's shown as a shell command.
print(f"Setting up Pulp CLI configuration for {base_url}...")
print(f"pulp config create --base-url {base_url} --username {username} --password {password}")
# To verify connection and list available repositories
print("\nVerifying Pulp server status:")
print("pulp status")
print("\nListing file repositories (example):")
print("pulp file repository list")
# To see full help for a command:
print("\nTo view full help for the 'pulp' command:")
print("pulp --help")
pulp --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.