办公文档
用 Cargo CLI 管理工作区成员、令牌…
当需要通过 Cargo CLI 管理 Cargo 工作区的用户、角色、API 令牌、文件夹、环境变量、工作区文件或向 Cargo 团队提交反馈时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 60/100 ×0.15
适用场景
用 Cargo CLI 管理工作区成员、特定
解决思路
- 先确认已登录:运行 `cargo-ai whoami` 检查是否返回工作区;若未登录,先执行 `npm install -g @cargo-ai/cli`(若无全局安装则每条命令前加 `npx @cargo-ai/cli`),再用 `cargo-ai login --email you@company.com`(邮件验证码,无需浏览器,首次使用会创建账号),也可用 `--oauth`(浏览器)或 `--token <api-token>`(CI);写操作前用 `cargo-ai whoami` 确认当前工作区。
- 先发现资源再操作:用 `cargo-ai whoami` 查看当前用户与工作区,用 `cargo-ai workspaceManagement user list` 列出成员,用 `cargo-ai workspaceManagement role list` 列出角色,用 `cargo-ai workspaceManagement token list` 列出令牌,用 `cargo-ai workspaceManagement folder list` 列出文件夹。
- 管理用户:用 `cargo-ai workspaceManagement user create --user-email <email> --role-slug <slug>` 邀请成员(需邮箱和角色),用 `cargo-ai workspaceManagement user update --user-uuid <uuid> --role-slug <new-role-slug>` 更新角色,用 `cargo-ai workspaceManagement user remove --user-uuid <uuid>` 移除成员;邀请前务必先用 `role list` 查看可用角色,并使用其中的 `slug`。
- 管理 API 令牌:用 `cargo-ai workspaceManagement token create --name "CI/CD pipeline"` 创建令牌(`--name` 必填,令牌值仅显示一次,需安全保存),用 `cargo-ai workspaceManagement token list` 列出令牌,用 `cargo-ai workspaceManagement token remove <token-uuid>` 删除令牌;命名要能一眼看出用途(如 `"GitHub Actions — production"`、`"Local dev — alice"`、`"Zapier integration"`),因为名称是列表中区分令牌的唯一方式;令牌值存入密钥管理器(如 GitHub Secrets、AWS Secrets Manager)。
- 管理文件夹:用 `cargo-ai workspaceManagement folder create --name "Q1 Campaigns" --emoji-slug "rocket" --kind "play"` 创建文件夹(kind 可为 "tool"、"play"、"agent" 或 "file"),用 `cargo-ai workspaceManagement folder get <folder-uuid>` 获取,用 `cargo-ai workspaceManagement folder update --uuid <folder-uuid> --name "Q1 2025 Campaigns"` 更新,用 `cargo-ai workspaceManagement folder remove <folder-uuid>` 删除。
- 提交反馈报告:当 CLI 失败、行为异常、缺少所需能力,或用户/代理难以完成任务时,用 `cargo-ai workspaceManagement report create --title "<short summary>" --description "<detailed description, including the command(s) tried and the error(s) seen>"` 提交报告;`--title` 写一行问题摘要,`--description` 包含执行的精确命令(敏感值脱敏)、JSON `errorMessage`、期望结果、已尝试的操作及相关 UUID(run、batch、workflow、model);不要默默放弃失败的任务,务必提交报告。
- 记录会话:用 `cargo-ai workspaceManagement session upsert --session-id <claude-session-id> --title "<short title>" --summary "<one-or-two sentence summary>"` 写入会话(在 `--session-id` 上幂等),加 `--finished` 会标记 `finished_at = now`(也可用 `--finished-at <iso>` 指定时间戳);`--session-id`、`--title`、`--summary` 每次必填,title 和 summary 在 schema 中为 NOT NULL,开始调用可传占位符、结束调用再覆盖;同一 `--session-id` 重复 upsert 会更新同一行。
- 管理工作区环境变量:用 `cargo-ai workspaceManagement envVar list` 列出,用 `cargo-ai workspaceManagement envVar create --key OPENAI_API_KEY --value sk-... --secret --description "Used by the enrichment worker"` 创建(省略 `--value` 则从同名 shell 环境变量读取,可避免值进入 shell 历史和命令行),用 `cargo-ai workspaceManagement envVar update <uuid> --value <new> --description <text>` 更新(省略 `--value` 保留原值,注意 update 接收 uuid 而非 key),用 `cargo-ai workspaceManagement envVar remove <uuid>` 删除;`--secret` 会加密存储且之后不再返回(list 和 update 不会回显),用 `--no-secret` 可转回明文;托管 worker 和应用在部署时捕获值,修改后需重新运行 `hosting deployment create` + `promote`。
- 上传工作区文件:用 `cargo-ai workspaceManagement file upload --file <path-to-file>` 上传(返回 s3Filename),用 `cargo-ai workspaceManagement file list-columns --s3-filename <s3-filename>` 在运行批处理前查看列名以映射到工作流输入。
- 任何命令都支持 `--help`,例如 `cargo-ai workspaceManagement user create --help`、`cargo-ai workspaceManagement token create --help`、`cargo-ai workspaceManagement folder create --help`。
- 所有命令向 stdout 输出 JSON,失败时以非零退出并返回 `{"errorMessage": "..."}`;创建 run 或 batch 的操作是异步的,需传 `--wait-until-finished` 或轮询对应的 `get`。
- 注意权限:用户、角色和令牌的写操作需要工作区管理员权限的令牌;文件夹写操作和 `report create` 可用非管理员令牌。
适用边界 · 注意事项
- 问题涉及 credits、plans 或 invoices 时,应使用 cargo-billing 而非本技能。
- 用户、角色和令牌的写操作需要管理员权限令牌,非管理员令牌无法执行。
- 令牌值仅在创建时显示一次,之后无法再次获取,不能依赖后续查询找回。