Newshot

Vercel Drives 新增 CLI 命令和独立 SDK

AI summary

现在可以通过新的 vercel drives 命令或 TypeScript(@vercel/drives)和 Python(vercel-drives)独立 SDK 创建、列出、分叉和删除 Vercel Drives。Drives 还提供了 /v1/drives REST API 和专属权限,管理它们不再需要 Sandbox API 或权限。Drives 仍可像以前一样挂载到 Vercel Sandboxes,现有的 Sandbox CLI 命令和 SDK 代码继续有效,并且在 Vercel 仪表板和 Observability 中有了专属页面,适用于 Hobby、Pro 和 Enterprise 套餐。

Translation(model translation, not the source's own text)

文章标题:Vercel Drives 新增 CLI 命令与独立 SDK

正文: 现在,你可以使用新的 vercel drives 命令,或面向 TypeScript(@vercel/drives)和 Python(vercel-drives)的独立 SDK 来创建、列出、fork 和删除 Vercel Drives。Drives 还提供了位于 /v1/drives 的 REST API 以及 Drive 专属权限,因此管理它们不再需要 Sandbox API 或权限。

使用最新的 Vercel CLI,如有需要先通过 vercel link 关联项目,然后运行:


        vercel drives get-or-create workspace-cache --region iad1vercel drives listvercel drives fork existing-drive existing-drive-fork
      

使用 Vercel CLI 创建、列出和 fork Drives。

使用 npm install @vercel/drives 安装 TypeScript SDK,或使用 pip install vercel-drives 安装 Python SDK,然后运行:


        import { Drive } from '@vercel/drives';
await Drive.getOrCreate({  name: 'workspace-cache',  region: 'iad1',});
const driveList = await Drive.list();for await (const item of driveList) {  console.log(item.name);}
const source = await Drive.get({ name: 'existing-drive' });const fork = await source.fork({ name: 'existing-drive-fork' });console.log(fork.name);
      

使用 TypeScript SDK 创建、列出和 fork Drives。

Drives 仍像以前一样挂载到 Vercel Sandboxes 中,现有的 Sandbox CLI 命令和 SDK 代码继续可用。Drives 现在在 Vercel 仪表板和 Observability 中也有了各自的页面。

Drives 在 Hobby、Pro 和 Enterprise 计划中均可用。更多信息请参阅 Drives 文档。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗