Skip to main content
PyPI Python version Documentation Status

cPanel Command Line Interface

cpanel_cli_icon

LÉAME en español

A command line interface for the cPanel Unrestricted API.

Swiftly execute commands in a terminal to manage a website, bypassing the need to log into cPanel and navigate through its web interface. This utility can also be seamlessly integrated into scripting tasks.

A portion of the cPanel UAPI (Unrestricted API) is implemented, enabling you to perform a wide array of functions with ease.

Some examples:

  • Create a backup of the account and store it in the remote user’s home directory:

    $ cpanel create backup home scott@example.com
  • Directly write files to the remote user’s home directory:

    $ cpanel write file public_html/index.txt "Hallo\nTschüss\n"
  • Create a new FTP user with a quota and personal directory:

    $ cpanel create ftp bill@example.com 'password' 1024 my_ftp
  • Create an email autoresponder:

    $ cpanel set mail autoresponder \
      scott@example.com \
      "Bruce Scott" \
      "This is an automatic message" \
      "I’m currently unavailable, please contact my boss." \
      "Tomorrow 6 PM" \
      "December 15, 8:00 AM"
  • Set the cPanel user interface language to French:

    $ cpanel set locale fr
  • List cPanel available features:

    $ cpanel list features
    
    {
        "addoncgi": 0,
        "addondomains": 1,
        "agora": 1,
        . . .
        "webmail": 1,
        "webprotect": 1,
        "zoneedit": 1
    }
  • List cPanel email accounts:

    $ cpanel list mail accounts
    
      [
          {
          "email": "scott@example.com",
          . . .
          }
      ]

And many more things. I intend to eventually fully cover the 500+ API functions available.

The output is JSON, so it’s easily parsable using a CLI JSON processor, like jq

See the User’s Guide for a complete reference of the implemented API functions.

Quick Start Guide

cpanel-cli works on Linux and macOS (it might work on Windows) and requires Python 3.11 or later.

For Linux, install Python 3.11 or later using your distro’s package manager.

For macOS, install Python 3.11 or later using Homebrew.

Create a .cpanelrc file in your $HOME directory with the following contents:

hostname=example.com
username=scott
utoken=ABCDEFGHIJKLMNOPQSRTUVWXYZ012345
  • hostname is the hostname of your cPanel instance

  • username is your username in your instance

  • utoken is an API token associated with username. See How to create an API token.

Then run:

$ python3 -m pip install --user cpanel-cli

Or, using uv:

$ uv tool install cpanel-cli

Test the installation using:

$ cpanel --version

User’s Guide

See the User’s Guide at https://cpanel-cli.readthedocs.io/en/stable/ for detailed installation and configuration instructions, as well as a complete reference of the implemented API functions.

Contributing

Pull requests are more than welcome. See CONTRIBUTING for a detailed guide on how to collaborate with this project.

What about Windows?

cpanel-cli should work on Windows 10/11 using WSL 2 (Windows Subsystem for Linux).

Unfortunately I don’t have access to a Windows system, so I can’t confirm this.


PyPI Versión de Python Status de la documentación

Interfaz de línea de comandos para cPanel

cpanel_cli_icon

README in English

Una interfaz de línea de comandos para la Unrestricted API de cPanel.

Ejecute comandos rápidamente en una terminal para gestionar un sitio web, evitando la necesidad de iniciar sesión en cPanel y navegar por su interfaz web. Esta utilidad también se puede integrar sin problemas en tareas de scripting.

Se implementa una parte de la UAPI (API sin restricciones) de cPanel, lo que le permite realizar una amplia gama de funciones con facilidad.

Algunos ejemplos:

  • Crear una copia de seguridad de la cuenta y almacenarla en el directorio home del usuario remoto:

    $ cpanel create backup home scott@example.com
  • Escribir directamente archivos en el directorio home del usuario remoto:

    $ cpanel write file public_html/index.txt "Hallo\nTschüss\n"
  • Crear un nuevo usuario FTP con una cuota y un directorio personal:

    $ cpanel create ftp bill@example.com 'password' 1024 my_ftp
  • Crear una respuesta automática de correo electrónico:

    $ cpanel set mail autoresponder \
      scott@example.com \
      "Bruce Scott" \
      "Este es mensaje automático" \
      "No estoy disponible por el momento, por favor contacte a mi jefe." \
      "Tomorrow 6 PM" \
      "December 15, 8:00 AM"
  • Cambiar a francés el idioma de la interfaz de usuario de cPanel:

    $ cpanel set locale fr
  • Listar las características disponibles de cPanel:

    $ cpanel list features
    
    {
        "addoncgi": 0,
        "addondomains": 1,
        "agora": 1,
        . . .
        "webmail": 1,
        "webprotect": 1,
        "zoneedit": 1
    }
  • Listar las cuentas de correo electrónico de cPanel:

    $ cpanel list mail accounts
    
      [
          {
          "email": "scott@example.com",
          . . .
          }
      ]

Y muchas cosas más. Con el tiempo espero cubrir completamente las más de 500 funciones disponibles en el API.

La salida es JSON, por lo que es fácilmente analizable utilizando un procesador CLI de JSON, como por ejemplo jq

Consulte la Guía del usuario para una referencia completa de las funciones implementadas de la API.

Guía rápida

cpanel-cli funciona en Linux y macOS (podría funcionar en Windows) y requiere Python 3.11 o posterior.

Para Linux, instale Python 3.11 o posterior utilizando el gestor de paquetes de su distro.

Para macOS, instale Python 3.11 o posterior usando Homebrew.

Cree un archivo .cpanelrc en su directorio $HOME con el siguiente contenido:

hostname=example.com
username=scott
utoken=ABCDEFGHIJKLMNOPQSRTUVWXYZ012345
  • hostname es el nombre de host su instancia de cPanel

  • username es su nombre de usuario en la instancia

  • utoken es un token API asociado con el username. Lea cómo crear un token API.

A continuación, ejecute:

$ python3 -m pip install --user cpanel-cli

O, si usa uv:

$ uv tool install cpanel-cli

Pruebe la instalación:

$ cpanel --version

Guía del usuario

Consulte la Guía del usuario en https://cpanel-cli.readthedocs.io/es/stable/ para instrucciones detalladas de instalación y configuración, así como una referencia completa de las funciones implementadas del API.

Cómo contribuir

Los pull requests son más que bienvenidos. Consulte CONTRIBUTING en español para una guía detallada de cómo colaborar con este proyecto.

¿Se puede usar en Windows?

cpanel-cli debería funcionar en Windows 10/11 vía WSL 2 (Windows Subsystem for Linux).

Desafortunadamente no tengo acceso a un sistema Windows, así que no puedo confirmarlo.

Metadata

Release files for cpanel-cli 0.30.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cpanel-cli 0.30.1
File Size Uploaded
cpanel_cli-0.30.1.tar.gz 154.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cpanel-cli 0.30.1
File Interpreter ABI Platform
cpanel_cli-0.30.1-py3-none-any.whl Python 3 none any Details

Total release size: 219.2 kB

Release files / cpanel_cli-0.30.1.tar.gz

Download URL cpanel_cli-0.30.1.tar.gz
Size 154.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a1c3da3178e011e3e0fdff7cbc1b4ffe210ed8db52138eb2b2de57929b487a7
BLAKE2b-256 checksum
How to use checksums
097aa84f5dea587d0e1a6fea611723fd1ea9cf4d94253795f40b0913e63ee2c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / cpanel_cli-0.30.1-py3-none-any.whl

Download URL cpanel_cli-0.30.1-py3-none-any.whl
Size 65.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b695c1fef311e3e5a673f31e237b60c5ea1bf743112ea5adcc52fcbc009b961
BLAKE2b-256 checksum
How to use checksums
958f6240ed9c85f526d1a9956a91677f2158ebae0d504deba0159992aadc4453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.30.1 This release

2 release files

0.30

2 release files

0.29

2 release files

0.28

2 release files

0.27

2 release files

0.22.0

2 release files

0.21.1

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page