# 命令

> nsq 的全部命令——启动、列出、附加、发送、回答、停止、移除、花费、OpenRouter、手机、语音输入、守护进程和 doctor。

Source: https://docs.neurosquad.ai/zh/cli/commands

`nsq help` 会在终端里打印这份列表。指定智能体时使用 `nsq ls` 中显示的名称或 id。

## 智能体

| 命令 | 作用 |
| --- | --- |
| `nsq` | 仪表盘（会启动守护进程） |
| `nsq run <claude\|codex\|opencode> [prompt]` | 在当前文件夹启动一个智能体 |
| `nsq run [--name n] -- <command…>` | 把任意命令作为智能体运行 |
| `nsq ls [--json]` | 智能体、状态、待回答的问题、花费和分支 |
| `nsq attach <agent>` | 在当前终端全屏打开智能体；`Ctrl ]` 断开 |
| `nsq send <agent> "prompt" [--when-done]` | 立即发送提示词，或在当前回合结束后发送 |
| `nsq answer <agent> yes\|always\|no` | 回答权限请求 |
| `nsq interrupt <agent>` | 中断当前回合（使用该 CLI 期望的按键） |
| `nsq stop` / `start` / `restart <agent>` | 停止、启动或重启进程；start 和 restart 会继续原会话 |
| `nsq rm <agent> [--worktree]` | 移除智能体（加 `--worktree` 时同时删除其 worktree） |
| `nsq set <agent> [--dangerous on\|off] [--model id\|none] [--provider openrouter\|none]` | 修改智能体 |
| `nsq diff <agent>` | 智能体所在文件夹的 git diff |
| `nsq peek <agent> [-n 20]` | 它屏幕上的最后几行 |
| `nsq cost [--since 7d] [--json]` | 每个智能体的花费 |

`nsq run` 的选项：

| 选项 | |
| --- | --- |
| `--name <name>` | 智能体名称（默认取 CLI 或命令的名称，并保证唯一） |
| `--worktree` | 独立的 git 分支和检出目录——见 [worktree](https://docs.neurosquad.ai/zh/cli/worktrees) |
| `--model <id>` | 使用的模型 |
| `--provider openrouter` | 通过 [OpenRouter](https://docs.neurosquad.ai/zh/cli/openrouter) 运行 |
| `--dangerous` | 替你批准智能体的权限请求 |
| `--attach` | 立即全屏打开 |

## 其他命令

| 命令 | 作用 |
| --- | --- |
| `nsq openrouter set-key \| clear-key \| models [query] \| status` | [OpenRouter](https://docs.neurosquad.ai/zh/cli/openrouter) |
| `nsq phone on [--lan] \| off \| pair \| rotate \| status` | [手机访问](https://docs.neurosquad.ai/zh/cli/phone)（实验性） |
| `nsq dictation setup \| status \| test <file.wav> [--model id]` | [语音输入](https://docs.neurosquad.ai/zh/cli/dictation) |
| `nsq login` · `logout` · `whoami` | 可选的 NeuroSquad 账号——nsq 的任何功能都不需要它 |
| `nsq up` · `nsq down` | 启动或停止守护进程。`down` 会停止智能体；`up` 会恢复之前在运行的智能体并继续其会话 |
| `nsq doctor` | 检查智能体 CLI、`curl`、终端模块、OpenRouter 密钥和终端 |
| `nsq --version` | 版本号 |

## 花费

`nsq cost` 和 `nsq ls` 中的花费列读取自各个 CLI 自己的会话日志：token 数是整数；nsq 没有价格信息的模型显示为 **no price**（无价格）——绝不会显示为 $0。
