Skip to content

Commit a38c657

Browse files
committed
📝 docs(guide): add CLI reference section to user manual
via [HAPI](https://hapi.run)
1 parent 63c86ff commit a38c657

2 files changed

Lines changed: 344 additions & 0 deletions

File tree

docs/guide/user-manual.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,3 +1207,175 @@ Oversight provides 53 tools that agents can use during execution. Tools are orga
12071207
| Tool | Description |
12081208
|------|-------------|
12091209
| `parse_document` | Parse a Markdown file into structured sections by heading hierarchy |
1210+
1211+
---
1212+
1213+
## 11. Command-Line Reference
1214+
1215+
For users who prefer the terminal, Oversight ships a comprehensive `oversight` CLI that mirrors most of what the web UI offers. Install once, then manage projects, tasks, workflows, agents, and knowledge from your shell — pipe-friendly output, scriptable, SSH-safe.
1216+
1217+
### Getting started
1218+
1219+
Build the CLI binaries:
1220+
1221+
```bash
1222+
cargo build -p oversight-cli --release
1223+
# Binary lands at target/release/oversight
1224+
```
1225+
1226+
First-time setup:
1227+
1228+
```bash
1229+
# Log in (creates ~/.config/oversight/config.toml with your bearer token)
1230+
oversight auth login --username admin
1231+
1232+
# Pick a default project so you don't have to pass --project every time
1233+
oversight projects list
1234+
oversight projects use <project-id>
1235+
1236+
# Shell tab-completion (one-time)
1237+
oversight completion bash > /etc/bash_completion.d/oversight # or zsh / fish / powershell / elvish
1238+
```
1239+
1240+
### Global options
1241+
1242+
These flags work on every subcommand:
1243+
1244+
| Flag | Purpose |
1245+
|------|---------|
1246+
| `--profile <name>` | Switch the active config profile for this invocation |
1247+
| `--server <url>` | Override the server URL |
1248+
| `-p, --project <id>` | Override the active project |
1249+
| `-f, --format <fmt>` | Output format: `auto` (default), `table`, `json`, `yaml`, `csv`, `name` |
1250+
1251+
`auto` picks `table` when stdout is a TTY and `json` when piped — so `oversight tasks list | jq` works without extra flags.
1252+
1253+
### Subcommand overview
1254+
1255+
| Group | What it does |
1256+
|-------|--------------|
1257+
| `auth` | Log in/out, show current user |
1258+
| `config` | Manage ~/.config/oversight/config.toml + named profiles |
1259+
| `completion` | Print a shell completion script |
1260+
| `projects` | List / describe / create / set default project |
1261+
| `tasks` | All 12 task verbs: list, tree, board, describe, create, transition, comment, update, delete, assign, relate, attach |
1262+
| `workflows` | Inspect workflows and their automation rules |
1263+
| `agents` | Browse agent definitions, show stats |
1264+
| `inbox` | Clear pending tool-permission approvals; accept/reject proposed tasks |
1265+
| `cycles` | Sprints / iterations — CRUD |
1266+
| `milestones` | Release targets — CRUD |
1267+
| `schedules` | Cron-scheduled agent runs — CRUD + run-now |
1268+
| `collections` | Knowledge base containers |
1269+
| `docs` | Knowledge documents (Markdown content) |
1270+
| `search` | Cross-entity search (tasks, documents, projects) |
1271+
| `system` | Health check, global stats, agent activity log |
1272+
| `init` / `run` / `worker` | Local CLI agent integration (legacy path, unchanged) |
1273+
1274+
Run `oversight <group> --help` for detailed verbs and flags on any group.
1275+
1276+
### Common recipes
1277+
1278+
**Triage the backlog:**
1279+
1280+
```bash
1281+
oversight tasks list --status backlog --priority P0
1282+
```
1283+
1284+
**See the board:**
1285+
1286+
```bash
1287+
oversight tasks board
1288+
```
1289+
1290+
**Tree-view a feature:**
1291+
1292+
```bash
1293+
oversight tasks tree TASK-abc123
1294+
```
1295+
1296+
**Create a task, then transition it:**
1297+
1298+
```bash
1299+
oversight tasks create --title "Add password reset" --type feature
1300+
# → task-4f2e...
1301+
oversight tasks transition task-4f2e... in_progress
1302+
```
1303+
1304+
**Approve a pending tool-permission request:**
1305+
1306+
```bash
1307+
oversight inbox approvals # list pending
1308+
oversight inbox approvals approve <tool-call-id>
1309+
```
1310+
1311+
**Comment on a task via `$EDITOR`:**
1312+
1313+
```bash
1314+
oversight tasks comment task-4f2e... # opens $EDITOR for Markdown
1315+
```
1316+
1317+
**Pipe JSON to `jq` for scripting:**
1318+
1319+
```bash
1320+
oversight tasks list --format json \
1321+
| jq '.[] | select(.status == "backlog") | .id' \
1322+
| xargs -I {} oversight tasks transition {} ready
1323+
```
1324+
1325+
**Switch between environments:**
1326+
1327+
```bash
1328+
oversight config configurations create prod --server https://oversight.prod.example
1329+
oversight auth login --profile prod
1330+
oversight --profile prod tasks list # one-off override
1331+
oversight config use-profile prod # switch persistent default
1332+
```
1333+
1334+
**Search knowledge base:**
1335+
1336+
```bash
1337+
oversight search "oauth login" --types document --limit 10
1338+
```
1339+
1340+
**Monitor agent activity:**
1341+
1342+
```bash
1343+
oversight system status # server health
1344+
oversight system stats # doc / edge counts
1345+
oversight system activities --agent coder --limit 20
1346+
```
1347+
1348+
### Configuration file
1349+
1350+
The CLI config lives at:
1351+
1352+
| Platform | Path |
1353+
|----------|------|
1354+
| Linux / macOS | `~/.config/oversight/config.toml` |
1355+
| Override | `OVERSIGHT_CONFIG_HOME=/path/to/dir` |
1356+
1357+
Tokens are stored in the OS keyring (libsecret / Keychain / Credential Manager). On systems without a keyring, the CLI falls back to a `chmod 600` file beside `config.toml`.
1358+
1359+
### Full verb list
1360+
1361+
The sections below show every verb. For details run `oversight <subcommand> --help`.
1362+
1363+
- `auth`: `login`, `logout`, `whoami`
1364+
- `config`: `set`, `get`, `list`, `unset`, `use-profile`, `configurations {list,create,describe,delete}`
1365+
- `completion`: `bash`, `zsh`, `fish`, `powershell`, `elvish`
1366+
- `projects`: `list`, `describe`, `create`, `use`
1367+
- `tasks`: `list`, `tree`, `board`, `describe`, `create`, `transition`, `comment`, `update`, `delete`, `assign`, `relate`, `attach`
1368+
- `workflows`: `list`, `describe`, `rules {list}`
1369+
- `agents`: `list`, `describe`, `stats`
1370+
- `inbox approvals`: `list`, `approve`, `deny`
1371+
- `inbox proposals`: `list`, `accept`, `reject`
1372+
- `cycles`: `list`, `describe`, `create`, `update`, `delete`
1373+
- `milestones`: `list`, `describe`, `create`, `update`, `delete`
1374+
- `schedules`: `list`, `describe`, `create`, `update`, `delete`, `run-now`
1375+
- `collections`: `list`, `describe`, `create`, `delete`
1376+
- `docs`: `list`, `describe`, `show`, `create`, `delete`
1377+
- `search <query>`: `--mode lexical/semantic/hybrid`, `--types`, `--limit`
1378+
- `system`: `status`, `stats`, `activities`
1379+
- `init --agent claude|codex|hermes` (legacy CLI agent integration)
1380+
- `run <agent-type> --task T|--title T` (launch a local CLI agent on a task)
1381+
- `worker` (start a worker daemon; distributed mode)

docs/guide/user-manual.zh-CN.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,3 +1209,175 @@ Oversight 提供 53 个代理可在执行期间使用的工具。工具按类别
12091209
| 工具 | 描述 |
12101210
|------|------|
12111211
| `parse_document` | 按标题层级将 Markdown 文件解析为结构化章节 |
1212+
1213+
---
1214+
1215+
## 11. 命令行参考
1216+
1217+
对于偏好终端操作的用户,Oversight 提供了完整的 `oversight` CLI,覆盖 Web 界面提供的大部分功能。一次安装,即可在 shell 中管理项目、任务、工作流、代理和知识库 —— 输出对管道友好、可脚本化、SSH 安全。
1218+
1219+
### 快速上手
1220+
1221+
构建 CLI 二进制:
1222+
1223+
```bash
1224+
cargo build -p oversight-cli --release
1225+
# 二进制位于 target/release/oversight
1226+
```
1227+
1228+
首次配置:
1229+
1230+
```bash
1231+
# 登录(在 ~/.config/oversight/config.toml 中创建带 bearer token 的 profile)
1232+
oversight auth login --username admin
1233+
1234+
# 设置默认项目,免去后续每次都加 --project
1235+
oversight projects list
1236+
oversight projects use <project-id>
1237+
1238+
# Shell 自动补全(一次设置)
1239+
oversight completion bash > /etc/bash_completion.d/oversight # 或 zsh / fish / powershell / elvish
1240+
```
1241+
1242+
### 全局选项
1243+
1244+
以下 flag 对所有子命令均可用:
1245+
1246+
| Flag | 用途 |
1247+
|------|------|
1248+
| `--profile <name>` | 本次调用使用指定 profile |
1249+
| `--server <url>` | 覆盖服务器 URL |
1250+
| `-p, --project <id>` | 覆盖当前项目 |
1251+
| `-f, --format <fmt>` | 输出格式:`auto`(默认)、`table``json``yaml``csv``name` |
1252+
1253+
`auto` 在 stdout 是 TTY 时使用 `table`,重定向/管道时自动切换 `json` —— 因此 `oversight tasks list | jq` 不需要额外 flag。
1254+
1255+
### 子命令一览
1256+
1257+
| 命令组 | 作用 |
1258+
|--------|------|
1259+
| `auth` | 登录 / 登出 / 显示当前用户 |
1260+
| `config` | 管理 ~/.config/oversight/config.toml + 多 profile |
1261+
| `completion` | 生成 shell 补全脚本 |
1262+
| `projects` | 列出 / 查看 / 创建 / 设置默认项目 |
1263+
| `tasks` | 12 个任务动词:list/tree/board/describe/create/transition/comment/update/delete/assign/relate/attach |
1264+
| `workflows` | 查看工作流和自动化规则 |
1265+
| `agents` | 浏览代理定义、查看统计 |
1266+
| `inbox` | 处理待审批的工具权限请求;接受/拒绝提案任务 |
1267+
| `cycles` | Sprint / 迭代周期 — CRUD |
1268+
| `milestones` | 发布里程碑 — CRUD |
1269+
| `schedules` | Cron 定时代理任务 — CRUD + run-now |
1270+
| `collections` | 知识库集合 |
1271+
| `docs` | 知识文档(Markdown 内容) |
1272+
| `search` | 跨实体搜索(任务、文档、项目) |
1273+
| `system` | 健康检查、全局统计、代理活动日志 |
1274+
| `init` / `run` / `worker` | 本地 CLI 代理集成(保留的旧路径) |
1275+
1276+
通过 `oversight <group> --help` 查看任意命令组的详细动词和 flag。
1277+
1278+
### 常用配方
1279+
1280+
**整理待办:**
1281+
1282+
```bash
1283+
oversight tasks list --status backlog --priority P0
1284+
```
1285+
1286+
**查看看板:**
1287+
1288+
```bash
1289+
oversight tasks board
1290+
```
1291+
1292+
**查看功能树:**
1293+
1294+
```bash
1295+
oversight tasks tree TASK-abc123
1296+
```
1297+
1298+
**创建并推进任务:**
1299+
1300+
```bash
1301+
oversight tasks create --title "添加密码重置" --type feature
1302+
# → task-4f2e...
1303+
oversight tasks transition task-4f2e... in_progress
1304+
```
1305+
1306+
**审批待处理的工具权限请求:**
1307+
1308+
```bash
1309+
oversight inbox approvals # 列出待处理项
1310+
oversight inbox approvals approve <tool-call-id>
1311+
```
1312+
1313+
**`$EDITOR` 给任务写评论:**
1314+
1315+
```bash
1316+
oversight tasks comment task-4f2e... # 打开 $EDITOR 编辑 Markdown
1317+
```
1318+
1319+
**`jq` 处理 JSON 输出做脚本:**
1320+
1321+
```bash
1322+
oversight tasks list --format json \
1323+
| jq '.[] | select(.status == "backlog") | .id' \
1324+
| xargs -I {} oversight tasks transition {} ready
1325+
```
1326+
1327+
**在不同环境间切换:**
1328+
1329+
```bash
1330+
oversight config configurations create prod --server https://oversight.prod.example
1331+
oversight auth login --profile prod
1332+
oversight --profile prod tasks list # 一次性覆盖
1333+
oversight config use-profile prod # 持久切换默认 profile
1334+
```
1335+
1336+
**搜索知识库:**
1337+
1338+
```bash
1339+
oversight search "oauth 登录" --types document --limit 10
1340+
```
1341+
1342+
**监控代理活动:**
1343+
1344+
```bash
1345+
oversight system status # 服务器健康
1346+
oversight system stats # 文档 / 边数量
1347+
oversight system activities --agent coder --limit 20
1348+
```
1349+
1350+
### 配置文件
1351+
1352+
CLI 配置位置:
1353+
1354+
| 平台 | 路径 |
1355+
|------|------|
1356+
| Linux / macOS | `~/.config/oversight/config.toml` |
1357+
| 覆盖 | `OVERSIGHT_CONFIG_HOME=/path/to/dir` |
1358+
1359+
Token 存储在系统 keyring(libsecret / Keychain / Credential Manager)中。无 keyring 的系统上回退到与 `config.toml` 同目录的 `chmod 600` 文件。
1360+
1361+
### 完整动词列表
1362+
1363+
下面列出所有动词。详细参数请运行 `oversight <subcommand> --help`
1364+
1365+
- `auth`: `login`, `logout`, `whoami`
1366+
- `config`: `set`, `get`, `list`, `unset`, `use-profile`, `configurations {list,create,describe,delete}`
1367+
- `completion`: `bash`, `zsh`, `fish`, `powershell`, `elvish`
1368+
- `projects`: `list`, `describe`, `create`, `use`
1369+
- `tasks`: `list`, `tree`, `board`, `describe`, `create`, `transition`, `comment`, `update`, `delete`, `assign`, `relate`, `attach`
1370+
- `workflows`: `list`, `describe`, `rules {list}`
1371+
- `agents`: `list`, `describe`, `stats`
1372+
- `inbox approvals`: `list`, `approve`, `deny`
1373+
- `inbox proposals`: `list`, `accept`, `reject`
1374+
- `cycles`: `list`, `describe`, `create`, `update`, `delete`
1375+
- `milestones`: `list`, `describe`, `create`, `update`, `delete`
1376+
- `schedules`: `list`, `describe`, `create`, `update`, `delete`, `run-now`
1377+
- `collections`: `list`, `describe`, `create`, `delete`
1378+
- `docs`: `list`, `describe`, `show`, `create`, `delete`
1379+
- `search <query>`: `--mode lexical/semantic/hybrid`, `--types`, `--limit`
1380+
- `system`: `status`, `stats`, `activities`
1381+
- `init --agent claude|codex|hermes`(旧路径:本地 CLI 代理集成)
1382+
- `run <agent-type> --task T|--title T`(在任务上启动本地 CLI 代理)
1383+
- `worker`(启动 worker 守护进程,分布式模式)

0 commit comments

Comments
 (0)