@rzx/ohs 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +119 -0
  2. package/package.json +35 -15
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # @rzx/ohs
2
+
3
+ OpenHarness-ts 终端 CLI:在终端里跑 AI Agent。默认进入交互式 TUI(需 [Bun](https://bun.sh)),也可一次性打印结果后退出。会话由本机 daemon 持久化,可与 Desktop 等客户端共用同一后端。
4
+
5
+ 命令行入口:`ohs` 与 `openharness`(等价)。
6
+
7
+ ## 要求
8
+
9
+ - Node.js >= 20
10
+ - 交互式 TUI:额外安装 [Bun](https://bun.sh)
11
+ - 可选:Docker(启用 sandbox 时)
12
+
13
+ ## 安装
14
+
15
+ ```bash
16
+ npm install -g @rzx/ohs
17
+ # 或
18
+ pnpm add -g @rzx/ohs
19
+ ```
20
+
21
+ 验证:
22
+
23
+ ```bash
24
+ ohs --version
25
+ ohs doctor
26
+ ```
27
+
28
+ ## 快速开始
29
+
30
+ ```bash
31
+ # 首次配置(Provider / API Key / 模型)
32
+ ohs setup
33
+
34
+ # 或手动登录
35
+ ohs auth login <provider> <api-key>
36
+ ohs provider list
37
+ ohs provider use <name> -m <model>
38
+
39
+ # 交互式 TUI(默认;会 attach 或启动本机 daemon)
40
+ ohs
41
+
42
+ # 单次提问后退出
43
+ ohs "explain this codebase"
44
+ ohs -p "explain this codebase"
45
+
46
+ # 只检查配置,不调模型
47
+ ohs --dry-run
48
+ ```
49
+
50
+ 用户配置与数据默认在 `~/.openharness-ts/`(例如 `settings.json`、daemon registry、会话库)。
51
+
52
+ ## 常用用法
53
+
54
+ ```bash
55
+ ohs -m <model> "你的问题"
56
+ ohs --provider <name> --permission-mode full_auto "重构这段代码"
57
+ ohs --cwd /path/to/project
58
+ ohs --tui "带初始提示打开 TUI"
59
+ ```
60
+
61
+ ### 主要选项
62
+
63
+
64
+ | 选项 | 说明 |
65
+ | --------------------------------- | ---------------------------------- |
66
+ | `-p, --print` | 经 daemon 打印结果后退出(有 prompt 时默认即此模式) |
67
+ | `--tui` | 显式启动 TUI(无 prompt 时默认已是 TUI) |
68
+ | `-m, --model` | 模型名 |
69
+ | `--provider` | 强制指定 Provider |
70
+ | `--permission-mode` | `default` | `plan` | `full_auto` |
71
+ | `--max-turns` | 最大 agent 轮次 |
72
+ | `--effort` | `low` | `medium` | `high` |
73
+ | `--no-plugins` | 本次会话不加载已安装插件贡献 |
74
+ | `--dangerously-skip-permissions` | 跳过权限确认 |
75
+ | `--dry-run` | 预览解析后的配置,不调模型 |
76
+ | `--daemon-url` / `--daemon-token` | 连接到指定 daemon,而不是本机自动启动 |
77
+
78
+
79
+ 完整参数见 `ohs --help`。
80
+
81
+ ## 常用子命令
82
+
83
+ ```bash
84
+ ohs setup
85
+ ohs doctor
86
+ ohs auth login <provider> <api-key>
87
+ ohs auth status
88
+ ohs provider list|use|add|edit|remove
89
+ ohs mcp list|add|remove
90
+ ohs plugin list|install|uninstall|enable|disable
91
+ ohs sandbox on|off|status|doctor
92
+ ohs daemon start|status|stop|install|uninstall
93
+ ohs config show
94
+ ohs config set <key> <value>
95
+ ohs workflow list|status|validate|template|reconcile|cancel
96
+ ohs channels status|serve
97
+ ```
98
+
99
+ 开启登录后自动拉起 daemon(可选):
100
+
101
+ ```bash
102
+ ohs daemon install
103
+ # 或
104
+ ohs config set daemon.autoStart true
105
+ ```
106
+
107
+ ## 说明
108
+
109
+ - **TUI** 需要 Bun;没有 Bun 时可用 `-p` / 带 prompt 的 print 模式。
110
+ - 默认会连接已有本机 daemon;没有可用进程时会按需启动。Desktop 等客户端也可连同一 daemon,共享会话状态。
111
+ - 原生依赖含 `sharp`、`better-sqlite3`、`node-pty`;全局安装时会由 npm/pnpm 一并安装对应平台包。
112
+
113
+ ## 文档与源码
114
+
115
+ - 源码仓库:[https://github.com/rzx007/openharness-ts](https://github.com/rzx007/openharness-ts)
116
+ - 项目文档:[https://github.com/rzx007/openharness-ts/tree/main/docs](https://github.com/rzx007/openharness-ts/tree/main/docs)
117
+ - 问题反馈:[https://github.com/rzx007/openharness-ts/issues](https://github.com/rzx007/openharness-ts/issues)
118
+
119
+ 本地从源码开发请看仓库根目录 `README.md`。
package/package.json CHANGED
@@ -1,15 +1,35 @@
1
1
  {
2
2
  "name": "@rzx/ohs",
3
- "version": "0.1.0",
4
- "description": "OpenHarness terminal CLI",
3
+ "version": "0.1.1",
4
+ "description": "OpenHarness terminal CLI — interactive TUI and headless agent for your codebase",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "ohs": "./dist/index.js",
8
8
  "openharness": "./dist/index.js"
9
9
  },
10
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "README.md"
12
13
  ],
14
+ "keywords": [
15
+ "openharness",
16
+ "cli",
17
+ "ai",
18
+ "agent",
19
+ "tui",
20
+ "llm",
21
+ "coding-agent"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/rzx007/openharness-ts.git",
26
+ "directory": "apps/cli"
27
+ },
28
+ "homepage": "https://github.com/rzx007/openharness-ts/tree/main/apps/cli",
29
+ "bugs": {
30
+ "url": "https://github.com/rzx007/openharness-ts/issues"
31
+ },
32
+ "license": "MIT",
13
33
  "publishConfig": {
14
34
  "access": "public"
15
35
  },
@@ -33,28 +53,28 @@
33
53
  "tsx": "^4.21.0",
34
54
  "typescript": "^5.7.3",
35
55
  "vitest": "^3.1.1",
36
- "@openharness/channels": "0.1.0",
56
+ "@openharness/agent-runtime": "0.1.0",
37
57
  "@openharness/auth": "0.1.0",
38
58
  "@openharness/client": "0.1.0",
39
- "@openharness/commands": "0.1.0",
40
- "@openharness/api": "0.1.0",
41
- "@openharness/agent-runtime": "0.1.0",
42
59
  "@openharness/coordinator": "0.1.0",
43
- "@openharness/mcp": "0.1.0",
44
- "@openharness/hooks": "0.1.0",
45
- "@openharness/memory": "0.1.0",
60
+ "@openharness/channels": "0.1.0",
46
61
  "@openharness/core": "0.1.0",
47
- "@openharness/permissions": "0.1.0",
48
- "@openharness/plugins": "0.1.0",
62
+ "@openharness/api": "0.1.0",
63
+ "@openharness/hooks": "0.1.0",
64
+ "@openharness/commands": "0.1.0",
49
65
  "@openharness/output-styles": "0.1.0",
66
+ "@openharness/plugins": "0.1.0",
67
+ "@openharness/mcp": "0.1.0",
68
+ "@openharness/memory": "0.1.0",
69
+ "@openharness/plugin-converters": "0.1.0",
50
70
  "@openharness/personalization": "0.1.0",
51
71
  "@openharness/prompts": "0.1.0",
52
- "@openharness/server": "0.1.0",
53
- "@openharness/plugin-converters": "0.1.0",
54
- "@openharness/services": "0.1.0",
55
72
  "@openharness/sandbox": "0.1.0",
56
73
  "@openharness/skills": "0.1.0",
57
74
  "@openharness/themes": "0.1.0",
75
+ "@openharness/server": "0.1.0",
76
+ "@openharness/permissions": "0.1.0",
77
+ "@openharness/services": "0.1.0",
58
78
  "@openharness/tools": "0.1.0"
59
79
  },
60
80
  "scripts": {