triflux 10.13.3 → 10.13.6

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 (84) hide show
  1. package/CLAUDE.md +161 -0
  2. package/hud/constants.mjs +3 -5
  3. package/hud/providers/claude.mjs +9 -5
  4. package/hud/providers/codex.mjs +3 -1
  5. package/hud/utils.mjs +3 -1
  6. package/package.json +21 -64
  7. package/references/cli-parameter-reference.md +240 -0
  8. package/references/codex-plugin-cc-analysis.md +706 -0
  9. package/references/codex-plugin-cc-code-patterns.md +468 -0
  10. package/references/hosts.json +46 -0
  11. package/scripts/tfx-route.sh +27 -0
  12. package/skills/tfx-workspace/async-tests/run-tests.sh +203 -0
  13. package/skills/tfx-workspace/evals/evals.json +79 -0
  14. package/skills/tfx-workspace/iteration-1/benchmark.json +524 -0
  15. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/eval_metadata.json +11 -0
  16. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/grading.json +25 -0
  17. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/outputs/analysis.md +154 -0
  18. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/timing.json +5 -0
  19. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/grading.json +25 -0
  20. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/outputs/analysis.md +126 -0
  21. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/timing.json +5 -0
  22. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/eval_metadata.json +11 -0
  23. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/grading.json +25 -0
  24. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/outputs/analysis.md +119 -0
  25. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/timing.json +5 -0
  26. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/grading.json +25 -0
  27. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/outputs/analysis.md +115 -0
  28. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/timing.json +5 -0
  29. package/skills/tfx-workspace/iteration-1/hub-start-sequence/eval_metadata.json +10 -0
  30. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/grading.json +20 -0
  31. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/outputs/analysis.md +86 -0
  32. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/timing.json +5 -0
  33. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/grading.json +20 -0
  34. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/outputs/analysis.md +81 -0
  35. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/timing.json +5 -0
  36. package/skills/tfx-workspace/iteration-1/multi-team-creation/eval_metadata.json +12 -0
  37. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/grading.json +30 -0
  38. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/outputs/analysis.md +316 -0
  39. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/timing.json +5 -0
  40. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/grading.json +30 -0
  41. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/outputs/analysis.md +352 -0
  42. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/timing.json +5 -0
  43. package/skills/tfx-workspace/iteration-1/review.html +1325 -0
  44. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/eval_metadata.json +12 -0
  45. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/grading.json +30 -0
  46. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/outputs/analysis.md +97 -0
  47. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/timing.json +5 -0
  48. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/grading.json +30 -0
  49. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/outputs/analysis.md +94 -0
  50. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/timing.json +5 -0
  51. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/eval_metadata.json +12 -0
  52. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/grading.json +30 -0
  53. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/outputs/analysis.md +209 -0
  54. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/timing.json +5 -0
  55. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/grading.json +30 -0
  56. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/outputs/analysis.md +193 -0
  57. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/timing.json +5 -0
  58. package/skills/tfx-workspace/iteration-2/benchmark.json +144 -0
  59. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/eval_metadata.json +13 -0
  60. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/grading.json +35 -0
  61. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/outputs/analysis.md +382 -0
  62. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/timing.json +5 -0
  63. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/grading.json +35 -0
  64. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/outputs/analysis.md +333 -0
  65. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/timing.json +5 -0
  66. package/skills/tfx-workspace/iteration-2/review.html +1325 -0
  67. package/skills/tfx-workspace/skill-snapshot/tfx-auto/SKILL.md +217 -0
  68. package/skills/tfx-workspace/skill-snapshot/tfx-auto-codex/SKILL.md +77 -0
  69. package/skills/tfx-workspace/skill-snapshot/tfx-codex/SKILL.md +65 -0
  70. package/skills/tfx-workspace/skill-snapshot/tfx-doctor/SKILL.md +94 -0
  71. package/skills/tfx-workspace/skill-snapshot/tfx-gemini/SKILL.md +82 -0
  72. package/skills/tfx-workspace/skill-snapshot/tfx-hub/SKILL.md +133 -0
  73. package/skills/tfx-workspace/skill-snapshot/tfx-multi/SKILL.md +426 -0
  74. package/skills/tfx-workspace/skill-snapshot/tfx-setup/SKILL.md +101 -0
  75. package/.claude-plugin/marketplace.json +0 -34
  76. package/.claude-plugin/plugin.json +0 -22
  77. package/config/mcp-registry.json +0 -29
  78. package/tui/codex-profile.mjs +0 -457
  79. package/tui/core.mjs +0 -266
  80. package/tui/doctor.mjs +0 -375
  81. package/tui/gemini-profile.mjs +0 -299
  82. package/tui/monitor-data.mjs +0 -152
  83. package/tui/monitor.mjs +0 -333
  84. package/tui/setup.mjs +0 -599
package/CLAUDE.md ADDED
@@ -0,0 +1,161 @@
1
+ # triflux — Claude Code 운영 가이드
2
+
3
+ <core-systems>
4
+ ## 핵심 스킬 시스템 (항상 인지)
5
+
6
+ 이 프로젝트는 3개의 스킬 시스템을 동시에 사용한다. 어떤 작업이든 해당 시스템의 스킬이 있는지 먼저 확인한다.
7
+
8
+ | 시스템 | 접두사 | 용도 | 스킬 수 |
9
+ |--------|--------|------|---------|
10
+ | **triflux** | `/tfx-*` | CLI 라우팅, 멀티모델 오케스트레이션, 스웜, 원격 실행 | ~40개 |
11
+ | **gstack** | `/` (접두사 없음) | QA, ship, investigate, design, review, checkpoint | ~35개 |
12
+ | **omc** | `/oh-my-claudecode:*` | autopilot, ralph, team, ultrawork, ccg | ~25개 |
13
+
14
+ 스킬을 모르면 자연어 라우팅(`.claude/rules/tfx-routing.md`)으로 자동 매핑된다.
15
+ 세션 종료 전 메모리 파일이 3개+ 변경됐으면 `/memory-hygiene` 제안을 검토한다.
16
+ </core-systems>
17
+
18
+ <psmux-wt>
19
+ ## psmux/WT 규칙
20
+
21
+ psmux 세션·WT 패인을 생성/조작/정리할 때 `tfx-psmux-rules` 스킬을 참조한다.
22
+ WT 프리징 방지: exit → sleep 2 → kill 순서. 바로 kill하지 않는다.
23
+
24
+ ### wt.exe → wt-manager 경유
25
+
26
+ safety-guard가 `wt.exe`, `wt new-tab`, `wt split-pane`, `Start-Process wt`를 차단한다.
27
+ `hub/team/wt-manager.mjs`의 API를 사용한다.
28
+
29
+ | 용도 | API |
30
+ |------|-----|
31
+ | 새 탭 | `createTab({ title, command, profile, cwd })` |
32
+ | 패인 분할 | `splitPane({ direction: 'H'\|'V', title, command })` |
33
+ | 다중 배치 | `applySplitLayout([{ title, command, direction }])` |
34
+ | 탭 정리 | `closeTab(title)` / `closeStale({ olderThanMs, titlePattern })` |
35
+
36
+ 차단과 대안은 항상 쌍으로 존재해야 한다. 차단만 추가하고 대안을 안 만들면 데드락.
37
+
38
+ ### raw `psmux kill-session` → psmux wrapper 경유
39
+
40
+ safety-guard가 raw `psmux kill-session`을 차단한다.
41
+ 세션 정리는 `hub/team/psmux.mjs` 공개 API 또는 internal wrapper로 우회한다.
42
+
43
+ | 용도 | API / 래퍼 |
44
+ |------|------------|
45
+ | 세션 조회 | `listSessions({ filterTitle?, olderThanMs? })` |
46
+ | title prefix / regex kill | `killSessionByTitle(titlePattern)` |
47
+ | stale idle 세션 정리 | `pruneStale({ olderThanMs, dryRun })` |
48
+ | Bash 훅 우회용 래퍼 | `node hub/team/psmux.mjs --internal kill-by-title <prefix\|/regex/>` |
49
+
50
+ ### psmux에서 Codex 실행
51
+
52
+ | 방식 | 동작 | 이유 |
53
+ |------|------|------|
54
+ | `codex` (interactive) | 불가 | psmux에서 TTY를 못 잡음 |
55
+ | `codex < prompt.md` | 불가 | "stdin is not a terminal" |
56
+ | `codex exec "$(cat prompt.md)" -s danger-full-access --dangerously-bypass-approvals-and-sandbox` | 사용 | 유일한 안전 경로 |
57
+
58
+ `codex exec`는 config.toml `approval_mode`를 무시하므로 `--dangerously-bypass-approvals-and-sandbox` 필수.
59
+ `-s` 유효값: read-only, workspace-write, danger-full-access.
60
+ </psmux-wt>
61
+
62
+ <codex-config>
63
+ ## Codex config.toml
64
+
65
+ config.toml에 이미 설정된 값은 CLI 플래그로 중복 지정하지 않는다.
66
+
67
+ | config.toml에 있으면 | CLI에서 생략 |
68
+ |---------------------|-------------|
69
+ | `approval_mode = "auto"` | `-a`, `--full-auto` |
70
+ | `sandbox = "workspace-write"` | `-s`, `--full-auto` |
71
+
72
+ 안전 패턴: config.toml에 기본값을 두고, CLI에서는 `--profile` 선택만 한다.
73
+ </codex-config>
74
+
75
+ <account-broker>
76
+ ## AccountBroker (계정 브로커)
77
+
78
+ conductor, headless, swarm-hypervisor가 하나의 AccountBroker 싱글턴을 공유한다.
79
+
80
+ | 항목 | 설명 |
81
+ |------|------|
82
+ | 계정별 CircuitBreaker | 장애 격리 — 한 계정 오류가 다른 계정에 전파되지 않음 |
83
+ | busy 플래그 | 동일 계정 이중 임대(double-lease) 방지 |
84
+ | `/broker/reload` | 장시간 세션 중 accounts.json 핫리로드 |
85
+ | EventEmitter 이벤트 | `lease`, `release`, `cooldown`, `tierFallback`, `circuitOpen`, `circuitClose`, `noAvailableAccounts` — HUD 연동용 |
86
+ </account-broker>
87
+
88
+ <remote>
89
+ ## 원격 실행
90
+
91
+ ### 스킬 구분
92
+
93
+ | 스킬 | 대상 | 방식 |
94
+ |------|------|------|
95
+ | tfx-codex-swarm | 로컬 전용 | 로컬 worktree + psmux |
96
+ | tfx-remote-spawn | Claude Code 원격 | SSH → Claude Code 세션 → 내부 tfx 라우팅 |
97
+
98
+ codex를 SSH 너머로 직접 실행하지 않는다. config.toml 충돌 + TTY 문제.
99
+ 원격에서 codex가 필요하면: remote-spawn → Claude Code → Claude가 내부에서 codex 호출.
100
+
101
+ ### SSH 패턴
102
+
103
+ hosts.json `os` 필드로 대상 셸을 판단한다. safety-guard도 이 필드를 참조.
104
+
105
+ | 대상 OS | 셸 | 패턴 |
106
+ |---------|-----|------|
107
+ | windows | PowerShell | scp + `pwsh -File` 필수. `$var` → `$env:VAR`, `2>/dev/null` → `2>$null` |
108
+ | darwin | zsh | 인라인 가능. brew PATH 주의 (`/opt/homebrew/bin`) |
109
+ | linux | bash | 인라인 가능. 표준 POSIX |
110
+
111
+ - `~` → `$HOME` 변환은 모든 OS 공통
112
+ </remote>
113
+
114
+ <headless-retrieval>
115
+ ## Headless 결과 회수
116
+
117
+ background로 실행한 headless 결과는 **반드시 task-notification 완료 후** 읽는다.
118
+
119
+ | 패턴 | 올바름 | 이유 |
120
+ |------|--------|------|
121
+ | task-notification 후 output 파일 읽기 | YES | 프로세스 종료 = 워커 전부 완료 |
122
+ | task-notification 전 output 파일 tail | NO | 시작 메시지만 보이고 "실패"로 오진 |
123
+ | psmux capture-pane으로 중간 체크 | NO | 워커 진행 중이면 빈 화면일 수 있음 |
124
+
125
+ 완료 마커: `=== HEADLESS_COMPLETE succeeded=N failed=N total=N ===`
126
+ 워커 상세: `$TMPDIR/tfx-headless/{sessionName}-worker-N.txt`
127
+ </headless-retrieval>
128
+
129
+ <cross-review>
130
+ ## 교차 검증
131
+
132
+ - Claude 작성 코드 → Codex 리뷰
133
+ - Codex 작성 코드 → Claude 리뷰
134
+ - 동일 모델 self-approve 하지 않는다
135
+ - git commit 전 미검증 파일 감지 시 nudge
136
+ </cross-review>
137
+
138
+ <session-context>
139
+ ## 맥락 이탈 판단
140
+
141
+ 현재 세션 맥락과 무관한 요청이 감지되면 psmux 격리를 제안한다.
142
+
143
+ | 확신도 | 신호 | 행동 |
144
+ |--------|------|------|
145
+ | 확실 | "새 탭", "별도로", "새 세션" | 바로 psmux spawn |
146
+ | 높음 | 다른 프로젝트/스택 언급 | 분리 제안 |
147
+ | 중간 | 작업 유형 전환 | 분리 제안 + 현재 세션 옵션 |
148
+ | 낮음 | 현재 작업 연장 | 세션 유지 |
149
+ </session-context>
150
+
151
+ ## 세부 규칙은 `.claude/rules/` 참조
152
+
153
+ | 파일 | 내용 |
154
+ |------|------|
155
+ | `.claude/rules/tfx-routing.md` | 자연어 → 스킬 라우팅, CLI 라우팅 Layer 1~3, 충돌 해소 |
156
+ | `.claude/rules/tfx-execution-skill-map.md` | tfx-auto / multi / swarm 실행 엔진 매핑, 격리 기준, 안티패턴 |
157
+ | `.claude/rules/tfx-autoplan-principles.md` | gstack autoplan의 6 decision principles, phase 우선순위, 충돌 해소 규칙 추출본 |
158
+ | `.claude/rules/tfx-update-logic.md` | triflux / OMC / gstack / Codex / Gemini 업데이트 로직 |
159
+ | `.claude/rules/tfx-stack-coexistence.md` | gstack / superpowers / triflux 공존 원칙, 레이어 분리, 의존 방향, 충돌 해소 |
160
+
161
+ Claude Code는 `.claude/rules/*.md` 를 자동 로드한다. Codex CLI는 `@import` 미지원이므로 필요 시 `AGENTS.md` 를 독립 유지한다.
package/hud/constants.mjs CHANGED
@@ -79,17 +79,15 @@ export const CLAUDE_USAGE_CACHE_PATH = join(
79
79
  "cache",
80
80
  "claude-usage-cache.json",
81
81
  );
82
- export const PLUGIN_USAGE_CACHE_PATH = join(
82
+ export const OMC_PLUGIN_USAGE_CACHE_PATH = join(
83
83
  homedir(),
84
84
  ".claude",
85
85
  "cache",
86
86
  "tfx-hub",
87
87
  "plugin-usage-cache.json",
88
88
  );
89
- export const OMC_PLUGIN_USAGE_CACHE_PATH = PLUGIN_USAGE_CACHE_PATH; // OMC alias
90
- export const CLAUDE_USAGE_STALE_MS_SOLO = 5 * 60 * 1000; // 플러그인 없을 때: 5 캐시
91
- export const CLAUDE_USAGE_STALE_MS_WITH_PLUGIN = 15 * 60 * 1000; // 플러그인 있을 때: 15분
92
- export const CLAUDE_USAGE_STALE_MS_WITH_OMC = CLAUDE_USAGE_STALE_MS_WITH_PLUGIN; // OMC alias
89
+ export const CLAUDE_USAGE_STALE_MS_SOLO = 5 * 60 * 1000; // OMC 없을 때: 5분 캐시
90
+ export const CLAUDE_USAGE_STALE_MS_WITH_OMC = 15 * 60 * 1000; // OMC 있을 때: 15
93
91
  export const CLAUDE_USAGE_429_BACKOFF_MS = 10 * 60 * 1000; // 429 에러 시 10분 backoff
94
92
  export const GEMINI_429_BASE_DELAY_MS = 2000;
95
93
  export const GEMINI_429_MAX_RETRIES = 3;
@@ -225,12 +225,16 @@ export function parseClaudeUsageResponse(response) {
225
225
  if (!response || typeof response !== "object") return null;
226
226
  // five_hour/seven_day 키 자체가 없으면 비정상 응답
227
227
  if (!response.five_hour && !response.seven_day) return null;
228
- const fiveHour = response.five_hour?.utilization;
229
- const sevenDay = response.seven_day?.utilization;
230
- // utilization이 null이면 0%로 처리 (API 200 성공 시 null = 사용량 없음)
228
+ // 자체가 부재하면 percent=null (HUD --% placeholder), utilization=null 만 0%로 처리
229
+ const fiveHourPresent = response.five_hour != null;
230
+ const sevenDayPresent = response.seven_day != null;
231
231
  return {
232
- fiveHourPercent: clampPercent(fiveHour ?? 0),
233
- weeklyPercent: clampPercent(sevenDay ?? 0),
232
+ fiveHourPercent: fiveHourPresent
233
+ ? clampPercent(response.five_hour.utilization ?? 0)
234
+ : null,
235
+ weeklyPercent: sevenDayPresent
236
+ ? clampPercent(response.seven_day.utilization ?? 0)
237
+ : null,
234
238
  fiveHourResetsAt: response.five_hour?.resets_at || null,
235
239
  weeklyResetsAt: response.seven_day?.resets_at || null,
236
240
  };
@@ -18,10 +18,12 @@ import {
18
18
  import { decodeJwtEmail, readJson, writeJsonSafe } from "../utils.mjs";
19
19
 
20
20
  // window_minutes 기반 5h/1w 슬롯 분류
21
+ // 5h: ≤360min (300min 표준, ±20% 허용)
22
+ // weekly: ≥7000min (10080min 표준, ~5d 이상만 허용 — 24h/48h 등 중간 버킷 도입 시 silent 오분류 방지)
21
23
  export function classifyBucket(bucket) {
22
24
  if (!bucket?.window_minutes) return null;
23
25
  if (bucket.window_minutes <= 360) return "five_hour";
24
- if (bucket.window_minutes >= 1440) return "weekly";
26
+ if (bucket.window_minutes >= 7000) return "weekly";
25
27
  return null;
26
28
  }
27
29
 
package/hud/utils.mjs CHANGED
@@ -212,11 +212,13 @@ export function getContextPercent(stdin) {
212
212
  }
213
213
 
214
214
  // 과거 리셋 시간 → 다음 주기로 순환하여 미래 시점 반환
215
+ // elapsed가 cycleMs의 정수배일 때 ceil은 target=now를 반환해 diff=0이 되므로
216
+ // floor+1로 항상 다음 사이클을 가리키도록 한다.
215
217
  export function advanceToNextCycle(epochMs, cycleMs) {
216
218
  const now = Date.now();
217
219
  if (epochMs >= now || !cycleMs) return epochMs;
218
220
  const elapsed = now - epochMs;
219
- return epochMs + Math.ceil(elapsed / cycleMs) * cycleMs;
221
+ return epochMs + (Math.floor(elapsed / cycleMs) + 1) * cycleMs;
220
222
  }
221
223
 
222
224
  function parseResetDate(isoOrUnix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "10.13.3",
3
+ "version": "10.13.6",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,77 +13,26 @@
13
13
  "tfx-doctor-tui": "bin/tfx-doctor-tui.mjs",
14
14
  "tfx-setup-tui": "bin/tfx-setup-tui.mjs"
15
15
  },
16
+ "engines": {
17
+ "node": ">=18.0.0"
18
+ },
19
+ "dependencies": {
20
+ "@triflux/core": "10.0.1",
21
+ "@triflux/remote": "^10.0.0-alpha.1"
22
+ },
16
23
  "files": [
17
24
  "bin",
18
- "tui",
19
- "hub",
20
- "config",
21
25
  "skills",
22
- "!skills/tfx-workspace",
23
- "!**/failure-reports",
24
- "scripts",
25
26
  "hooks",
26
27
  "hud",
28
+ "scripts",
29
+ "hub",
27
30
  "mesh",
28
- ".claude-plugin",
31
+ "references",
32
+ "CLAUDE.md",
29
33
  "README.md",
30
- "README.ko.md",
31
34
  "LICENSE"
32
35
  ],
33
- "workspaces": [
34
- "packages/core",
35
- "packages/remote",
36
- "packages/triflux"
37
- ],
38
- "scripts": {
39
- "pack": "node scripts/pack.mjs all",
40
- "pack:core": "node scripts/pack.mjs core",
41
- "pack:remote": "node scripts/pack.mjs remote",
42
- "setup": "node scripts/setup.mjs",
43
- "preinstall": "node scripts/preinstall.mjs",
44
- "postinstall": "node scripts/setup.mjs",
45
- "lint": "biome check bin config hooks hub hud mesh scripts tests .claude-plugin .github package.json package-lock.json biome.json",
46
- "lint:fix": "biome check --write bin config hooks hub hud mesh scripts tests .claude-plugin .github package.json package-lock.json biome.json",
47
- "health": "npm test && npm run lint",
48
- "test": "node scripts/test-lock.mjs --test --test-force-exit --test-concurrency=8 \"tests/**/*.test.mjs\" \"scripts/__tests__/**/*.test.mjs\"",
49
- "test:unit": "node scripts/test-lock.mjs --test --test-force-exit --test-concurrency=8 tests/unit/**/*.test.mjs",
50
- "test:integration": "node scripts/test-lock.mjs --test --test-force-exit --test-concurrency=8 tests/integration/**/*.test.mjs",
51
- "test:route-smoke": "node scripts/test-lock.mjs --test scripts/test-tfx-route-no-claude-native.mjs",
52
- "test:contract": "node scripts/test-lock.mjs --test --test-force-exit --test-concurrency=8 tests/contract/**/*.test.mjs",
53
- "test:coverage": "node --experimental-test-coverage --test-coverage-lines=60 --test-coverage-functions=60 --test --test-force-exit --test-concurrency=8 \"tests/**/*.test.mjs\"",
54
- "gen:skill-docs": "node scripts/gen-skill-docs.mjs",
55
- "gen:skill-manifest": "node scripts/gen-skill-manifest.mjs",
56
- "release:check-sync": "node scripts/release/check-sync.mjs",
57
- "release:check-sync:fix": "node scripts/release/check-sync.mjs --fix",
58
- "release:check-mirror": "node scripts/release/check-packages-mirror.mjs",
59
- "release:check-mirror:fix": "node scripts/release/check-packages-mirror.mjs --fix",
60
- "release:bump": "node scripts/release/bump-version.mjs",
61
- "release:prepare": "node scripts/release/prepare.mjs",
62
- "release:publish": "node scripts/release/publish.mjs",
63
- "release:verify": "node scripts/release/verify.mjs"
64
- },
65
- "engines": {
66
- "node": ">=18.0.0"
67
- },
68
- "repository": {
69
- "type": "git",
70
- "url": "git+https://github.com/tellang/triflux.git"
71
- },
72
- "homepage": "https://github.com/tellang/triflux#readme",
73
- "author": "tellang",
74
- "license": "MIT",
75
- "dependencies": {
76
- "@modelcontextprotocol/sdk": "^1.29.0",
77
- "better-sqlite3": "^12.6.2",
78
- "pino": "^10.3.1",
79
- "pino-pretty": "^13.1.3",
80
- "systray2": "^2.1.4",
81
- "zod": "^4.0.0"
82
- },
83
- "devDependencies": {
84
- "@biomejs/biome": "^2.0.0",
85
- "knip": "^6.3.0"
86
- },
87
36
  "keywords": [
88
37
  "claude-code",
89
38
  "plugin",
@@ -94,5 +43,13 @@
94
43
  "multi-model",
95
44
  "triflux",
96
45
  "tfx"
97
- ]
46
+ ],
47
+ "author": "tellang",
48
+ "license": "MIT",
49
+ "homepage": "https://github.com/tellang/triflux#readme",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/tellang/triflux.git",
53
+ "directory": "packages/triflux"
54
+ }
98
55
  }
@@ -0,0 +1,240 @@
1
+ # CLI Parameter Reference — Claude Code / Codex / Gemini
2
+
3
+ > 2026-04-16 기준. 공식 docs + --help + 소스코드에서 직접 수집.
4
+
5
+ ---
6
+
7
+ ## 비교 요약
8
+
9
+ | 항목 | Claude Code | Codex (Rust) | Gemini |
10
+ |------|------------|--------------|--------|
11
+ | 최상위 플래그 | ~55개 | ~18개 | ~20개 |
12
+ | 서브커맨드 | 10개 | 15개 | 5개 (슬래시 30+) |
13
+ | 설정 파일 | settings.json | config.toml | settings.json |
14
+ | 설정 키 | 100+ | 60+ | 200+ |
15
+ | 환경변수 | 120+ | 6개 | — |
16
+ | 비대화형 | `-p`/`--print` | `exec` 서브커맨드 | `-p`/`--prompt` |
17
+ | 샌드박스 | settings sandbox 섹션 | `-s` 플래그 (3단계) | `--sandbox` boolean |
18
+ | 자동승인 | `--permission-mode` | `--full-auto`/`--yolo` | `--yolo`/`--approval-mode` |
19
+ | MCP | `claude mcp` | `codex mcp` | `/mcp` 슬래시 |
20
+ | 모델 선택 | `--model sonnet` | `-m gpt-5.4` | `-m gemini-2.5-pro` |
21
+ | 세션 재개 | `-r`/`--resume` | `codex resume` | `-r`/`--resume` |
22
+ | 워크트리 | `-w`/`--worktree` | — | `-w`/`--worktree` |
23
+
24
+ ---
25
+
26
+ ## 1. Claude Code CLI
27
+
28
+ ### 최상위 플래그 (주요)
29
+
30
+ | 플래그 | 타입 | 설명 |
31
+ |--------|------|------|
32
+ | `-p`/`--print` | bool | 비대화형 출력 후 종료 |
33
+ | `--model <model>` | string | 모델 선택 (sonnet, opus, haiku) |
34
+ | `--effort <level>` | enum | low/medium/high/max |
35
+ | `-c`/`--continue` | bool | 최근 대화 이어가기 |
36
+ | `-r`/`--resume` | string | 세션 ID로 재개 |
37
+ | `--permission-mode` | enum | default/acceptEdits/plan/auto/dontAsk/bypassPermissions |
38
+ | `--dangerously-skip-permissions` | bool | 모든 권한 확인 건너뜀 |
39
+ | `-w`/`--worktree` | string | Git worktree 생성 |
40
+ | `--system-prompt` | string | 시스템 프롬프트 지정 |
41
+ | `--append-system-prompt` | string | 기본 시스템 프롬프트에 추가 |
42
+ | `--mcp-config` | string[] | MCP 서버 JSON 설정 로드 |
43
+ | `--max-turns` | number | 에이전트 턴 제한 (print 모드) |
44
+ | `--max-budget-usd` | number | API 비용 상한 (print 모드) |
45
+ | `--output-format` | enum | text/json/stream-json |
46
+ | `--json-schema` | string | 구조화 출력 JSON Schema |
47
+ | `--tools` | string[] | 사용 가능 도구 제한 |
48
+ | `--allowedTools` | string[] | 허용할 도구 목록 |
49
+ | `--disallowedTools` | string[] | 거부할 도구 목록 |
50
+ | `--add-dir` | string[] | 추가 디렉토리 접근 허용 |
51
+ | `--agent` | string | 세션 에이전트 지정 |
52
+ | `--agents` | JSON | 커스텀 에이전트 정의 |
53
+ | `--bare` | bool | 최소 모드 (hooks/LSP/plugin 건너뜀) |
54
+ | `--fallback-model` | string | 오버로드 시 폴백 모델 |
55
+ | `--ide` | bool | IDE 자동 연결 |
56
+ | `--tmux` | bool | tmux 세션 생성 (--worktree 필요) |
57
+ | `--verbose` | bool | 상세 모드 |
58
+ | `-d`/`--debug` | string | 디버그 (카테고리 필터 가능) |
59
+ | `--teammate-mode` | enum | auto/in-process/tmux |
60
+ | `--remote` | string | claude.ai 웹 세션 생성 |
61
+ | `--teleport` | bool | 웹 세션을 로컬로 가져오기 |
62
+
63
+ ### 서브커맨드
64
+
65
+ | 커맨드 | 설명 |
66
+ |--------|------|
67
+ | `claude plugin` | 플러그인 관리 (install/uninstall/enable/disable/update) |
68
+ | `claude mcp` | MCP 서버 설정 |
69
+ | `claude config` | 인터랙티브 설정 |
70
+ | `claude auth` | 인증 (login/logout/status) |
71
+ | `claude agents` | 에이전트 목록 |
72
+ | `claude doctor` | 상태 진단 |
73
+ | `claude update` | 업데이트 |
74
+ | `claude auto-mode` | 자동 모드 분류기 확인 |
75
+ | `claude setup-token` | CI용 장기 토큰 생성 |
76
+
77
+ ### 환경변수 (주요)
78
+
79
+ | 변수 | 설명 |
80
+ |------|------|
81
+ | `ANTHROPIC_API_KEY` | API 키 |
82
+ | `ANTHROPIC_MODEL` | 모델 오버라이드 |
83
+ | `ANTHROPIC_BASE_URL` | API 엔드포인트 |
84
+ | `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | 최대 출력 토큰 |
85
+ | `CLAUDE_CODE_EFFORT_LEVEL` | 노력 수준 |
86
+ | `CLAUDE_CODE_DISABLE_THINKING` | 사고 비활성화 |
87
+ | `CLAUDE_CODE_SUBAGENT_MODEL` | 서브에이전트 모델 |
88
+ | `CLAUDE_CODE_USE_BEDROCK` | Bedrock 사용 |
89
+ | `CLAUDE_CODE_USE_VERTEX` | Vertex 사용 |
90
+ | `CLAUDE_CODE_SHELL` | 셸 오버라이드 |
91
+ | `BASH_DEFAULT_TIMEOUT_MS` | Bash 타임아웃 (기본 120s) |
92
+ | `API_TIMEOUT_MS` | API 타임아웃 (기본 600s) |
93
+
94
+ ---
95
+
96
+ ## 2. Codex CLI (Rust)
97
+
98
+ ### 최상위 플래그
99
+
100
+ | 플래그 | 단축 | 타입 | 설명 |
101
+ |--------|------|------|------|
102
+ | `[PROMPT]` | — | string | 초기 프롬프트 |
103
+ | `--model` | `-m` | string | 모델 (예: gpt-5.4) |
104
+ | `--image` | `-i` | path[] | 이미지 첨부 |
105
+ | `--sandbox` | `-s` | enum | read-only/workspace-write/danger-full-access |
106
+ | `--ask-for-approval` | `-a` | enum | untrusted/on-request/never |
107
+ | `--full-auto` | — | bool | workspace-write + 자동승인 |
108
+ | `--yolo` | — | bool | 모든 제한 해제 |
109
+ | `--profile` | `-p` | string | config.toml 프로필 |
110
+ | `--cd` | `-C` | path | 작업 디렉토리 |
111
+ | `--add-dir` | — | path[] | 추가 쓰기 허용 디렉토리 |
112
+ | `--search` | — | bool | 웹 검색 활성화 |
113
+ | `--oss` | — | bool | 로컬 LLM 사용 |
114
+ | `--config` | `-c` | key=value | config 인라인 오버라이드 |
115
+ | `--enable`/`--disable` | — | feature | 피처 플래그 토글 |
116
+
117
+ ### 서브커맨드
118
+
119
+ | 커맨드 | 설명 |
120
+ |--------|------|
121
+ | `codex exec` | 비대화형 실행 |
122
+ | `codex review` | 코드 리뷰 (exec review 별칭) |
123
+ | `codex resume` | 세션 재개 (TUI) |
124
+ | `codex fork` | 세션 분기 |
125
+ | `codex apply` | Cloud diff 적용 |
126
+ | `codex mcp` | MCP 서버 관리 |
127
+ | `codex mcp-server` | Codex를 MCP 서버로 실행 |
128
+ | `codex login`/`logout` | 인증 |
129
+ | `codex sandbox` | 샌드박스 디버깅 |
130
+ | `codex completion` | 셸 자동완성 |
131
+ | `codex features` | 피처 플래그 관리 |
132
+
133
+ ### codex exec 플래그
134
+
135
+ | 플래그 | 설명 |
136
+ |--------|------|
137
+ | `--json` | JSONL 이벤트 출력 |
138
+ | `--output-last-message` | 최종 메시지 파일 저장 |
139
+ | `--output-schema` | JSON Schema 검증 |
140
+ | `--ephemeral` | 디스크 저장 안 함 |
141
+ | `--skip-git-repo-check` | Git 외부 실행 허용 |
142
+ | `--color` | always/never/auto |
143
+
144
+ ### codex review 플래그
145
+
146
+ | 플래그 | 설명 |
147
+ |--------|------|
148
+ | `--uncommitted` | staged+unstaged 리뷰 |
149
+ | `--base <branch>` | 브랜치 대비 diff 리뷰 |
150
+ | `--commit <SHA>` | 특정 커밋 리뷰 |
151
+ | `--title` | 리뷰 제목 |
152
+
153
+ ### config.toml 키 (주요)
154
+
155
+ | 키 | 타입 | 설명 |
156
+ |----|------|------|
157
+ | `model` | string | 모델 |
158
+ | `model_reasoning_effort` | enum | minimal/low/medium/high/xhigh |
159
+ | `sandbox_mode` | enum | 샌드박스 정책 |
160
+ | `approval_policy` | enum/table | 승인 정책 |
161
+ | `shell_environment_policy.inherit` | enum | all/core/none |
162
+ | `web_search` | enum | disabled/cached/live |
163
+ | `mcp_servers.<id>.*` | table | MCP 서버 설정 |
164
+ | `profiles.<name>.*` | table | 프로필별 오버라이드 |
165
+ | `notify` | string[] | 완료 알림 명령 |
166
+ | `features.*` | bool | 피처 플래그 |
167
+ | `tui.*` | table | TUI 설정 |
168
+
169
+ ---
170
+
171
+ ## 3. Gemini CLI
172
+
173
+ ### 최상위 플래그
174
+
175
+ | 플래그 | 단축 | 타입 | 설명 |
176
+ |--------|------|------|------|
177
+ | `[query]` | — | string | 초기 프롬프트 |
178
+ | `--prompt` | `-p` | string | 비대화형 모드 (deprecated) |
179
+ | `--prompt-interactive` | `-i` | string | 프롬프트 후 대화형 유지 |
180
+ | `--model` | `-m` | string | 모델 (gemini-2.5-pro 등) |
181
+ | `--sandbox` | `-s` | bool | 샌드박스 (Docker/Podman) |
182
+ | `--yolo` | `-y` | bool | 모든 도구 자동승인 |
183
+ | `--approval-mode` | — | enum | default/auto_edit/yolo/plan |
184
+ | `--debug` | `-d` | bool | 디버그 (F12 콘솔) |
185
+ | `--output-format` | `-o` | enum | text/json/stream-json |
186
+ | `--resume` | `-r` | string | 세션 재개 (latest/인덱스/UUID) |
187
+ | `--worktree` | `-w` | string | Git worktree 생성 |
188
+ | `--extensions` | `-e` | string[] | 활성화할 익스텐션 |
189
+ | `--include-directories` | — | string[] | 추가 디렉토리 (최대 5개) |
190
+ | `--allowed-tools` | — | string | 확인 없이 허용할 도구 |
191
+ | `--checkpointing` | — | bool | 파일 수정 전 스냅샷 |
192
+ | `--screen-reader` | — | bool | 접근성 모드 |
193
+ | `--acp` | — | bool | Agent Communication Protocol 모드 |
194
+ | `--policy` | — | string[] | 추가 정책 파일 |
195
+ | `--raw-output` | — | bool | ANSI 이스케이프 허용 |
196
+
197
+ ### 슬래시 커맨드 (주요)
198
+
199
+ | 커맨드 | 설명 |
200
+ |--------|------|
201
+ | `/mcp list\|auth\|reload\|enable\|disable` | MCP 서버 관리 |
202
+ | `/extensions list\|install\|update\|enable\|disable` | 익스텐션 관리 |
203
+ | `/skills list\|enable\|disable\|reload` | 스킬 관리 |
204
+ | `/hooks list\|enable\|disable` | 훅 관리 |
205
+ | `/agents list\|enable\|disable\|config` | 에이전트 관리 |
206
+ | `/model set\|manage` | 모델 전환 |
207
+ | `/memory add\|list\|refresh` | GEMINI.md 메모리 |
208
+ | `/chat save\|resume\|list\|share` | 세션 관리 |
209
+ | `/compress` | 컨텍스트 압축 |
210
+ | `/restore` | 파일 복원 |
211
+ | `/settings` | 설정 에디터 |
212
+ | `/stats session\|model\|tools` | 통계 |
213
+
214
+ ### settings.json 키 (주요 카테고리)
215
+
216
+ | 카테고리 | 주요 키 |
217
+ |---------|---------|
218
+ | `general` | preferredEditor, vimMode, defaultApprovalMode, checkpointing, plan |
219
+ | `model` | name, maxSessionTurns, compressionThreshold |
220
+ | `ui` | theme, inlineThinkingMode, compactToolOutput, footer, accessibility |
221
+ | `tools` | sandbox, shell.*, core, allowed, exclude, useRipgrep |
222
+ | `security` | disableYoloMode, disableAlwaysAllow, folderTrust, auth |
223
+ | `context` | fileName, includeDirectoryTree, fileFiltering, memoryBoundaryMarkers |
224
+ | `mcpServers` | command, args, env, url, trust, includeTools, excludeTools |
225
+ | `hooks` | BeforeTool, AfterTool, SessionStart, SessionEnd, BeforeModel |
226
+ | `skills` | enabled, disabled |
227
+ | `agents` | overrides, browser.* |
228
+ | `experimental` | enableAgents, worktrees, jitContext, memoryManager |
229
+
230
+ ---
231
+
232
+ ## triflux에서의 활용
233
+
234
+ | 용도 | Claude | Codex | Gemini |
235
+ |------|--------|-------|--------|
236
+ | 비대화형 실행 | `claude -p "prompt"` | `codex exec "prompt"` | `gemini -p "prompt"` |
237
+ | 자동승인 | `--permission-mode bypassPermissions` | `--yolo` | `-y` |
238
+ | JSON 출력 | `--output-format stream-json` | `--json` | `-o stream-json` |
239
+ | MCP 연결 | `--mcp-config file.json` | config.toml `[mcp_servers]` | settings.json `mcpServers` |
240
+ | 세션 재개 | `claude -r <id>` | `codex resume --last` | `gemini -r latest` |