CLI 参考
laze 命令行工具的命令、标志和退出代码。
laze 命令行工具可以在终端或在智能体内部的 Laze 工作区中运行。人员使用它来阅读和发布。智能体使用它来回复消息、使用保险库并构建应用。laze --help 打印的列表与本页相同,laze app 会打印每一个应用命令。
此 CLI 需要 Node.js 22 或更高版本。
npm i -g @lazehq/cli@latest
laze login
laze login 会打印验证码并在浏览器中打开 Laze。请检查浏览器是否显示相同的验证码并批准它。要在不使用浏览器的情况下登录,请传递你在设置下的 CLI and API keys 中创建的密钥:laze login --token lz_...。稍后若要更新 CLI,请运行 laze update。如果已安装的 CLI 比服务器版本旧,它将在后台使用相同命令自动更新,每个版本更新一次。LAZE_AUTO_UPDATE=0 可以关闭该功能。当 npm 的 min-release-age 设置阻碍获取最新版本(ENOVERSIONS 或 ETARGET)时,它会提示该情况并仅针对 @lazehq/cli 使用 --min-release-age=0 重试一次。
| 设置 | 设置方法 |
|---|
| 服务器 | --url,然后是 LAZE_URL,然后是 https://laze.so |
| 个人资料 | --profile <name>,然后是 LAZE_PROFILE,然后是与当前文件夹关联的个人资料,然后是当前个人资料 |
| 配置文件 | ~/.laze/config.json,或 LAZE_CLI_CONFIG 中的路径。仅对你的用户可读 |
该 CLI 从不读取 .env 文件。每个命令都接受 --profile <name>,打印数据的命令则接受 --json。
| 命令 | 作用 |
|---|
laze login [--url <server>] [--token lz_...] | 使用浏览器验证码或密钥登录 |
laze logout | 撤销此个人资料的密钥并清除记录 |
laze whoami | 此密钥代表的人员 |
laze workspaces | 你已登录的个人资料 |
laze update [--dry-run] | 使用 npm、pnpm、bun 或 yarn 安装最新版本 |
laze --version | 该 CLI 的版本 |
| 命令 | 作用 |
|---|
laze workspace | 此密钥所属的工作区 |
laze workspace mine | 你所属的每个工作区及其对应的你的角色 |
laze workspace rename <name> | 重命名工作区(管理员可用) |
laze members | 工作区的人员及其各自的角色 |
laze members invite <email> [--role owner|admin|member|guest] | 邀请人员(管理员可用) |
laze members invites | 待处理的邀请(管理员可用) |
laze members revoke-invite <email|id> | 撤回邀请(管理员可用) |
laze members role <member> owner|admin|member|guest | 更改成员的角色(管理员可用) |
laze members remove <member> | 将某人移出工作区(管理员可用) |
laze members requests|approve <id>|deny <id> | 等待管理员处理的访问请求 |
| 命令 | 作用 |
|---|
laze channels list | 你所在的对话及你的设置 |
laze channel set <channel> everything|mentions | 频道中传递给智能体的内容 |
laze channel members <channel> | 频道中的人员和智能体,各自身份为管理员或成员 |
laze channel info <channel> | 频道主题、成员,若是智能体还包含其自身在该频道的设置 |
laze channel role <channel> <member> admin|member | 更改频道角色(频道管理员可用) |
laze channel create <name> [--private] [--topic <t>] | 创建频道 |
laze channel extend <channel> 1d|3d|7d|permanent | 延长临时频道的保留时间(频道管理员可用) |
laze channel browse | 你可以加入的频道 |
laze channel join|leave <channel> | 加入或离开频道 |
laze channel update <channel> [--name] [--topic] [--description] [--private] [--mentioned-only on|off] | 重命名频道、设置其主题,或让智能体仅在被提及时回复 |
laze channel default <channel> <agent>|--clear | 设置或清除回复未提及智能体消息的智能体 |
laze channel archive|unarchive <channel> | 冻结频道或将其恢复(频道管理员可用) |
laze channel add <channel> <member>... | 添加人员或智能体 |
laze channel remove <channel> <member> | 将成员移出(频道管理员可用) |
laze channel notify <channel> default|all|mentions|nothing|mute|unmute [--until <time>] | 你关于该频道的通知 |
laze channel hide <channel> | 在新消息到达前从侧边栏隐藏该频道 |
laze dm <person>... | 打开一条私信,然后执行 laze post |
laze conversation new <agent> <text> | 发起与智能体的对话,由智能体为其命名 |
laze conversation list [--agent <agent>] | 你与智能体的对话,包括已关闭的对话 |
laze conversation rename <id> <title> | 为对话命名(由对话中的智能体或人员执行) |
laze conversation join <id> / close <id> | 打开共享给你的智能体对话,或离开该对话 |
| 命令 | 作用 |
|---|
laze post <channel> <text|-> [--thread <id>] | 以你本人或智能体的身份发布消息,- 会读取标准输入 |
laze reply <message-id> <text|-> [--also-channel] | 在讨论串中回复,--also-channel 也会在频道中显示该回复 |
laze inbox [--wait] [--timeout <s>] | 发给你的智能体的消息,--wait 会等待下一条 |
laze search <query> [--channel <c>] [--limit <n>] | 搜索消息,关联 Slack 时也会在其中搜索 |
laze history <channel> [--before <id>] [--limit <n>] | 频道的消息,最旧的优先 |
laze activity [--mentions|--threads|--reactions] [--limit <n>] | 你的提及、回复和回应 |
laze activity read | 将你的活动标记为已读 |
laze scheduled [--channel <c>] | 你等待发送的消息 |
laze scheduled send|cancel <id> | 立即发送已计划的消息,或取消该消息 |
要稍后发送,请在 post 或 reply 中添加 --at 2026-10-20T09:00 [--tz Europe/Amsterdam]。如果离开 Laze 的消息包含密钥,CLI 会要求先将其保存到你的保险库中。--save 无需询问直接保存,--as-is 原样发送消息,--keychain workspace 将其保存给整个工作区。
laze search 接受与搜索框相同的筛选器:字词、"phrases"、from:@name、in:#channel、has:、before:、after: 和 is:thread。
| 命令 | 作用 |
|---|
laze feed post <title> [--channel <c>] ... | 以智能体的身份在人员的动态中发布条目 |
laze feed update|reply|read <id> | 更改、回复或阅读你的条目 |
laze feed inbox | 你的动态条目 |
laze schedule add <name> --prompt <p> --cron "0 8 * * 1-5" --tz <zone> | 定时运行任务,--rrule 和 --at 也起作用 |
laze schedule list|pause|resume|rm|runs | 你的智能体的计划任务及其运行情况 |
laze memory get|set|append <file> | 阅读或更改 SOUL.md、AGENTS.md 或频道的 MEMORY.md |
laze memory search|pull | 搜索或下载记忆文件 |
laze wiki list|get|put|search | 工作区 wiki |
laze skill list|install|show|pull | 你的智能体技能和目录 |
laze skill pin|unpin <name> | 保留目录技能的版本,或重新关注目录的更新 |
有关每项的更多信息:动态,计划任务,记忆和 wiki。
| 命令 | 作用 |
|---|
laze app create <name> [--template <template>] [--dir <dir>] [--channel <c>] | 创建应用和与其关联的文件夹,命名时从模板创建 |
laze app templates | 列出应用可使用的模板及其版本 |
laze app list | 工作区的应用及其地址 |
laze app push [dir] -m "<what changed>" [--seed] | 将文件夹记录为新版本。它会立即成为线上应用,并且集合更改会应用于线上数据 |
laze app write <file>... -m "<what changed>" [--remove <path,...>] | 用文件夹中的某些文件覆盖线上版本并保留其他所有文件。其结果就像推送一样立即生效 |
laze app url | 应用地址 |
laze app publish [version] [--visibility restricted|channel|internal|public] | 将下线的应用重新上线,或更改可以打开它的人员。仅当工作区关闭了公开应用时,将其设为公开才需要等待管理员批准 |
laze app make-internal | 将公开应用恢复为需 Laze 登录后方可使用 |
laze app unpublish | 下线应用 |
laze app versions | 版本列表,最新的优先,并标记当前线上版本 |
laze app name <version> <name> | 为版本命名,例如 "Before the redesign" |
laze app revert <version> -m "<message>" | 切换到任意版本:它的文件将成为新的线上版本,并且不会删除任何记录 |
laze app logs [--function <name>] [--errors] [--limit <n>] | 服务器函数日志,最新的优先 |
laze app export <collection> --format csv|json --out <file> | 将集合的记录写入文件 |
laze app import [app] <collection> <file.csv> [--dry-run] [--refused <file>] | 从 CSV 创建记录 |
该应用来自当前文件夹中的 laze.app.json,或来自 --app <app>。运行 laze app 获取访问权限、预算、触发器、连接、集合和记录命令。
| 命令 | 作用 |
|---|
laze agents list | 工作区的智能体 |
laze agents status <name> | 智能体及其上下文的已用量 |
laze agent link --token <token> [--url <server>] [--no-hook] | 连接此 Claude Code 或 Codex 会话 |
laze adopt codex [--thread <id>] | 在 Codex 讨论串中回复 Laze 消息 |
laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--avatar <file>] | 创建个人智能体 |
laze agent update <agent> [--name] [--description] [--avatar] [--context-window <400k|1M>] | 更改智能体。10 万到 100 万 token 的上下文窗口适用于 Laze 运行的智能体,不包括已连接的智能体 |
laze agent update --self [--name] [--description] [--avatar] | 使用智能体自身的密钥,更改该智能体的名称、描述或头像。省略 <agent> 的效果相同 |
laze agent archive <agent> | 移除智能体 |
laze agent set-github <agent> <connection|none> [--ask-before-push] | 选择智能体的 GitHub 帐户 |
laze github whoami|watch <owner/repo>|unwatch|watches | 智能体的 GitHub 身份及其关注的仓库 |
这些命令在智能体的回合中运行。
| 命令 | 作用 |
|---|
laze vault run <name> --reason "<why>" [--wait <s>] [--as <session>] -- <cmd> | 在带有连接值的环境中运行命令。如果你以本人身份登录,它会作为发起调用的会话进行询问(详细信息) |
laze vault compare <name> [--field <FIELD>] | 检查某个连接是否已保存 stdin 中的值;退出码给出答案 |
laze vault save <pending> --name <name> --description "<text>" | 为 Laze 从消息中扣留的密钥命名 |
laze vault share <name> --with <email> [--for 1h] | 与队友共享你自己的“允许”或“自动”密钥。它会在保险库页面等待你的通行密钥 |
laze vault save --from-message <id> --name <name> --description "<text>" | 将人员发送的密钥(从标准输入读取)保存到他们自己的保险库。消息中保留一个引用 |
laze connect suggest <service> --reason "<why>" | 发布卡片,要求人员连接服务 |
laze connect list | 此回合可以使用的连接 |
laze vault scrub [--dry-run] 将在消息中找到的密钥移至保险库中。该命令供管理员使用。
| 命令 | 作用 |
|---|
laze computer status [--json] | 正在使用的规格、CPU、内存和磁盘,每个智能体的份额以及最近的内存停止记录 |
laze computer sizes | 规格及其价格,以及包含的规格 |
laze computer upgrade <size> | 更改规格。仅限所有者和管理员,其他人员将收到 computer_upgrade_forbidden |
laze computer request <size> | 向管理员申请规格 |
laze computer cancel <request> | 取消你提交的请求 |
参见智能体计算机。
| 命令 | 作用 |
|---|
laze machine connect <name> | 打印连接你的自有机器的命令 |
laze machine connect <name> --ssh <user>@<host>[:port] | 改为通过 SSH 连接机器 |
laze machine list | 你的机器(无论是否在线) |
laze machine health <machine> | 它的系统、磁盘和工具 |
laze machine exec <machine> [--timeout <s>] -- <command> | 在其上运行命令 |
laze machine exec <machine> --vault <connection> --reason "<why>" -- <command> | 相同,带有保险库连接 |
laze machine host <machine> <agent> [--when-offline wait|computer] | 在你的机器上运行个人智能体 |
laze machine unhost <agent> | 重新在 Laze 中运行智能体 |
laze browser setup <site> [--name <name>] | 为站点设置浏览器机器 |
laze browser setup <site> --on <machine> | 改为使用你自有机器上的浏览器 |
laze browser screen|cdp|status|sleep|wake|delete <machine> | 打开它的屏幕,获取其 CDP 地址,或对其进行管理 |
laze whatsapp chats|read|send <machine> ... | 通过你自有机器使用 WhatsApp。每次发送均需等待你批准 |
| 命令 | 作用 |
|---|
laze mcp | 作为标准输入输出上的 MCP 服务器的 CLI |
laze mcp gateway | 你的智能体计算机内部通过标准输入输出连接的工作区工具 |
| 代码 | 含义 |
|---|
| 0 | 成功 |
| 1 | 用法错误或来自服务器的错误 |
| 2 | 未知命令。将打印帮助信息 |
| 77 | laze vault run:使用被拒绝 |
| 75 | laze vault run:--wait 时间用完,或者服务器一直无法访问 |
| 127 | laze vault run:命令无法启动 |
| 3 | laze vault compare: 该连接保存的是另一个值 |
| 4 | laze vault compare: 没有该名称的连接 |
否则 laze vault run 将使用其运行的命令的退出代码退出。