进阶 display.dev 2026-11-23 15:04:54 · 0 阅读

第16章 CLI 命令

第16章 CLI 命令

用于发布、源文件操作、访问控制和身份认证的 CLI 命令。

本页内容

使用 dsp CLI 在终端或脚本中创建、查看、更新、组织和分享文件。

Spaces 中的文件操作请从 file、folder、space 命令入手,完整工作流参见 Spaces and files。

运行 dsp --help 查看已安装版本支持的命令。

安装 CLI、登录并发布第一个文件的步骤,参见 Publish from your terminal。

--actor-type 和 --actor-name 是常规 CLI 命令的全局标志。为了页面可读性,下表把它们列在 publish 和 share 之下。例外是 dsp mcp server:它的 agent 身份来自所连接的 MCP client,而不是这些标志或其环境变量。

常规 CLI 命令可用 --client-source 标记发起请求的发行渠道。该标志不影响访问权限。

组织策略可能禁止 Public 发布或添加新的外部接收者。此时请改用 Company 或 Private、移除外部接收者,或请 Owner 在 Organization Security 中修改设置。CLI 不提供更改这些控制的命令,参见 Organization artifact access。

publish

``` $ dsp publish [path] ```

发布 HTML 或 Markdown 文件。用单个短横线表示 stdin(需配合 --id)。

| Flag | Value | Description | |---|---|---| | --name | string | 显示名称覆盖。可选——首次发布默认为去掉扩展名的文件名。更新时(配合 --id)会重命名 artifact 并重新生成 slug。 | | --id | string | 更新已有 artifact(版本号递增)。 | | --base-version | positive integer | 配合 --id 必填。传入你编辑时基于的当前版本号。 | | --public | boolean | 公开访问该 artifact(--visibility public 的别名)。 | | --company | boolean | 限制为组织内可见(--visibility company 的别名)。组织级 service key 默认使用此项。 | | --visibility | public \| company \| private | 可见性级别。用户级发布默认 private,组织级 service 发布默认 company。Private 在所有套餐均可用。 | | --share | repeatable string | 按邮箱邀请某人,可多次传入。 | | --share-with | comma-separated string | 与多次 --share 等效,合并在一个标志里。 | | --clear-shares | boolean | 移除所有已邀请的邮箱(仅更新时可用)。 | | --theme | string (default github) | Markdown 主题。发布 HTML 时忽略。 | | --reload | boolean | 新版本就绪时刷新已打开的查看页。默认关闭——查看者会收到一个可忽略的 Refresh to vN 操作。若有打开的评论表单,自动刷新会延迟到表单关闭且为空。 | | --actor-type | human \| agent | 覆盖自动检测的 actor 分类。CLI 在 stdio 句柄是 TTY 时推断为 human,否则为 agent;当真人通过管道输出、或自定义脚本想声明 agent 身份时可手动指定。等效环境变量:DISPLAYDEV_ACTOR_TYPE。各取值含义参见 Actor。 | | --actor-name | ASCII string ≤128 chars | 记录在 artifact 版本历史中、与 actor 分类并列的显示名称(如 claude-code@1.0.45、ci-deploy-bot、manual-cleanup-batch-3)。等效环境变量:DISPLAYDEV_ACTOR_NAME。 |

如果 dsp 在没有已保存凭据或 DISPLAYDEV_API_KEY 的情况下运行,publish 会返回预览 URL 和一次性认领 URL——参见 Publish without an account。

更新 artifact 时,先用 dsp get-metadata 获取当前基线,再用 dsp search --in 和 dsp read 检查源文件,然后用 dsp edit 做一次精确替换。需要完整本地文件时用 dsp export,需要替换完整源文件时用 dsp publish --id。

更新必须保持 artifact 原有格式:Markdown artifact 用 .md 文件,HTML artifact 用 .html 文件。Markdown 与 HTML 互转请发布新 artifact。

make-copy

``` $ dsp make-copy [shortId][@version] ```

创建独立副本;只给 short ID 时使用服务器默认值。

| Flag | Value | Description | |---|---|---| | --name | string | 新 artifact 的名称,默认为 Copy of 。 | | --visibility | public \| company \| private | 新 artifact 的可见性,默认继承源 artifact 的当前可见性。 | | --share | repeatable string | 邀请某人访问新 artifact,可多次传入。 | | --share-with | comma-separated string | 与多次 --share 等效,合并在一个标志里。 | | --json | boolean | 将复制结果和所选源版本作为一个 JSON 输出。 |

在 ID 后加 @ 可复制保留的历史版本;不加则复制当前版本。新 artifact 从版本 1 开始,不含讨论。源文件的受邀者不会带入副本,只有通过 --share 或 --share-with 传入的地址才会被邀请。

只给 short ID 时使用服务器默认值:当前版本、Copy of 和源可见性。传 --visibility private 可创建私有副本。其他组织的符合条件的公开 artifact 在所有套餐均可复制,且只能复制其当前版本。--json 会包含实际复制的版本号 sourceVersion。请先确认目标位置;同一操作键不能在不同目标或输入下重复使用。not-found 结果可能意味着内容缺失或不可用。浏览器端恢复方式参见 Make a copy。

share

``` $ dsp share [shortId] ```

旧版共享命令。Spaces 文件请使用 dsp file share、change-access 或 remove-access。

服务器会拒绝旧版共享命令,请使用 Spaces sharing 管理访问。

| Flag | Value | Description | |---|---|---| | --visibility | public \| company \| private | 旧版可见性选择器。 | | --add-users | comma-separated string | 旧版添加列表。 | | --remove-users | comma-separated string | 旧版移除列表。 |

--visibility / --add-users / --remove-users 至少提供一项。

rename

``` $ dsp rename [shortId] ```

重命名已发布的 artifact。slug 会根据新名称重新生成;旧 URL 仍可通过 shortId 访问。

| Flag | Value | Description | |---|---|---| | --name (required) | string | 新显示名称。 |

list

``` $ dsp list ```

不带文本查询浏览组织内的 artifact。

| Flag | Value | Description | |---|---|---| | --author | repeatable string | 按作者筛选。取值可为邮箱、用户 ID 或 me,多个值取 OR。me 需要用户级凭据——组织 API key 下传入会被拒绝。 | | --visibility | comma-separated public \| company \| private | 按可见性筛选。只会显示你创建的 private artifact。 | | --since | ISO date-time | 只显示此时间点及之后更新的 artifact。 | | --sort | updated_at \| view_count \| name | 排序列,默认 updated_at。 | | --dir | asc \| desc | 排序方向。默认:updated_at / view_count 为 desc,name 为 asc。 | | --cursor | opaque string | 上一次响应返回的分页令牌。筛选条件变化时请去掉 cursor。 | | --limit | integer 1–100 | 最大返回行数,默认 50。 | | --json | boolean | 输出稳定的 JSON 响应。 |

输出在 stdout 上每行一条(shortId vN name url)。若有更多页,stderr 会打印可直接运行的续页命令,stdout 保持干净以便管道使用。

search

``` $ dsp search [query] ```

按文本或筛选条件搜索 Spaces 文件,或搜索旧版 artifact 名称。搜索旧版源文件精确文本用 --in。

| Flag | Value | Description | |---|---|---| | --organization-id | organization ID | 指定一个有权限的组织进行跨文件搜索。不能与 --in 同用,且不会扩大凭据的访问范围。 | | --in | shortId or shortId@version | 在单个 artifact 内搜索旧版源文件精确文本,可加版本号锁定。原生文件请用 dsp file search。 | | --cursor | opaque string | 继续按日期排序的 Spaces 搜索或旧版名称搜索。查询和筛选条件须保持不变。 | | --location-id | Up to 20 comma-separated Space or folder IDs | 搜索所选位置及其所有后代。与 --space-id 二选一。 | | --space-id | Space ID | 将 Spaces 搜索限定在一个可见 Space。 | | --type | MIME type | 按文件类型筛选,例如 text/markdown。 | | --modified-after | UTC date and time | 包含此时间及之后修改的文件。 | | --modified-before | UTC date and time | 包含此时间之前修改的文件。 | | --created-by | user ID | 按原始创建者筛选 Spaces 搜索。 | | --sort | relevance, modified-desc, or modified-asc | Spaces 搜索的排序方式。 | | --offset | non-negative integer | 继续旧版源文件搜索,需配合 --in。 | | --limit | positive integer | 请求的最大结果数。旧版名称搜索接受 1–100;旧版源文件搜索每页最多 50 条;Spaces 有自己的结果上限。 | | --json | boolean | 将响应作为一个 JSON 输出。 |

在 Spaces 组织中,跨文件查询搜索文件名和已索引文本。查询长度 2–200 字符:可以是字面词、末词前缀或引号短语。

设置了 Spaces 位置、创建者、类型或日期筛选时,可省略查询。

仅筛选的搜索默认 modified-desc,也可用任一修改时间排序。如果 CLI 不识别 --location-id,请检查 dsp search --help。

``` dsp search "quarterly plan" --location-id dsp search --location-id , --type text/markdown --json ```

结果包含当前文件 ID、URL、可用摘要和索引覆盖情况。相关性排序只返回有限结果集。要翻页,请按修改日期排序,并将返回的 cursor 与相同的查询、筛选和 limit 一起传入。

如果结果受限且没有 cursor,请收窄查询。刚保存或移动的内容可能需要时间才能出现。用 dsp file read 读取结果。

旧版组织保留名称搜索及其续页 cursor。使用 --in 时,搜索匹配字面旧版源文本,返回字节偏移、行提示和有限上下文。续页会锁定该 artifact 的编号版本。不要把 Spaces 的 ID 传给 --in;Spaces 搜索失败后也不要改用旧版搜索重试。

find

``` $ dsp find [query] ```

已废弃的兼容命令。浏览用 dsp list,搜索用 dsp search。

find 保留旧版可选 query 的行为以兼容现有脚本,并向 stderr 打印迁移提示。新脚本请使用 list 或 search。

get-metadata

``` $ dsp get-metadata [shortId] ```

以 JSON 输出 artifact 元数据、保留的版本、当前标题大纲和未关闭的评论线程。

该命令没有专属标志。无权读取的章节会被省略。有限范围的源内容请用 dsp read。

dsp get-metadata 在有权限时返回 artifact 元数据、保留版本、标题大纲和未关闭线程。它取代了原先的 dsp get --include versions。

read

``` $ dsp read [shortId] ```

输出一段有范围限制的 UTF-8 源文本。加 @ 和数字可锁定版本,如 dsp read abc123@2。

| Flag | Value | Description | |---|---|---| | --offset | non-negative integer | 从零开始的 UTF-8 字节偏移,默认 0。 | | --limit | integer 4–262144 | 最大返回字节数,默认 65536。 | | --json | boolean | 以 JSON 输出内容和续读元数据。 |

不加 --json 时,stdout 只包含源文本;进度和锁定版本的续读命令输出到 stderr。

edit

``` $ dsp edit [shortId] ```

通过替换一段精确且唯一的源文本发布新版本。

| Flag | Value | Description | |---|---|---| | --base-version (required) | positive integer | 编辑所基于的当前版本。 | | --old | string | 要替换的精确源文本。与 --old-file 二选一。 | | --old-file | path | 从 UTF-8 文件读取精确源文本,适合多行内容。 | | --new | string | 替换文本,空字符串表示删除旧文本。与 --new-file 二选一。 | | --new-file | path | 从 UTF-8 文件读取替换文本。 | | --json | boolean | 输出稳定的 JSON 响应。 |

旧文本必须恰好出现一次。两个值的上限均为 262144 个 UTF-8 字节。若已有更新的版本发布,请用 read 或范围限定的 search 检查该版本、合并你的修改,再以新版本号重试。

export

``` $ dsp export [shortId] ```

将已发布的源字节输出到 stdout。加 @ 和数字可锁定版本,如 dsp export abc123@2。

| Flag | Value | Description | |---|---|---| | --format | original \| markdown (default original) | original 按发布时的字节原样返回;markdown 将 HTML artifact 转为 Markdown。 |

export 是本地 CLI 工作流的完整文件方案;远程 MCP 使用范围限定的 read。

delete

Display 已拒绝旧版删除命令。Spaces 中释放存储请用 dsp space delete-trash 删除已在回收站中的条目;若要在回收站保留期内保持可恢复,请用 dsp file trash 或 dsp folder trash。

``` $ dsp delete [shortId] ```

旧版删除命令。Spaces 文件请使用 dsp file trash。

| Flag | Value | Description | |---|---|---| | --confirm | boolean | 提交旧版请求时必填。 |

login

``` $ dsp login ```

通过邮箱验证码、SSO 设备流程或 API key 向 Display 认证。

| Flag | Value | Description | |---|---|---| | --email | string | 邮箱地址。非交互运行下使用邮箱验证码或 SSO 时必填;与 --api-key 不兼容。 | | --code | 6-digit string | 邮箱验证码,配合 --email 使用。 | | --api-key [key] | string (optional value) | 用 API key 认证。不传值时在 TTY 下提示输入,非 TTY 下从 stdin 读取。 | | --json | boolean | 输出机器可读的结构化信息而非普通文本。 |

whoami

``` $ dsp whoami ```

显示当前活跃凭据对应的账户和组织。

脚本中请使用 dsp whoami --json。结果包含 user(含 ID 和邮箱)、organization(含 ID 和名称)、membership(含角色)以及 keyType(user 或 org)。组织 key 下 user 和 membership 为 null。命令失败时以非零退出码退出并向 stderr 打印错误。

mcp

``` $ dsp mcp ```

通过 stdin/stdout 启动 MCP server。该进程由你的 agent 启动,无需手动运行。主机配置参见 MCP server。

没有额外标志。server 行为取决于 CLI 是否有已保存凭据,agent 身份来自所连接 MCP client 的名称和版本。参见 MCP tools。

Authentication

CLI 按以下顺序读取凭据:

1. DISPLAYDEV_API_KEY——环境变量,优先级最高。 2. dsp login 写入的已保存会话。

设置 DISPLAYDEV_ACTOR_TYPE(human 或 agent)和 DISPLAYDEV_ACTOR_NAME 可以在所有常规 CLI 调用中统一声明 actor 身份,等效于每次传 --actor-type 和 --actor-name。CLI 根据 stdio 句柄是否为 TTY 推断 --actor-type;真人通过管道输出或脚本想声明 agent 时可覆盖。dsp mcp 忽略这些设置,使用所连接 MCP client 的身份。

Exit codes

- 0——成功。 - 1——一般失败(认证无效、服务器错误、网络问题)。 - 2——用法错误(缺少必填标志、参数格式错误)。 - 3——达到套餐限制(artifact 或存储受限),会打印升级链接。 - 4——artifact 不存在或无权限。

space

Space 和文件夹内容支持 --sort name|modified|format|owner 和 --dir asc|desc。format 按显示的 Type 标签排序,包括任意文件格式的标签;--type 仍是独立的筛选。只有 Name 排序会始终把文件夹放在前面(两种方向皆然)。Type 或 Owner 相同时按 Name 在所选方向上排列,缺失 owner 的条目排在最后。

Space 和文件夹子列表还支持按显示的创建者名称 --sort createdBy,配合 --dir asc 或 --dir desc。创建者名称相同时按条目 Name 在该方向排列,未知创建者排在最后。此选项不适用于 Home、Shared with me、Space 目录和回收站。

Home(dsp file list --view home)和 Shared with me(--view shared-with-me)也接受 format 和 owner。dsp file list 只返回文件;Home 文件夹用 dsp folder find --view home,共享文件夹用 --view shared-with-me。控制台的 Home 显示推荐模板和 10 个普通 Recent 文件;其 Recent 页面显示完整普通文件集合。未筛选的 Home agent 集合仍包含文件夹。Shared with me 混合显示文件夹和文件。Space 目录、回收站和固定排序的名称搜索保留现有排序方式。请将 cursor 与相同查询一起传回;若条目变化或不可访问导致 cursor 被拒,请不带 cursor 重新开始。

用 --created-by 按原始创建者筛选。可用于 dsp space list-contents、dsp folder list、Home 或 Shared with me 下的 dsp file list,以及 Home 或 Shared with me 下的 dsp folder find。加 --include-creators 可在创建者筛选之前返回一个 creators 数组,包含所有匹配页面上可访问的创建者选项,每项含 userId、name 和 image。用其 userId 作为 --created-by 的值;更改创建者时请移除 cursor。无记录创建者的条目会出现在未筛选列表中。创建者筛选不适用于 Space 目录、回收站和固定排序的名称搜索。

``` $ dsp space ```

浏览和管理 Spaces

| Command | Inputs and options | |---|---| | dsp space create | --name (required); --idempotency-key (required) | | dsp space list-admin | --deleted ; --cursor ; --limit | | dsp space list-members | --cursor ; --limit | | dsp space add-member | --user ; --email ; --group ; --role (required); --idempotency-key (required) | | dsp space change-member-role | --role (required); --if-match (required); --idempotency-key (required) | | dsp space remove-member | --if-match ; --idempotency-key (required) | | dsp space list | --sort ; --dir ; --cursor ; --limit ; --type ; --query | | dsp space get | 无专属选项。 | | dsp space list-contents | --sort ; --dir ; --cursor ; --limit ; --type ; --query ; --modified-after ; --modified-before | | dsp space get-settings | 无专属选项。 | | dsp space rename | --name (required); --idempotency-key (required) | | dsp space set-header-visibility | --value (required; inherit, open or collapsed); --idempotency-key (required) | | dsp space set-members-only | --enabled (required); --idempotency-key (required) | | dsp space delete | --confirm; --idempotency-key (required) | | dsp space delete-with-contents | --confirm; --idempotency-key (required) | | dsp space restore | --idempotency-key (required) | | dsp space list-trash | --sort ; --dir ; --cursor ; --limit | | dsp space delete-trash [itemIds...] | 选择条目 ID 或 --all。用 --preview 预览。确认需要 --confirm、--if-match 和 --idempotency-key 。 | | dsp space list-key-access | --cursor ; --limit ; --json | | dsp space allow-key | --api-key (required); --role (required); --idempotency-key (required); --json | | dsp space change-key-access | --if-match (required); --role (required); --idempotency-key (required); --json | | dsp space revoke-key | --if-match ; --idempotency-key (required); --json |

只有当前对 Shared Space 拥有 Manager 权限的具名人员才能管理其 key 授权,仅有组织角色不够。--api-key 接受已知的组织 key ID,而非其密钥本身。替换后的 key 需要单独授权。

从回收站永久删除条目:

1. 预览要删除的条目。

``` dsp space delete-trash --preview ```

预览整个 Space 回收站请用 --all 代替条目 ID。

2. 检查符合条件的条目、被排除的条目和将释放的存储。预览会在 etag 中返回 ETag,确认时需要保留该值。 3. 确认相同的 Space 和选择。

``` dsp space delete-trash --confirm \ --if-match '""' \ --idempotency-key ```

将 替换为返回 ETag 双引号内的文本。保留外层单引号和内层双引号,这些 shell 引号可确保 CLI 读取到准确的 ETag。若预览用的是 --all,确认时也用 --all 代替条目 ID。

4. 出错或响应不确定时:

- 若结果不确定,请在 24 小时内用相同的 Space、选择、ETag 和请求键重试。 - 若预览已过期,请先重新预览再确认。 - 若删除因恢复流程而暂停,请在暂停结束后重新请求预览。

运行 dsp space --help 查看说明,子命令也提供离线 --help。

用 dsp space set-header-visibility --value collapsed --idempotency-key 设置 Space 默认值;单个文档例外用 dsp file set-header-visibility。值 inherit 表示移除显式设置:对 Space 而言 inherit 即 Open;对文件而言 inherit 使用其 Space 的默认值。用 dsp space get-settings 或 dsp file get 查看设置,返回三个字段:

- headerVisibility:配置的选择,为 inherit、open 或 collapsed。 - defaultHeaderVisibility:配置为 inherit 时实际生效的值。 - effectiveHeaderVisibility:将配置应用到默认值后的最终生效值。

读者在浏览器中保存的选择优先于 effectiveHeaderVisibility。参见 Header visibility。

folder

``` $ dsp folder ```

浏览和组织文件夹

| Command | Inputs and options | |---|---| | dsp folder get | 无专属选项。 | | dsp folder list | --sort ; --dir ; --cursor ; --limit ; --type ; --query ; --modified-after ; --modified-before | | dsp folder create | --parent-id (required); --name (required); --preview; --operation ; --initial-grants ; --idempotency-key | | dsp folder rename | --name (required); --idempotency-key (required) | | dsp folder list-access-requests | --cursor ; --limit | | dsp folder request-access | --role ; --message ; --idempotency-key (required) | | dsp folder share | --email ; --user ; --organization; --anyone; --api-key ; --group ; --role (required); --discoverable ; --idempotency-key (required) | | dsp folder get-access | --cursor ; --limit | | dsp folder change-access | --access-ref (required); --if-match (required); --idempotency-key (required); --role ; --discoverable | | dsp folder remove-access | --access-ref (required); --if-match ; --idempotency-key (required) | | dsp folder find [nameQuery] | --sort ; --dir ; --cursor ; --limit ; --view ; --shared-by ; --query ; --type ; --modified-after ; --modified-before ; --organization-id | | dsp folder trash | --idempotency-key (required); --confirm | | dsp folder restore | --idempotency-key (required) | | dsp folder copy | --parent-id (required); --idempotency-key (required); --initial-grants ; --json | | dsp folder move | --parent-id (required); --preview; --if-match ; --idempotency-key ; --json |

运行 dsp folder --help 查看说明,子命令也提供离线 --help。

file

``` $ dsp file ```

创建、查看、搜索和编辑原生 Space 文件

文件和文件夹共享可授予 viewer、commenter、contributor 或 editor。Contributor 可在现有受众范围内创建和编辑;Editor 还能管理人员、群组、Company 访问、链接访问和可发现性(须遵守共享规则)。Manager 只能在 Shared Space 根级授予;已有的直接文件和文件夹 Manager 会变为 Editor,继承的 Space Manager 保留原角色。若共享或访问请求审批被拒,请请 Editor 或 Space Manager 处理,不要通过更换凭据或提升自身权限来绕过拒绝。

用 dsp file create 在 My Space 创建文件,或用 --parent-id 指定目标位置。

用 dsp file update 替换源文件,不改变名称和访问权限;重命名请单独用 dsp file rename:

``` dsp file get dsp file update ./report.html \ --content-type text/html \ --base-revision \ --idempotency-key dsp file rename \ --name "Project update" \ --idempotency-key ```

--base-revision 使用 dsp file get 返回的 currentRevisionId。示例替换的是 HTML 文件;其他文件请使用实际的媒体类型。若其他保存操作修改了文件,请先合并你的修改再重试。结果不确定时,请在 24 小时内用原请求键和相同输入重试同一操作。较早的不确定结果的恢复方式参见 Read and update a file。

重命名需要 Editor 或继承的 Space Manager 权限,且保留文件内容和历史。更改访问者请使用文件共享命令。

| Command | Inputs and options | |---|---| | dsp file restore-revision | --revision (required); --base-revision (required); --idempotency-key (required) | | dsp file history | --cursor ; --limit | | dsp file get-revision | --revision (required) | | dsp file keep-revision | --revision (required); --idempotency-key (required) | | dsp file delete-revision | --revision (required); --idempotency-key (required); --confirm | | dsp file create [path] | --content ; --filename ; --content-type ; --idempotency-key ; --parent-id ; --preview; --operation ; --name ; --theme ; --initial-grants ; --convert-from docx; --output-format markdown\|html; --source-item-id ; --source-revision-id | | dsp file get | 无专属选项。 | | dsp file read | --revision-id ; --offset ; --limit | | dsp file search | --revision ; --offset ; --limit | | dsp file export | --revision-id ; --output ; --overwrite | | dsp file edit | --base-revision (required); --idempotency-key (required); --old ; --old-file ; --new ; --new-file | | dsp file update [path] | --content ; --filename ; --content-type (required except Word conversion); --idempotency-key (required); --base-revision (required); --convert-from docx; --source-item-id ; --source-revision-id | | dsp file list-access-requests | --cursor ; --limit | | dsp file request-access | --role ; --message ; --idempotency-key (required) | | dsp file share | --email ; --user ; --organization; --anyone; --api-key ; --group ; --role (required); --discoverable ; --idempotency-key (required) | | dsp file get-access | --cursor ; --limit | | dsp file change-access | --access-ref (required); --if-match (required); --idempotency-key (required); --role ; --discoverable | | dsp file remove-access | --access-ref (required); --if-match ; --idempotency-key (required) | | dsp file list | --sort ; --dir ; --cursor ; --limit ; --view ; --shared-by ; --query ; --type ; --modified-after ; --modified-before | | dsp file find | --cursor ; --limit ; --organization-id ; --type ; --modified-after ; --modified-before | | dsp file trash | --idempotency-key (required); --confirm | | dsp file restore | --idempotency-key (required) | | dsp file set-header-visibility | --value (required; inherit, open or collapsed); --idempotency-key (required) | | dsp file rename | --name (required); --idempotency-key (required); --json | | dsp file copy | --parent-id (required); --idempotency-key (required); --initial-grants ; --template-intent ; --name ; --source-revision-id ; --json | | dsp file set-template | --enabled (required); --idempotency-key (required); --json | | dsp file move | --parent-id (required); --preview; --if-match ; --idempotency-key ; --json |

运行 dsp file --help 查看说明,子命令也提供离线 --help。

group

``` $ dsp group ```

管理组织群组和受托成员资格

| Command | Inputs and options | |---|---| | dsp group list | --json; --limit ; --cursor ; --search | | dsp group get | --json | | dsp group create | --json; --idempotency-key (required); --name (required); --description | | dsp group update | --json; --idempotency-key (required); --name ; --description | | dsp group delete | --json; --idempotency-key (required); --confirm | | dsp group list-members | --json; --limit ; --cursor | | dsp group list-administrators | --json; --limit ; --cursor | | dsp group add-member | --json; --idempotency-key (required); --user ; --email | | dsp group remove-member | --json; --idempotency-key (required); --user (required) | | dsp group assign-administrator | --json; --idempotency-key (required); --user (required) | | dsp group remove-administrator | --json; --idempotency-key (required); --user (required) |

群组创建和删除需要 Owner。群组管理员可管理成员资格(包括添加自己),请谨慎授予该角色。

成员资格操作需且仅需一个接收者:--user 或 --email。Space 成员资格可在 --user、--email、--group 中选择其一。文件和文件夹共享也接受 --group。群组授权不使用 --discoverable。

运行 dsp group --help 查看说明,子命令也提供离线 --help。

member

``` $ dsp member ```

原生成员停用与 Manager 覆盖情况提示

| Command | Inputs and options | |---|---| | dsp member preview-deactivation | --cursor ; --limit ; --json | | dsp member deactivate | --idempotency-key (required); --confirm (required); --json |

以对目标成员有管理权限的 Owner 或 Admin 身份预览停用。预览仅作提示。停用会重新计算哪些 Shared Space 将失去最后一名具备资格的人工 Manager。

添加 --confirm 前请仔细核对目标成员。停用会保留成员资格和内容,删除该成员为本组织签发的个人 API key 并移除群组成员资格,且可以在没有替代 Manager 的情况下继续。API

评论 (0)