Sign inSign up

weaponsforge/cloudinary-cli

By weaponsforge

•Updated 2 days ago

Cloudinary CLI for automatic image optimization, transformation, and asset management.

Image
Developer tools
0

70

weaponsforge/cloudinary-cli repository overview

⁠cloudinary-cli

Cloudinary-powered image optimization CLI with Node.js wrappers for select Cloudinary Node.js APIs⁠, covering automatic image optimization, transformation, and asset management.

Cloudinary's automatic optimization reduces the need to manually tune image dimensions, quality, compression, and formats. Unlike libraries such as Sharp or FFmpeg, where developers often need to experiment with processing parameters to find the right balance between visual quality and file size, Cloudinary can automatically optimize images for efficient delivery while preserving visual quality.

The result: less optimization guesswork, smaller assets, and better image delivery with less application-side processing.

GitHub Repository
https://github.com/weaponsforge/cloudinary-image⁠

NPM Registry (Library)
https://www.npmjs.com/package/cloudinary-image⁠

⁠Requirements

  1. Cloudinary Account⁠

⁠Installation

  1. Pull the "latest" production image.
    docker pull weaponsforge/cloudinary-cli

  2. Create a .env file containing the following:

    Variable NameDescription
    CLOUDINARY_NAMECloudinary account name
    CLOUDINARY_API_KEYCloudinary API key
    CLOUDINARY_API_SECRETCloudinary API secret

⁠CLI Flags Guide

weaponsforge/cloudinary-cli
  -f /path/to/file.jpg       # Full input image file path
  -o /output/folder/path     # (Optional) output folder
  -a my-asset-folder         # (Optional) Cloudinary asset folder
  -t cars,vehicles,tech      # (Optional) image tags
  -w 600                     # (Optional) width to resize the image. Default is 800
  -u                         # (Optional) flag to upload the input image to Cloudinary. Required on 1st run.
  -d                         # (Optional) flag to delete the uploaded image in Cloudinary

⁠Usage

  1. Optimize an image using the CLI, eg. using Bash:

    docker run -it --rm \ 
      --env-file ./path/to/.env \
      -v /full/path/to/host/pictures/folder:/images \    
      weaponsforge/cloudinary-cli \
      -f /images/<picture-file>.jpg \
      -u -d
    
  2. Optimize an image using the CLI with width specified, eg. using Bash:

    docker run -it --rm \ 
      --env-file ./path/to/.env \
      -v /full/path/to/host/pictures/folder:/images \    
      weaponsforge/cloudinary-cli \
      -f /images/<picture-file>.jpg \
      -u -d -w 320
    

Tag summary

Content type

Image

Digest

sha256:cfa2f5f22…

Size

59.2 MB

Last updated

2 days ago

docker pull weaponsforge/cloudinary-cli