vercel blob
The vercel blob command is used to interact with Vercel Blob storage, providing functionality to upload, download, list, delete, and copy files in public and private stores, store optimized images, and manage Blob stores.
For more information about Vercel Blob, see the Vercel Blob documentation and Vercel Blob SDK reference.
The vercel blob command supports the following operations:
list- List all files in the Blob storeput- Upload a file to the Blob storeput-image- Optimize an image and store the result in the Blob storedel- Delete a file from the Blob storecopy- Copy a file in the Blob storeget- Download a blob from the Blob storecreate-store- Create a new Blob storedelete-store- Delete a Blob storeget-store- Get a Blob storelist-stores- List all Blob storesempty-store- Delete all blobs in a Blob store
In a linked project with a connected Blob store, the CLI authenticates using OIDC by default: Vercel auto-populates VERCEL_OIDC_TOKEN and pairs it with BLOB_STORE_ID. If OIDC is not available, the CLI falls back to reading BLOB_READ_WRITE_TOKEN from your env file, or you can supply it directly with the --rw-token option. For example, this can happen for an unlinked project, outside of Vercel, or during local development.
vercel blob listUsing the vercel blob list command to list all files
in the Blob store.
vercel blob put [path-to-file] --access privateUsing the vercel blob put command to upload a file to
the Blob store.
vercel blob put-image [path-to-file-or-url] --pathname [pathname] --width [width] --access privateUsing the vercel blob put-image command to run an image
through Image Optimization and store
only the optimized output in the Blob store. The source can be a local file
or a public http(s) URL, which Vercel fetches and
optimizes server-side. The command prints the URL of the stored blob to
stdout, so scripts and agents can read the result back. Use
--json to print the full blob object instead.
The transformation is controlled with the --width (required), --quality, and --format options:
vercel blob put-image https://example.com/hero.png --pathname images/hero.webp --width 512 --quality 60 --format webp --access publicFetching a remote image, converting it to a 512 pixel wide WebP, and storing it in the Blob store.
The command requires OIDC credentials: pass --oidc-token and --store-id, or set the VERCEL_OIDC_TOKEN and BLOB_STORE_ID environment variables (available in .env.local after vercel env pull). Read-write tokens are not accepted.
Each upload is billed as one image transformation plus a regular blob upload at standard Vercel Blob pricing.
vercel blob del [url-or-pathname]Using the vercel blob del command to delete a file
from the Blob store.
vercel blob copy [from-url-or-pathname] [to-pathname] --access privateUsing the vercel blob copy command to copy a file in
the Blob store.
vercel blob get [url-or-pathname] --access privateUsing the vercel blob get command to download a blob.
Works with both public and
private stores.
Content is printed to stdout by default, or saved to a file with
--output.
vercel blob create-store [name] --access <access> [--region <region>] [--yes] [--environment <env>]Using the vercel blob create-store command to create a new
Blob store. The default region is set to iad1 when not specified.
Use --yes to auto-connect to the linked project (defaults
to all environments). Use --environment to specify which environments
to connect (repeatable).
vercel blob delete-store [store-id] [--yes]Using the vercel blob delete-store command to delete
a Blob store. Use --yes to skip the confirmation
prompt in CI environments.
vercel blob get-store [store-id]Using the vercel blob get-store command to get a Blob
store.
vercel blob list-stores [--all]Using the vercel blob list-stores command to list all
Blob stores. When run in a linked project directory, only stores connected to
that project are shown. Use --all to list all team
stores regardless of project. In a terminal, an interactive selector lets you
browse store details.
vercel blob empty-store [store-id] [--yes]Using the vercel blob empty-store command to delete
all blobs in a Blob store. Use --yes to skip the
confirmation prompt in CI environments.
These are options that only apply to the vercel blob command.
You can use the --rw-token option to specify your Blob read-write token. This is a fallback authentication method for cases where OIDC is not available such as unlinked projects, environments outside of Vercel, or local development.
vercel blob put image.jpg --rw-token [rw-token]Using the vercel blob put command with the
--rw-token option.
You can use the --limit option to specify the number of results to return per page when using list. The default value is 10 and the maximum is 1000.
vercel blob list --limit 100Using the vercel blob list command with the
--limit option.
You can use the --cursor option to specify the cursor from a previous page to start listing from.
vercel blob list --cursor [cursor-value]Using the vercel blob list command with the
--cursor option.
You can use the --prefix option to filter Blobs by a specific prefix.
vercel blob list --prefix images/Using the vercel blob list command with the
--prefix option.
You can use the --mode option to filter Blobs by either folded or expanded mode. The default is expanded.
vercel blob list --mode foldedUsing the vercel blob list command with the
--mode option.
You can use the --add-random-suffix option to add a random suffix to the file name when using put, put-image, or copy.
vercel blob put image.jpg --add-random-suffixUsing the vercel blob put command with the
--add-random-suffix option.
You can use the --pathname option to specify the pathname to upload the file to. For put, the default is the filename. For put-image, this option is required: the command takes a separate input (a file or URL, possibly a blob already in your store) and output, so it needs an explicit pathname for the result.
vercel blob put image.jpg --pathname assets/images/hero.jpgUsing the vercel blob put command with the
--pathname option.
You can use the --width option to set the width of the optimized image in pixels, between 1 and 8192. The aspect ratio of the source image is preserved. This option is required and only applies to the put-image command.
vercel blob put-image photo.png --pathname images/photo.png --width 1200 --access publicUsing the vercel blob put-image command with the
--width option.
You can use the --quality option to set the quality of the optimized image, between 1 (lowest quality) and 100 (highest quality). The default is 75. This option only applies to the put-image command.
vercel blob put-image photo.png --pathname images/photo.png --width 1200 --quality 60 --access publicUsing the vercel blob put-image command with the
--quality option.
You can use the --format option to convert the optimized image to jpeg, png, webp, or avif. The source image format is preserved when omitted. This option only applies to the put-image command.
vercel blob put-image photo.png --pathname images/photo.webp --width 1200 --format webp --access publicUsing the vercel blob put-image command with the
--format option.
You can use the --json option to print the stored blob as JSON, including its url, downloadUrl, pathname, and contentType, instead of only the URL. This option only applies to the put-image command.
vercel blob put-image photo.png --pathname images/photo.png --width 1200 --access public --jsonUsing the vercel blob put-image command with the
--json option.
You can use the --content-type option to overwrite the content-type when using put or copy. It will be inferred from the file extension if not provided.
vercel blob put data.txt --content-type application/jsonUsing the vercel blob put command with the
--content-type option.
You can use the --cache-control-max-age option to set the max-age of the cache-control header directive when using put, put-image, or copy. The default is 2592000 (30 days).
vercel blob put image.jpg --cache-control-max-age 86400Using the vercel blob put command with the
--cache-control-max-age option.
You can use the --allow-overwrite option to overwrite the file if it already exists when uploading with put or put-image. The default is false.
vercel blob put image.jpg --allow-overwriteUsing the vercel blob put command with the
--allow-overwrite option.
You can use the --multipart option to upload the file in multiple small chunks for performance and reliability. The default is true.
vercel blob put large-file.zip --multipart falseUsing the vercel blob put command with the
--multipart option.
You can use the --region option to specify the region where your Blob store should be created. The default is iad1. This option is only applicable when using the create-store command.
vercel blob create-store my-store --region sfo1Using the vercel blob create-store command with the --region option.
The --access option is required and specifies whether the store or blob should use public or private storage. This option applies to the put, put-image, copy, get, and create-store commands.
vercel blob put image.jpg --access privateUsing the vercel blob put command with the
--access option.
You can use the --output option to save the blob content to a file instead of printing it to stdout. This option only applies to the get command.
vercel blob get image.jpg --output ./local-image.jpgUsing the vercel blob get command with the
--output option.
You can use the --if-match option to only perform the operation if the blob's ETag matches the provided value. This option applies to the put, del, and copy commands.
vercel blob put image.jpg --if-match "etag-value"Using the vercel blob put command with the
--if-match option.
You can use the --if-none-match option to only return content if the blob's ETag does not match the provided value. If unchanged, the server returns a 304 response. This option applies to the get command.
vercel blob get image.jpg --if-none-match "etag-value"Using the vercel blob get command with the
--if-none-match option.
The following global options can be passed when using the vercel blob command:
--cwd--debug--global-config--help--local-config--no-color--non-interactive--scope--team--token--version
For more information on global options and their usage, refer to the options section.
Was this helpful?