DataStorage
CLI
Check storage usage and remove it. Turning it on is a runlot.json declaration; CLI commands for uploading and downloading files directly aren't available yet.
runlot storage [status] [dir] Check usage and limits (--json prints the raw data)
runlot storage delete [dir] Remove storage (requires admin)Add storage
There is no command to turn it on. Declare "storage": true in runlot.json and deploy; the deploy creates it.
{ "storage": true }runlot deployCheck status
runlot storage statusrunlot storage status --jsonRemove storage
runlot storage deleteThis command requires the admin role and asks for confirmation.
What the CLI doesn't do yet
Commands that manage files directly, such as
ls, cp, and rm, aren't available yet. For now, manage your files from your worker with env.storage or by generating a signed URL.If you need a stopgap admin tool, you can add an admin route to your worker and use access control so that only organization admins can reach it.
app.get("/admin/files", async (c) => {
const who = identity(c.req.raw);
if (who.orgRole !== "admin") return new Response(null, { status: 403 });
const page = await c.env.storage.list({ limit: 1000 });
return Response.json(page.objects);
});