For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
GuidesIntegrationsAPI ReferencesRelease notes
GuidesIntegrationsAPI ReferencesRelease notes
  • Introduction
    • Overview
    • Quick Start
    • Projects
    • Billing
  • Uploading
    • Overview
    • Uploading files with API
    • File analysis on upload
  • Optimization
    • Overview
  • Transformations
  • Delivery
    • Overview
    • On-the-fly operations
    • CDN settings
    • Proxy
  • Security
    • Overview
    • Validation and moderation
    • Signed uploads
    • Signed URLs
    • Unsafe content moderation
    • Malware protection
    • HIPAA workflows
  • Storage
    • Uploadcare storage
    • Cloudflare R2
    • Google Cloud Storage
    • Azure Blob Storage
  • File management
    • Overview
    • Managing files
    • File groups
    • Webhooks
    • Arbitrary file metadata
  • CLI
    • Overview
    • Configuration
      • File operations
      • CI/CD and automation
      • Output and scripting
  • Migration
    • Migration to Uploadcare
    • Migration from Filestack
Dashboard
LogoLogo
On this page
  • Uploading files
  • Listing and filtering files
  • Inspecting files
  • Managing file storage
  • Working with metadata
  • Copying files
  • Downloading files
  • Working with file groups
CLIGuides

File operations with the CLI

Was this page helpful?
Previous

CLI in CI/CD pipelines

Next
Built with

This guide covers everyday file tasks — uploading, listing, inspecting, organizing, and deleting files from the command line.

For the complete flag reference, see the file and metadata command reference.

Uploading files

Upload a single file:

$uploadcare file upload photo.jpg
UUID SIZE FILENAME STORED
a1b2c3d4-e5f6-7890-abcd-ef1234567890 2.4 MB photo.jpg true

Upload multiple files:

$uploadcare file upload *.jpg

Upload from a URL:

$uploadcare file upload-from-url https://example.com/image.png

The CLI polls until the upload completes. Use --no-wait to return immediately (not available for upload-from-url — use --timeout to control how long to wait).

Upload with metadata:

$uploadcare file upload photo.jpg --metadata source=camera --metadata project=vacation

Control storage behavior:

$# Don't auto-store (file will be temporary)
>uploadcare file upload photo.jpg --store false
>
># Explicitly store
>uploadcare file upload photo.jpg --store true

Show upload progress:

$uploadcare file upload large-video.mp4 --progress

Listing and filtering files

List files with default settings:

$uploadcare file list

List only stored files, newest first:

$uploadcare file list --stored true --ordering -datetime_uploaded

Get specific fields as JSON:

$uploadcare file list --json uuid,filename,size

Stream all files (not just the first page):

$uploadcare file list --page-all --json uuid,filename

--page-all outputs one JSON object per line (NDJSON), streaming results without loading everything into memory.

Filter with jq:

$# Find images larger than 1 MB
$uploadcare file list --page-all --jq 'select(.size > 1048576 and .is_image == true) | .uuid'

Inspecting files

Get full file details:

$uploadcare file info a1b2c3d4-e5f6-7890-abcd-ef1234567890

Extract specific fields:

$uploadcare file info a1b2c3d4-e5f6-7890-abcd-ef1234567890 --json uuid,size,mime_type
1{"uuid":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","size":2457600,"mime_type":"image/jpeg"}

Include application data (add-on results):

$uploadcare file info a1b2c3d4-e5f6-7890-abcd-ef1234567890 --include-appdata --json all

Managing file storage

Store files permanently:

$uploadcare file store a1b2c3d4-e5f6-7890-abcd-ef1234567890

Store multiple files:

$uploadcare file store UUID1 UUID2 UUID3

Delete a file:

$uploadcare file delete a1b2c3d4-e5f6-7890-abcd-ef1234567890

Batch delete with piping — delete all unstored files:

$uploadcare file list --page-all --stored false --json uuid | uploadcare file delete --from-stdin

Preview before deleting with dry-run:

$uploadcare file delete UUID1 UUID2 --dry-run

File deletion is permanent. Use --dry-run to preview what will happen before executing destructive operations.

Working with metadata

Metadata attaches custom key-value pairs to files. Keys are lowercase alphanumeric with hyphens (max 64 chars). See the metadata concept page for details.

Set a metadata value:

$uploadcare metadata set a1b2c3d4-e5f6-7890-abcd-ef1234567890 source camera

List all metadata on a file:

$uploadcare metadata list a1b2c3d4-e5f6-7890-abcd-ef1234567890

Get a specific metadata value:

$uploadcare metadata get a1b2c3d4-e5f6-7890-abcd-ef1234567890 source

Delete a metadata key:

$uploadcare metadata delete a1b2c3d4-e5f6-7890-abcd-ef1234567890 source

Copying files

Copy within Uploadcare storage:

$uploadcare file local-copy a1b2c3d4-e5f6-7890-abcd-ef1234567890

This creates a new file with its own UUID. Add --store to store the copy immediately.

Copy to external storage (e.g., S3):

$uploadcare file remote-copy a1b2c3d4-e5f6-7890-abcd-ef1234567890 --target my-s3-bucket

Use --pattern to control the filename on remote storage:

$uploadcare file remote-copy UUID --target my-s3-bucket --pattern "${uuid}/${filename}"

See the S3 integration guide for setting up external storage.

Downloading files

Download a single file to the current directory:

$uploadcare file download a1b2c3d4-e5f6-7890-abcd-ef1234567890

Download to a specific path or stream to stdout:

$uploadcare file download <uuid> --output ./photo.jpg
$uploadcare file download <uuid> --output - > photo.jpg

Mirror all stored files into a local directory with 8 parallel workers:

$uploadcare file list --page-all --stored true --json uuid \
> | uploadcare file download --from-stdin --output-dir ./backup --parallel 8

Use --name-template to control filenames in batch mode (placeholders: ${uuid}, ${filename}, ${ext}, ${effects}). Existing files are skipped unless you pass --replace.

Apply a CDN transformation while downloading:

$uploadcare file download <uuid> --output thumb.jpg --effects resize/200x/

Effects are silently ignored for non-image files. See the file download reference for the full flag list.

Working with file groups

File groups bundle multiple files under a single group ID. See the file groups concept page for details and the group command reference for all flags.

Create a group from file UUIDs:

$uploadcare group create UUID1 UUID2 UUID3

Create a group from a file list:

$uploadcare file list --page-all --stored true --json uuid | head -5 | uploadcare group create --from-stdin

List groups:

$uploadcare group list --json all

Get group details (includes file list):

$uploadcare group info "a1b2c3d4-e5f6-7890-abcd-ef1234567890~3"