Skip to content

iuv oss

iuv oss provides direct access to iuv’s Cloudflare R2 object storage. All objects are scoped to your user ID — you can only access your own files.

Terminal window
iuv oss upload ./image.png
iuv oss upload ./image.png --key photos/avatar.png
iuv oss upload ./report.pdf --public
iuv oss upload ./data.json --content-type application/json --json
FlagDefaultDescription
-k, --keyfilenameRemote key (path in R2 under your user prefix)
-c, --content-typeauto-detectedContent-Type header for the object
--publicprivateMake the object publicly accessible
Terminal window
iuv oss download user_id/photos/avatar.png
iuv oss download user_id/photos/avatar.png --output ./local-copy.png

The full scoped key (including the user prefix returned by upload) must be provided.

Terminal window
iuv oss stat user_id/photos/avatar.png
iuv oss stat user_id/photos/avatar.png --json

Output includes: key, size, contentType, visibility, lastModified, etag.

Terminal window
iuv oss rm user_id/photos/avatar.png
Terminal window
iuv oss visibility user_id/photos/avatar.png public
iuv oss visibility user_id/photos/avatar.png private

Visibility changes update R2 object metadata in-place — no file migration required. Private objects require authentication to download; public objects return an open presigned URL.

  1. iuv oss upload calls POST /v1/oss/upload-url to obtain a presigned PUT URL (valid 15 min).
  2. The file is uploaded directly to Cloudflare R2 — no data passes through the API worker.
  3. The final scoped key is printed on success; save it for later use.

iuv oss download calls GET /v1/oss/download?key=<key> to obtain a presigned GET URL (valid 1 hour), then fetches directly from R2.

  • Public objects: the download URL is returned without authentication.
  • Private objects: a valid Clerk JWT or API key is required.

All subcommands accept:

--api-base-url <url> Override the API base URL (default: https://api.iuvdev.com)
--json Output machine-readable JSON