@kyo-so/cli 0.1.0 → 0.2.0

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.
package/README.ja.md ADDED
@@ -0,0 +1,289 @@
1
+ # Kyo-so
2
+
3
+ [English](README.md) | [日本語](README.ja.md) | [简体中文](README.zh-CN.md)
4
+
5
+ この翻訳は英語版より古い場合があります。最新の情報は英語版 README を参照してください。
6
+
7
+ Kyo-so (Kyoso / 協奏) は、AI coding workflow 向けの MCP-native、ACP-powered な multi-agent review gate です。
8
+
9
+ 「協奏」という名前には、複数の独立した奏者がそれぞれの役割を保ちながら、ひとつの成果をつくるという意味を込めています。
10
+
11
+ Kyo-so は Codex と Claude の reviewer を連携させ、次のレビューを行います。
12
+
13
+ - implementation plan review
14
+ - CISA Secure by Design gate による security review
15
+ - 実装後の diff review
16
+
17
+ Kyoso はコード変更を適用しません。
18
+
19
+ ## Quick Start
20
+
21
+ グローバルインストールは不要です。Kyoso は `npx` または `bunx` で実行します。
22
+
23
+ ### Claude Code
24
+
25
+ 1. Claude 認証を準備します。
26
+
27
+ ```bash
28
+ claude setup-token
29
+ ```
30
+
31
+ このコマンドで得た `CLAUDE_CODE_OAUTH_TOKEN` を設定するか、直接 API 課金を使う場合は `ANTHROPIC_API_KEY` を設定します。
32
+
33
+ 2. MCP を登録し、review skill をインストールします。
34
+
35
+ ```bash
36
+ npx @kyo-so/cli setup claude-code --write
37
+ bunx @kyo-so/cli setup claude-code --write
38
+ ```
39
+
40
+ 3. セットアップを確認します。
41
+
42
+ ```bash
43
+ npx @kyo-so/cli doctor
44
+ bunx @kyo-so/cli doctor
45
+ ```
46
+
47
+ 4. Claude Code からレビューを依頼します。
48
+
49
+ ```text
50
+ Use Kyoso plan_review on this plan before implementation.
51
+ ```
52
+
53
+ ### Codex
54
+
55
+ 1. Codex 認証を準備します。
56
+
57
+ ```bash
58
+ codex login
59
+ ```
60
+
61
+ 2. MCP を登録し、review skill をインストールします。
62
+
63
+ ```bash
64
+ npx @kyo-so/cli setup codex --write
65
+ bunx @kyo-so/cli setup codex --write
66
+ ```
67
+
68
+ 3. セットアップを確認します。
69
+
70
+ ```bash
71
+ npx @kyo-so/cli doctor
72
+ bunx @kyo-so/cli doctor
73
+ ```
74
+
75
+ 4. Codex からレビューを依頼します。
76
+
77
+ ```text
78
+ Use Kyoso diff_review on the current diff. I need a second opinion before merging.
79
+ ```
80
+
81
+ 手動セットアップ用の例は `examples/codex-config.toml` と `examples/claude-code-mcp.json` にあります。
82
+
83
+ ## Install / Run
84
+
85
+ ```bash
86
+ npx @kyo-so/cli mcp
87
+ bunx @kyo-so/cli mcp
88
+ ```
89
+
90
+ Naming note: npm パッケージは `@kyo-so/cli` (製品名 Kyo-so に対応) で、インストールされる CLI コマンドは短い `kyoso` です。
91
+
92
+ ローカル開発:
93
+
94
+ ```bash
95
+ safe-chain bun install
96
+ safe-chain bun run typecheck
97
+ safe-chain bun test
98
+ safe-chain bun run build
99
+ ```
100
+
101
+ パッケージ化された CLI を実行するには Node.js 20 以降が必要です。
102
+
103
+ 既知の配布リスク: `@modelcontextprotocol/server` にはまだ stable release がありません。Kyoso は現在 prerelease API を pin しているため、MCP SDK API の変更に追従する follow-up release が必要になる場合があります。
104
+
105
+ ## CLI
106
+
107
+ 通常の実行経路は `npx @kyo-so/cli` と `bunx @kyo-so/cli` です。以下の例では、この prefix を `kyoso` と省略しています。
108
+
109
+ ```bash
110
+ kyoso plan --goal "Review this OAuth callback plan" --plan plan.md
111
+ kyoso security --goal "Review this auth diff" --diff changes.patch
112
+ kyoso diff --base main --head HEAD
113
+ kyoso doctor
114
+ kyoso init
115
+ kyoso setup codex
116
+ kyoso setup claude-code
117
+ ```
118
+
119
+ ## Usage Examples
120
+
121
+ 選択したコードと一緒に implementation plan をレビューします。
122
+
123
+ ```bash
124
+ kyoso plan \
125
+ --goal "Review the OAuth callback implementation plan" \
126
+ --plan plan.md \
127
+ --file src/auth/callback.ts
128
+ ```
129
+
130
+ 結果は上から順に読んでください。`Decision` は deterministic gate の結果、`Findings` は必要な変更、`Tests to Add` は承認前に Kyoso が期待する regression checks です。
131
+
132
+ patch に対して CISA Secure by Design security review を実行します。
133
+
134
+ ```bash
135
+ kyoso security \
136
+ --goal "Review auth changes for tenant isolation and secure defaults" \
137
+ --diff changes.patch \
138
+ --json
139
+ ```
140
+
141
+ JSON output では、`cisaSecureByDesign` に 4 つの gate dimensions が表示されます。customer security outcomes の `fail` は review を block します。warning-level dimensions は通常 `approve_with_changes` になります。
142
+
143
+ Kyoso を Codex または Claude Code の MCP server として登録し、client から `plan_review` を呼び出します。
144
+
145
+ ```toml
146
+ # See examples/codex-config.toml
147
+ [mcp_servers.kyoso]
148
+ command = "npx"
149
+ args = ["-y", "@kyo-so/cli", "mcp", "--network", "model_only"]
150
+ ```
151
+
152
+ client request の例:
153
+
154
+ ```text
155
+ Use Kyoso plan_review on this plan and the selected auth files. I need a second opinion before implementing.
156
+ ```
157
+
158
+ ## MCP
159
+
160
+ ```bash
161
+ npx @kyo-so/cli mcp --network model_only
162
+ bunx @kyo-so/cli mcp --network model_only
163
+ ```
164
+
165
+ `--network` を省略すると、Kyoso は `model_only` を使用します。これは Kyoso が backend agents からの通信を model-provider traffic のみにすることを期待する policy-level constraint です。OS-level network isolation ではありません。
166
+
167
+ Kyoso が公開する MCP tools は次の 3 つだけです。
168
+
169
+ - `plan_review`
170
+ - `security_review`
171
+ - `diff_review`
172
+
173
+ MCP stdout は protocol messages 専用です。logs は stderr または local audit traces に出力されます。
174
+
175
+ ## Skill
176
+
177
+ 同梱の `kyoso-review` skill は意図的に狭い用途にしています。Kyoso、multi-agent review、plan review、security review、CISA Secure by Design review、diff review を明示的に依頼したときだけ trigger されるべきです。
178
+
179
+ `npx @kyo-so/cli setup codex --write` と `bunx @kyo-so/cli setup codex --write` は、既定で `.agents/skills/kyoso-review/` にコピーします。`--global` を追加すると `~/.agents/skills/kyoso-review/` にコピーします。
180
+
181
+ `npx @kyo-so/cli setup claude-code --write` と `bunx @kyo-so/cli setup claude-code --write` は、既定で `.claude/skills/kyoso-review/` にコピーします。`--global` を追加すると `~/.claude/skills/kyoso-review/` にコピーします。
182
+
183
+ ## Safety Model
184
+
185
+ Kyoso MVP は disposable temporary snapshot と policy-level write denial を使用します。完全な OS sandbox ではありません。リスクを理解していない場合、untrusted repositories に対して Kyoso を実行しないでください。
186
+
187
+ Secret detection は best-effort です。Kyoso は request、selected files、diff 内で secret らしき値を検出すると、その値を redact し、既定では backend agents の実行前に block します。
188
+
189
+ Kyoso は provider credentials を保存しません。Child agent environment variables は allowlist されます。
190
+
191
+ Repository content、plans、diffs、selected files は backend prompts 内で untrusted data として扱われます。Kyoso はそれらを `<untrusted-content>` tags で包み、その中にある instructions に従わないよう agents に指示します。最終判断は schema-constrained findings から導出されます。agents は files の書き込みや commands の実行ができず、judge は deterministic decision を変更できません。
192
+
193
+ ## Agent Auth
194
+
195
+ Codex は利用可能な場合、local `codex` login を使用します。既定の subscription-backed path では API key は不要です。
196
+
197
+ Claude は 2 つの auth paths をサポートします。
198
+
199
+ - `ANTHROPIC_API_KEY`: direct Anthropic API billing
200
+ - `CLAUDE_CODE_OAUTH_TOKEN`: `claude setup-token` から得る subscription auth
201
+
202
+ Claude credentials が両方設定されている場合、Kyoso は既定で `CLAUDE_CODE_OAUTH_TOKEN` だけを Claude child agent に forward します。`ANTHROPIC_API_KEY` だけを forward するには、`agents.claude.auth.preferApiKey: true` を設定してください。
203
+
204
+ Default child-agent env allowlist:
205
+
206
+ | Agent | Provider env |
207
+ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
208
+ | Codex | `CODEX_API_KEY`, `OPENAI_API_KEY`, `CODEX_HOME`, `CODEX_ACCESS_TOKEN` |
209
+ | Claude | `ANTHROPIC_API_KEY`, `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_MODEL`, `ANTHROPIC_BASE_URL`, `CLAUDE_CONFIG_DIR`, `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY` |
210
+
211
+ Kyoso は subprocesses の起動に必要な最小限の runtime env も forward します: `PATH`, `HOME`, `TMPDIR`, `TEMP`, `TMP`, `LANG`, `LC_ALL`, `SHELL`, `USER`, `USERNAME`, `SystemRoot`。
212
+
213
+ ## Agent Models
214
+
215
+ `agents.<name>.model` を省略すると、各 agent 独自の default を使用します。Codex は `~/.codex/config.toml` などの local Codex config を使用し、Claude は adapter default を使用します。
216
+
217
+ ```ts
218
+ export default defineConfig({
219
+ agents: {
220
+ codex: {
221
+ model: "gpt-5.5",
222
+ },
223
+ claude: {
224
+ model: "claude-sonnet-5",
225
+ },
226
+ },
227
+ });
228
+ ```
229
+
230
+ Kyoso は model pins を adapter-supported configuration に mapping します。
231
+
232
+ - Claude: `agents.claude.env` または whitelisted parent env で未設定の場合に `ANTHROPIC_MODEL` を設定します。
233
+ - Codex: `CODEX_CONFIG` が未設定の場合、`CODEX_CONFIG={"model":"..."}` を設定します。model pin と他の Codex session config を組み合わせるには、`agents.codex.env.CODEX_CONFIG` を直接設定してください。
234
+
235
+ ## Audit
236
+
237
+ Audit traces は次の場所に書き込まれます。
238
+
239
+ ```text
240
+ .kyoso/traces/<yyyy-mm-dd>/<traceId>.jsonl
241
+ ```
242
+
243
+ Raw agent output と raw file contents は既定で無効です。
244
+
245
+ `.kyoso/traces/` を Git に含めないでください。`kyoso init` は `.kyoso/` を `.gitignore` に追加し、この repository も同じ設定にしています。`audit.includeRawAgentOutput` を有効にすると、traces に sensitive review output が残る場合があります。local retention policy に従って古い traces を定期的に削除してください。
246
+
247
+ ## Config
248
+
249
+ `kyoso.config.ts` は trust-on-first-use approval の後にのみ load されます。Trusted hashes は `~/.kyoso/trusted-configs.json` に保存されます。
250
+
251
+ TypeScript config files は任意の code を実行できます。TTY では、untrusted config を実行する前に Kyoso が確認します。MCP や CI のような non-interactive mode では、untrusted config は skip され、defaults が使われます。現在の config hash を明示的に trust するには `--trust-config` を渡し、常に defaults を使うには `--ignore-config` を渡してください。
252
+
253
+ Default agent timeouts は Codex 120 秒、Claude 240 秒です。MCP clients は tool calls に少なくとも 360 秒を許可してください。
254
+
255
+ Judge LLMs は optional です。OpenAI judge を使うには `OPENAI_API_KEY` または `CODEX_API_KEY` を設定し、Anthropic judge を使うには `ANTHROPIC_API_KEY` を設定します。Optional overrides:
256
+
257
+ - `OPENAI_BASE_URL`: OpenAI-compatible API base URL
258
+ - `KYOSO_OPENAI_JUDGE_MODEL`: OpenAI judge model, default `gpt-5.4-mini`
259
+ - `KYOSO_ANTHROPIC_JUDGE_MODEL`: Anthropic judge model, default `claude-haiku-4-5`
260
+
261
+ Judge defaults は意図的に lightweight models を使用します。より強い judge を使う場合は、`KYOSO_ANTHROPIC_JUDGE_MODEL` に `claude-sonnet-5` のような Sonnet-class model を設定してください。
262
+
263
+ Subscription-only setup:
264
+
265
+ - Codex: local `codex` login を使用
266
+ - Claude: `claude setup-token` を実行し、`CLAUDE_CODE_OAUTH_TOKEN` を設定
267
+ - Judge: API keys を設定しないことで、Kyoso は `deterministic_fallback` を使用
268
+ - `OPENAI_API_KEY` が存在するときに OpenAI judge calls を避けるには、`judgeProvider: "none"` を設定
269
+
270
+ Team admins は organization Usage credits も確認してください。Credits が有効な場合、subscription limits を超える billing behavior は Kyoso の外側で制御されます。
271
+
272
+ ## Troubleshooting
273
+
274
+ - MCP timeout: client tool timeouts を少なくとも 360 秒に設定してください。Kyoso defaults は Codex 120 秒、Claude 240 秒です。
275
+ - Fresh npm release: safe-chain などの minimum-package-age protection により、publish 直後は `npx @kyo-so/cli` の解決が一時的に block される場合があります。
276
+ - Non-interactive config: `--trust-config` を渡さない限り、untrusted `kyoso.config.ts` は skip されます。
277
+
278
+ ## Development
279
+
280
+ - `KYOSO_TEST_FAKE_AGENTS=1`: test-only fake ACP agents; production では設定しないでください。
281
+ - `KYOSO_KEEP_TEMP=1`: local debugging 用に temporary snapshots を保持します。
282
+
283
+ ## License
284
+
285
+ Kyoso は GNU Affero General Public License v3.0 or later (`AGPL-3.0-or-later`) で licensed されています。
286
+
287
+ Kyoso は separate CLI または MCP server process として使うことを想定しています。Kyoso を他の program に embedding、importing、linking する場合、license implications が異なる可能性があります。
288
+
289
+ Copyright (C) 2026 Hokuto TAKEMIYA (hokupod).
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Kyo-so
2
2
 
3
+ [English](README.md) | [日本語](README.ja.md) | [简体中文](README.zh-CN.md)
4
+
3
5
  Kyo-so (Kyoso / 協奏) is an MCP-native, ACP-powered multi-agent review gate for AI coding workflows.
4
6
 
5
7
  The Japanese word 協奏 translates to concerto in English: multiple independent players performing one coordinated piece.
@@ -12,11 +14,75 @@ It coordinates Codex and Claude reviewers for:
12
14
 
13
15
  Kyoso does not apply code changes.
14
16
 
15
- ## Install
17
+ ## Quick Start
18
+
19
+ No global install is required. Run Kyoso through `npx` or `bunx`.
20
+
21
+ ### Claude Code
22
+
23
+ 1. Prepare Claude authentication.
24
+
25
+ ```bash
26
+ claude setup-token
27
+ ```
28
+
29
+ Set `CLAUDE_CODE_OAUTH_TOKEN` from that command, or set `ANTHROPIC_API_KEY` for direct API billing.
30
+
31
+ 2. Register MCP and install the review skill.
32
+
33
+ ```bash
34
+ npx @kyo-so/cli setup claude-code --write
35
+ bunx @kyo-so/cli setup claude-code --write
36
+ ```
37
+
38
+ 3. Verify the setup.
39
+
40
+ ```bash
41
+ npx @kyo-so/cli doctor
42
+ bunx @kyo-so/cli doctor
43
+ ```
44
+
45
+ 4. Ask for a review from Claude Code.
46
+
47
+ ```text
48
+ Use Kyoso plan_review on this plan before implementation.
49
+ ```
50
+
51
+ ### Codex
52
+
53
+ 1. Prepare Codex authentication.
54
+
55
+ ```bash
56
+ codex login
57
+ ```
58
+
59
+ 2. Register MCP and install the review skill.
60
+
61
+ ```bash
62
+ npx @kyo-so/cli setup codex --write
63
+ bunx @kyo-so/cli setup codex --write
64
+ ```
65
+
66
+ 3. Verify the setup.
67
+
68
+ ```bash
69
+ npx @kyo-so/cli doctor
70
+ bunx @kyo-so/cli doctor
71
+ ```
72
+
73
+ 4. Ask for a review from Codex.
74
+
75
+ ```text
76
+ Use Kyoso diff_review on the current diff. I need a second opinion before merging.
77
+ ```
78
+
79
+ Manual setup examples are kept in `examples/codex-config.toml` and `examples/claude-code-mcp.json`.
80
+
81
+ ## Install / Run
16
82
 
17
83
  ```bash
18
- bunx @kyo-so/cli mcp
19
84
  npx @kyo-so/cli mcp
85
+ bunx @kyo-so/cli mcp
20
86
  ```
21
87
 
22
88
  Naming note: the npm package is `@kyo-so/cli` (matching the product name Kyo-so), while the installed CLI command is the shorter `kyoso`.
@@ -36,12 +102,16 @@ Known distribution risk: `@modelcontextprotocol/server` has no stable release ye
36
102
 
37
103
  ## CLI
38
104
 
105
+ `npx @kyo-so/cli` and `bunx @kyo-so/cli` are the normal execution paths. The examples below abbreviate that prefix as `kyoso`.
106
+
39
107
  ```bash
40
108
  kyoso plan --goal "Review this OAuth callback plan" --plan plan.md
41
109
  kyoso security --goal "Review this auth diff" --diff changes.patch
42
110
  kyoso diff --base main --head HEAD
43
111
  kyoso doctor
44
112
  kyoso init
113
+ kyoso setup codex
114
+ kyoso setup claude-code
45
115
  ```
46
116
 
47
117
  ## Usage Examples
@@ -73,8 +143,8 @@ Register Kyoso with Codex or Claude Code as an MCP server, then call `plan_revie
73
143
  ```toml
74
144
  # See examples/codex-config.toml
75
145
  [mcp_servers.kyoso]
76
- command = "kyoso"
77
- args = ["mcp", "--network", "model_only"]
146
+ command = "npx"
147
+ args = ["-y", "@kyo-so/cli", "mcp", "--network", "model_only"]
78
148
  ```
79
149
 
80
150
  Example client request:
@@ -86,7 +156,8 @@ Use Kyoso plan_review on this plan and the selected auth files. I need a second
86
156
  ## MCP
87
157
 
88
158
  ```bash
89
- kyoso mcp --network model_only
159
+ npx @kyo-so/cli mcp --network model_only
160
+ bunx @kyo-so/cli mcp --network model_only
90
161
  ```
91
162
 
92
163
  When `--network` is omitted, Kyoso uses `model_only`. This means Kyoso expects only model-provider traffic from backend agents. It is a policy-level constraint, not OS-level network isolation.
@@ -99,6 +170,14 @@ Kyoso exposes exactly these MCP tools:
99
170
 
100
171
  MCP stdout is reserved for protocol messages. Logs go to stderr or local audit traces.
101
172
 
173
+ ## Skill
174
+
175
+ The bundled `kyoso-review` skill is intentionally narrow. It should trigger only when you explicitly ask for Kyoso, multi-agent review, plan review, security review, CISA Secure by Design review, or diff review.
176
+
177
+ `npx @kyo-so/cli setup codex --write` and `bunx @kyo-so/cli setup codex --write` copy it to `.agents/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.agents/skills/kyoso-review/`.
178
+
179
+ `npx @kyo-so/cli setup claude-code --write` and `bunx @kyo-so/cli setup claude-code --write` copy it to `.claude/skills/kyoso-review/` by default. Add `--global` to copy it to `~/.claude/skills/kyoso-review/`.
180
+
102
181
  ## Safety Model
103
182
 
104
183
  Kyoso MVP uses a disposable temporary snapshot and policy-level write denial. It is not a full OS sandbox. Do not run Kyoso against untrusted repositories unless you understand the risk.
@@ -188,6 +267,12 @@ Subscription-only setup:
188
267
 
189
268
  Team admins should also check organization Usage credits. If credits are enabled, billing behavior beyond subscription limits is controlled outside Kyoso.
190
269
 
270
+ ## Troubleshooting
271
+
272
+ - MCP timeout: set client tool timeouts to at least 360 seconds. Kyoso defaults are Codex 120 seconds and Claude 240 seconds.
273
+ - Fresh npm release: minimum-package-age protection in tools such as safe-chain may briefly block `npx @kyo-so/cli` resolution after publish.
274
+ - Non-interactive config: untrusted `kyoso.config.ts` is skipped unless you pass `--trust-config`.
275
+
191
276
  ## Development
192
277
 
193
278
  - `KYOSO_TEST_FAKE_AGENTS=1`: test-only fake ACP agents; do not set in production.