Skip to main content

How to Upload and Download Files from Shopify Using the Altera CLI

Manage your Shopify store files from the command line with upload and download capabilities.

Updated yesterday

Goal: Learn how to use the Altera command line tool to upload local files to your Shopify store and download files from Shopify to your local machine.

Video walkthrough: Watch the 4-minute video

Prerequisites:

  • You have Altera installed on your Shopify store

  • You have Node.js and npm installed on your computer

  • You have access to the command line/terminal

Step 1 - Create an API Key

In your Shopify admin, go to Apps and open Altera. Navigate to Settings β†’ API Keys.

Enter a contact email address. This email is used to reach out in case there are any issues with your API calls.

Click Create API Key. Copy the installation command shown (it will look like npx altera shop add mystore.myshopify.com).

Keep this page open as you'll need to copy the API key in the next step.

Step 2 - Install and Configure the CLI Tool

Open your terminal and paste the installation command you copied in Step 1.

When prompted for your API key, go back to the Altera settings page, copy the API key, and paste it into the terminal.

To verify the connection is successful, run:

npx altera shop test

You should see a success message confirming the connection to your store.

Step 3 - Upload Files to Shopify

Navigate to the directory containing the files you want to upload, or note the path to that directory.

Run the upload command with the path to your files:

npx altera files upload --source-path ./images

Replace ./images with the path to your files or directory.

The CLI will:

  • Start uploading your files to Shopify

  • Show progress in the terminal

  • Generate a CSV summary file when complete

  • Provide a URL to view the job details in Altera

Step 4 - Download Files from Shopify

To download files from your Shopify store, use the download command with optional filters:

npx altera files download --media-type image --filename snowboard

Available filter options:

  • --media-type - Filter by media type (e.g., image, video)

  • --filename - Filter by text in the filename

The CLI will:

  • Create a list of all matching files

  • Download them to a local directory

  • Generate an Excel summary file with details (file names, sizes, URLs, etc.)

Outcome

You can now:

  • Upload local files to your Shopify store's content files from the command line

  • Download files from Shopify with filters to get exactly what you need

  • Access summary files in Altera's standard format for tracking uploads and downloads

To verify uploads, go to Content β†’ Files in your Shopify admin to see your newly uploaded files.

Did this answer your question?