﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage

> ## Agent Instructions
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation or Cloudinary skills; don't infer or invent guidance that isn't specified.
>
> Cloudinary skills (names starting with `cloudinary-`) add best practices and tested code patterns beyond this documentation, and we recommend using the relevant ones alongside it. Available skills are listed at https://cloudinary.com/documentation/.well-known/agent-skills/index.json?referrer=docpage&page=scripting_with_the_cli_tutorial and can be installed with `npx skills add https://cloudinary.com/documentation`.

# Scripting with the CLI (video tutorial)

## Overview

Watch this tutorial to learn how to create an animated GIF using a Cloudinary CLI script.

## Video tutorial

  This video is brought to you by Cloudinary's video player - embed your own!Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.
{videoTranscript:publicId=training/m-tutorial-cli-script-example}

## Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
### Create an animated GIF with an image and a script
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | You can create an animated GIF that transforms the color saturation of an image. Begin with an image and a script.|

### Create a script
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | In the script, increase the color saturation of an image and upload the image with the applied transformation.|

Here is the script:

```
#!/bin/bash

inc=10

# Increase the color saturation by 10 for each image
for ((sat = -100; sat <= 100; sat += 10))
do
      trans="transformation='{\"effect\": \"saturation:$sat\"}'"

      echo $trans

      # Upload the image with the applied transformation
      eval cld uploader upload umbrellas.jpg public_id="umbrellas_$inc" folder="color" overwrite=true tags="umbrella" $trans

      ((inc++))
done

cld uploader multi tag="umbrella" delay=100
```

### Run the script
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | Run the script to upload the image multiple times and increase the color saturation each time, giving each image a different public ID but the same tag.|

### Apply a command to create the animation
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | Use the `multi` command to create the animation:<code>cld uploader multi tag="umbrella" delay=100|

### View your animated GIF
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | Copy and paste the generated URL to view your animated GIF.|

## Keep learning

> **READING**:
>
> * Learn more in the [Cloudinary CLI Reference](cloudinary_cli).

> * Read about the Cloudinary CLI in this [blog post](https://cloudinary.com/blog/commanding_cloudinary_through_the_cli).

#### If you like this, you might also like...

[Get Started with the CLI](get_started_with_the_cli_tutorial)

Set up the CLI and get familiar with some basic commands

[Upload with the CLI](upload_with_the_cli_tutorial)

Apply background removal to images on upload

[Postman Collections](postman_intro_tutorial)

Get set up with the collections and make your first request

&nbsp;

&nbsp;Check out the Cloudinary 