cloudinary-cli


Namecloudinary-cli JSON
Version 1.10.3 PyPI version JSON
download
home_pagehttps://github.com/cloudinary/cloudinary-cli
SummaryA command line interface for Cloudinary with full API support
upload_time2024-07-31 16:28:04
maintainerNone
docs_urlNone
authorCloudinary, Brian Luk
requires_python>=3.6.0
licenseMIT
keywords cloudinary cli pycloudinary image video digital asset management command line interface transformation friendly easy flexible
VCS
bugtrack_url
requirements cloudinary pygments jinja2 click click-log requests docstring-parser
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build Status](https://app.travis-ci.com/cloudinary/cloudinary-cli.svg)](https://app.travis-ci.com/cloudinary/cloudinary-cli)
[![PyPI Downloads](https://img.shields.io/pypi/dm/cloudinary-cli.svg)](https://pypistats.org/packages/cloudinary-cli)
[![PyPI License](https://img.shields.io/pypi/l/cloudinary-cli.svg)](LICENSE)

# Cloudinary CLI

## Features
The Cloudinary CLI (Command Line Interface) enables you to interact with Cloudinary through the command line. For example, you can perform Admin and Upload API operations by typing commands into a terminal without having to spend time setting up a formal coding environment. Additional helper commands are provided to help you to try out transformations, optimizations, and other common actions with minimal effort. You can also combine CLI commands in a batch file to automate laborious tasks.

It is fully documented at [https://cloudinary.com/documentation/cloudinary_cli](https://cloudinary.com/documentation/cloudinary_cli).

## Requirements
Your own Cloudinary account.  If you don't already have one, sign up at [https://cloudinary.com/users/register/free](https://cloudinary.com/users/register/free).

Python 3.6 or later.  You can install Python from [https://www.python.org/](https://www.python.org/). Note that the Python Package Installer (pip) is installed with it.

## Setup and Installation

1. To install this package, run: `pip3 install cloudinary-cli`
2. To make all your `cld` commands point to your Cloudinary account, set up your CLOUDINARY\_URL environment variable. For example:
    * On Mac or Linux:<br>`export CLOUDINARY_URL=cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name`
    * On Windows (cmd.exe):<br>`set CLOUDINARY_URL=cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name`
    * On Windows (PowerShell):<br>`$Env:CLOUDINARY_URL="cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name"`

_**Note:** you can copy and paste your account environment variable from the Account Details section of the Dashboard page in the Cloudinary console._

3. Check your configuration by running `cld config`. A response of the following form is returned:

    ```
    cloud_name:     <CLOUD_NAME>
    api_key:        <API_KEY>
    api_secret:     ***************<LAST_4_DIGITS>
    private_cdn:    <True|False>
    ```
    
    If you get an error message when running `cld config`, you may need to add your Python installation to your $PATH. To do so, you can run `PATH="$PATH:/Library/Python/Versions/3.8/bin"` in your terminal, and add `export PATH="$PATH:/Library/Python/Versions/3.8/bin"` to your `/.bash_profile` or `~/.zshrc`.

## Quickstart

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#command_overview).

```
Usage: cld [cli options] [command] [command options] [method] [method parameters]
```

### Important commands

```
cld --help         # Lists available commands.
cld search --help  # Shows usage for the Search API.
cld admin          # Lists Admin API methods.
cld uploader       # Lists Upload API methods.
```

## Upload API

Enables you to run any methods that can be called through the upload API.

You can find documentation for each of the Upload API methods at [https://cloudinary.com/documentation/image_upload_api_reference](https://cloudinary.com/documentation/image_upload_api_reference). 

The basic syntax using the Upload API is as follows:

```
cld [cli options] uploader [command options] [method] [method parameters]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#uploader).

Example: change the asset with `public_id:"flowers"` from `type:upload` to `type:private` and rename it using the rename method, which takes two parameters - `from_public_id` and `to_public_id`.

Use any of the following commands:

```
cld uploader rename flowers secret_flowers to_type=private
cld uploader rename flowers secret_flowers -o to_type private
cld rename flowers secret_flowers to_type=private

```

_**Note:** you can omit 'uploader' from the command when calling an Upload API method._

## Admin API

Enables you to run any methods that can be called through the admin API.

You can find documentation for each of the Admin API methods at [https://cloudinary.com/documentation/admin_api](https://cloudinary.com/documentation/admin_api).

The basic syntax using the Admin API is as follows:

```
cld [cli options] admin [command options] [method] [method parameters]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#admin).

Example: create a transformation and get information about that transformation:

```
cld admin create_transformation my_new_transformation w_500,h_500,c_crop,e_vectorize
cld admin transformation my_new_transformation
```

_**Note:** you can omit 'admin' from the command when calling an Admin API method._

## Search API

Runs the admin API search method, allowing you to use a Lucene query string as the expression.

You can find documentation for the Search API at [https://cloudinary.com/documentation/search_api](https://cloudinary.com/documentation/search_api).

The basic syntax using the Search API is as follows:

```
cld [cli options] search [command options] [expression]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#search).

## Other commands

### `url`
Generates a Cloudinary URL, which you can optionally open in your browser.

```
cld [cli options] url [command options] public_id [transformation]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#url).

Example: generate a URL that displays the image in your media library that has the public ID of 'sample', with a width of 500 pixels and transformed using the cartoonify effect, then open this URL in a browser. 

```
cld url -rt image -t upload -o sample w_500,e_cartoonify
```
The URL that is returned is:

```
http://res.cloudinary.com/<YOUR CLOUD NAME>/image/upload/w_500,e_cartoonify/sample
```

### `make`

Returns template code for implementing the specified Cloudinary widget.

```
cld [cli options] make [command options] [widget]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#make).

Example: output the HTML required to embed the Upload Widget on your website.

```
cld make upload_widget
```

### `upload_dir`

Uploads a folder of assets, maintaining the folder structure.

```
cld [cli options] upload_dir [command options] [local_folder]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#upload_dir).  

Example: upload the local folder, my_images, and all its contents and sub-folders to your Cloudinary folder my_images_on_cloudinary.  

```
cld upload_dir -f my_images_on_cloudinary my_images
```

### `sync`

Synchronizes between a local folder and a Cloudinary folder, maintaining the folder structure.

```
cld [cli options] sync [command options] local_folder cloudinary_folder
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#sync).

Example: push up changes from the local folder, my_images, to your Cloudinary folder, my_images_on_cloudinary/my_images.

```
cld sync --push my_images my_images_on_cloudinary/my_images
```

### `migrate`

Migrates a list of external media files to Cloudinary. The URLs of the files to migrate are listed in a separate file and must all have the same prefix.

```
cld [cli options] migrate [command options] upload_mapping file
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#migrate).

## Additional configurations

A configuration is a reference to a specified Cloudinary account or cloud name via its environment variable.  You set the default configuration during setup and installation. Using different configurations allows you to access different Cloudinary cloud names, such as sub-accounts of your main Cloudinary account, or any additional Cloudinary accounts you may have.

The `config` command displays the current configuration and lets you manage additional configurations.

You can specify the environment variable of additional Cloudinary accounts either explicitly (`-c` option) or as a saved configuration (`-C` option).  

For example, using the `-c` option:

```
cld -c cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name admin usage
```

Whereas using the saved configuration "accountx":

```
cld -C accountx admin usage
```

_**Caution:** Creating a saved configuration may put your API secret at risk as it is stored in a local plain text file._

You can create, delete and list saved configurations using the `config` command.

```
cld config [options]
```

For details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#config).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cloudinary/cloudinary-cli",
    "name": "cloudinary-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6.0",
    "maintainer_email": null,
    "keywords": "cloudinary cli pycloudinary image video digital asset management command line interface transformation friendly easy flexible",
    "author": "Cloudinary, Brian Luk",
    "author_email": "info@cloudinary.com, lukitsbrian@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9b/72/e805e6da255eb6363665cb4e585e22a8a9d35790dc930e12ba2a5d1d4086/cloudinary_cli-1.10.3.tar.gz",
    "platform": null,
    "description": "[![Build Status](https://app.travis-ci.com/cloudinary/cloudinary-cli.svg)](https://app.travis-ci.com/cloudinary/cloudinary-cli)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/cloudinary-cli.svg)](https://pypistats.org/packages/cloudinary-cli)\n[![PyPI License](https://img.shields.io/pypi/l/cloudinary-cli.svg)](LICENSE)\n\n# Cloudinary CLI\n\n## Features\nThe Cloudinary CLI (Command Line Interface) enables you to interact with Cloudinary through the command line. For example, you can perform Admin and Upload API operations by typing commands into a terminal without having to spend time setting up a formal coding environment. Additional helper commands are provided to help you to try out transformations, optimizations, and other common actions with minimal effort. You can also combine CLI commands in a batch file to automate laborious tasks.\n\nIt is fully documented at [https://cloudinary.com/documentation/cloudinary_cli](https://cloudinary.com/documentation/cloudinary_cli).\n\n## Requirements\nYour own Cloudinary account.  If you don't already have one, sign up at [https://cloudinary.com/users/register/free](https://cloudinary.com/users/register/free).\n\nPython 3.6 or later.  You can install Python from [https://www.python.org/](https://www.python.org/). Note that the Python Package Installer (pip) is installed with it.\n\n## Setup and Installation\n\n1. To install this package, run:\u00a0`pip3 install cloudinary-cli`\n2. To make all your `cld` commands point to your Cloudinary account, set up your CLOUDINARY\\_URL environment variable. For example:\n    * On Mac or Linux:<br>`export CLOUDINARY_URL=cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name`\n    * On Windows (cmd.exe):<br>`set CLOUDINARY_URL=cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name`\n    * On Windows (PowerShell):<br>`$Env:CLOUDINARY_URL=\"cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name\"`\n\n_**Note:** you can copy and paste your account environment variable from the Account Details section of the Dashboard page in the Cloudinary console._\n\n3. Check your configuration by running\u00a0`cld config`. A response of the following form is returned:\n\n    ```\n    cloud_name:     <CLOUD_NAME>\n    api_key:        <API_KEY>\n    api_secret:     ***************<LAST_4_DIGITS>\n    private_cdn:    <True|False>\n    ```\n    \n    If you get an error message when running `cld config`, you may need to add your Python installation to your $PATH. To do so, you can run `PATH=\"$PATH:/Library/Python/Versions/3.8/bin\"` in your terminal, and add `export PATH=\"$PATH:/Library/Python/Versions/3.8/bin\"` to your `/.bash_profile` or `~/.zshrc`.\n\n## Quickstart\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#command_overview).\n\n```\nUsage: cld [cli options] [command] [command options] [method] [method parameters]\n```\n\n### Important commands\n\n```\ncld --help         # Lists available commands.\ncld search --help  # Shows usage for the Search API.\ncld admin          # Lists Admin API methods.\ncld uploader       # Lists Upload API methods.\n```\n\n## Upload API\n\nEnables you to run any methods that can be called through the upload API.\n\nYou can find documentation for each of the Upload API methods at [https://cloudinary.com/documentation/image_upload_api_reference](https://cloudinary.com/documentation/image_upload_api_reference). \n\nThe basic syntax using the Upload API is as follows:\n\n```\ncld [cli options] uploader [command options] [method] [method parameters]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#uploader).\n\nExample: change the asset with\u00a0`public_id:\"flowers\"` from `type:upload`\u00a0to\u00a0`type:private` and rename it using the rename method, which takes two parameters - `from_public_id` and `to_public_id`.\n\nUse any of the following commands:\n\n```\ncld uploader rename flowers secret_flowers to_type=private\ncld uploader rename flowers secret_flowers -o to_type private\ncld rename flowers secret_flowers to_type=private\n\n```\n\n_**Note:** you can omit 'uploader' from the command when calling an Upload API method._\n\n## Admin API\n\nEnables you to run any methods that can be called through the admin API.\n\nYou can find documentation for each of the Admin API methods at [https://cloudinary.com/documentation/admin_api](https://cloudinary.com/documentation/admin_api).\n\nThe basic syntax using the Admin API is as follows:\n\n```\ncld [cli options] admin [command options] [method] [method parameters]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#admin).\n\nExample: create a transformation and get information about that transformation:\n\n```\ncld admin create_transformation my_new_transformation w_500,h_500,c_crop,e_vectorize\ncld admin transformation my_new_transformation\n```\n\n_**Note:** you can omit 'admin' from the command when calling an Admin API method._\n\n## Search API\n\nRuns the admin API search method, allowing you to use a Lucene query string as the expression.\n\nYou can find documentation for the Search API at [https://cloudinary.com/documentation/search_api](https://cloudinary.com/documentation/search_api).\n\nThe basic syntax using the Search API is as follows:\n\n```\ncld [cli options] search [command options] [expression]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#search).\n\n## Other commands\n\n### `url`\nGenerates a Cloudinary URL, which you can optionally open in your browser.\n\n```\ncld [cli options] url [command options] public_id [transformation]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#url).\n\nExample: generate a URL that displays the image in your media library that has the public ID of 'sample', with a width of 500 pixels and transformed using the cartoonify effect, then open this URL in a browser. \n\n```\ncld url -rt image -t upload -o sample w_500,e_cartoonify\n```\nThe URL that is returned is:\n\n```\nhttp://res.cloudinary.com/<YOUR CLOUD NAME>/image/upload/w_500,e_cartoonify/sample\n```\n\n### `make`\n\nReturns template code for implementing the specified Cloudinary widget.\n\n```\ncld [cli options] make [command options] [widget]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#make).\n\nExample: output the HTML required to embed the Upload Widget on your website.\n\n```\ncld make upload_widget\n```\n\n### `upload_dir`\n\nUploads a folder of assets, maintaining the folder structure.\n\n```\ncld [cli options] upload_dir [command options] [local_folder]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#upload_dir).  \n\nExample: upload the local folder, my_images, and all its contents and sub-folders to your Cloudinary folder my_images_on_cloudinary.  \n\n```\ncld upload_dir -f my_images_on_cloudinary my_images\n```\n\n### `sync`\n\nSynchronizes between a local folder and a Cloudinary folder, maintaining the folder structure.\n\n```\ncld [cli options] sync [command options] local_folder cloudinary_folder\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#sync).\n\nExample: push up changes from the local folder, my_images, to your Cloudinary folder, my_images_on_cloudinary/my_images.\n\n```\ncld sync --push my_images my_images_on_cloudinary/my_images\n```\n\n### `migrate`\n\nMigrates a list of external media files to Cloudinary. The URLs of the files to migrate are listed in a separate file and must all have the same prefix.\n\n```\ncld [cli options] migrate [command options] upload_mapping file\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#migrate).\n\n## Additional configurations\n\nA configuration is a reference to a specified Cloudinary account or cloud name via its environment variable.  You set the default configuration during setup and installation. Using different configurations allows you to access different Cloudinary cloud names, such as sub-accounts of your main Cloudinary account, or any additional Cloudinary accounts you may have.\n\nThe `config` command displays the current configuration and lets you manage additional configurations.\n\nYou can specify the environment variable of additional Cloudinary accounts either explicitly (`-c` option) or as a saved configuration (`-C` option).  \n\nFor example, using the `-c` option:\n\n```\ncld -c cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyzA@cloud_name admin usage\n```\n\nWhereas using the saved configuration \"accountx\":\n\n```\ncld -C accountx admin usage\n```\n\n_**Caution:** Creating a saved configuration may put your API secret at risk as it is stored in a local plain text file._\n\nYou can create, delete and list saved configurations using the `config` command.\n\n```\ncld config [options]\n```\n\nFor details, see the [Cloudinary CLI documentation](https://cloudinary.com/documentation/cloudinary_cli#config).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A command line interface for Cloudinary with full API support",
    "version": "1.10.3",
    "project_urls": {
        "Homepage": "https://github.com/cloudinary/cloudinary-cli"
    },
    "split_keywords": [
        "cloudinary",
        "cli",
        "pycloudinary",
        "image",
        "video",
        "digital",
        "asset",
        "management",
        "command",
        "line",
        "interface",
        "transformation",
        "friendly",
        "easy",
        "flexible"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b72e805e6da255eb6363665cb4e585e22a8a9d35790dc930e12ba2a5d1d4086",
                "md5": "aab55e91c2a8d54c3d7c1ca1599d000a",
                "sha256": "fb3b32d1ff3065008ea32e5acdf6ab68f81e2352049aff6781dcb5fa2feb2de6"
            },
            "downloads": -1,
            "filename": "cloudinary_cli-1.10.3.tar.gz",
            "has_sig": false,
            "md5_digest": "aab55e91c2a8d54c3d7c1ca1599d000a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.0",
            "size": 41682,
            "upload_time": "2024-07-31T16:28:04",
            "upload_time_iso_8601": "2024-07-31T16:28:04.660484Z",
            "url": "https://files.pythonhosted.org/packages/9b/72/e805e6da255eb6363665cb4e585e22a8a9d35790dc930e12ba2a5d1d4086/cloudinary_cli-1.10.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-31 16:28:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cloudinary",
    "github_project": "cloudinary-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "cloudinary",
            "specs": [
                [
                    ">=",
                    "1.37.0"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": []
        },
        {
            "name": "jinja2",
            "specs": []
        },
        {
            "name": "click",
            "specs": []
        },
        {
            "name": "click-log",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "docstring-parser",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "cloudinary-cli"
}
        
Elapsed time: 0.31832s