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, as well as 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 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 store
For authentication, the CLI reads the BLOB_READ_WRITE_TOKEN value from your env file or you can use the --rw-token option.
vercel blob listUsing the vercel blob list command to list all files
in the Blob store.
vercel blob put [path-to-file]Using the vercel blob put command to upload a file to
the Blob store.
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]Using the vercel blob copy command to copy a file in
the Blob store.
vercel blob get [url-or-pathname]Using 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>]Using the vercel blob create-store command to create a new
Blob store. The default region is set to iad1 when not specified.
vercel blob delete-store [store-id]Using the vercel blob delete-store command to delete
a Blob store.
vercel blob get-store [store-id]Using the vercel blob get-store command to get a Blob
store.
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.
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 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. The default is the filename.
vercel blob put image.jpg --pathname assets/images/hero.jpgUsing the vercel blob put command with the
--pathname 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 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. 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.
You can use the --access option to specify whether the store or blob should use public or private storage. The default is public. This option applies to the put, 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:
For more information on global options and their usage, refer to the options section.
Was this helpful?