clitrigger 0.1.19 → 0.2.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.
- package/.env.example +2 -1
- package/README.md +29 -8
- package/README_KR.md +29 -8
- package/bin/clitrigger.js +23 -40
- package/dist/client/assets/{index-CRSNebDI.css → index-DxSgLI9D.css} +1 -1
- package/dist/client/assets/{index-BldpDcSD.js → index-fn9z65zw.js} +178 -168
- package/dist/client/index.html +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +35 -7
- package/dist/server/index.js.map +1 -1
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/auth.js +9 -0
- package/dist/server/middleware/auth.js.map +1 -1
- package/dist/server/routes/auth.d.ts.map +1 -1
- package/dist/server/routes/auth.js +106 -28
- package/dist/server/routes/auth.js.map +1 -1
- package/dist/server/utils/password.d.ts +3 -0
- package/dist/server/utils/password.d.ts.map +1 -0
- package/dist/server/utils/password.js +46 -0
- package/dist/server/utils/password.js.map +1 -0
- package/electron/main.cjs +16 -24
- package/package.json +33 -7
package/.env.example
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# production으로 설정 시 CORS_ORIGIN에 명시된 도메인만 허용 (미설정 시 모든 origin 허용)
|
|
2
2
|
NODE_ENV=
|
|
3
3
|
PORT=3000
|
|
4
|
-
AUTH_PASSWORD=
|
|
4
|
+
AUTH_PASSWORD= # 선택 — 비우면 첫 접속 시 웹 UI 셋업 화면이 뜬다.
|
|
5
|
+
# 값이 있으면 1회만 사용 후 hash로 변환·저장됨.
|
|
5
6
|
SESSION_SECRET=
|
|
6
7
|
CORS_ORIGIN=http://localhost:5173,http://localhost:3000
|
|
7
8
|
TUNNEL_ENABLED=false
|
package/README.md
CHANGED
|
@@ -104,12 +104,14 @@ Every feature — Planner, Scheduler, worktree isolation, rate-limit auto-recove
|
|
|
104
104
|
|
|
105
105
|
## Features
|
|
106
106
|
|
|
107
|
-
### Plugin System (Harness, Jira, GitHub, Notion, gstack)
|
|
108
|
-
The **Harness** panel edits Claude / Gemini / Codex user config (settings, memory files, MCP servers) right in the browser — atomic writes with deep-merge preserve untouched fields, and a Codex `trustLevelMissing` warning surfaces when a project isn't trusted. Jira, GitHub, Notion integrations and gstack skill injection ship alongside as self-contained plugins. Two plugin categories — `external-service` (REST proxy + UI panel) and `execution-hook` (pre-execution hook into the orchestrator). Adding a new integration needs only a manifest and `registerPlugin()` call — no core code changes.
|
|
109
|
-
|
|
110
107
|
### Wiki (Karpathy LLM-Wiki Pattern)
|
|
111
108
|
A per-project knowledge graph (nodes + typed edges) that you curate once and selectively inject into TODO and discussion prompts. Stop pasting the same domain context every run. Toggle between List and Graph views (`@xyflow/react` + dagre auto-layout, drag-to-connect edges, cycle guards on `precedes`/`refines`), pick `None` / `All` / `Selected` / **`Auto`** per task — `Auto` runs a one-shot LLM retrieval right before each call to pick only the relevant entries, saving tokens. Preview the exact `<long_term_memory>` block (with char/token estimates) before sending; **export DB → `.clitrigger/wiki/<entity>/<slug>.md` Markdown** + Disk diff to keep the wiki alive in git or Obsidian. Lint surfaces duplicates / orphans / stale entries with inline fix actions (merge / delete / link); the Activity sub-tab logs ingest / lint / retrieve / merge events with severity. CLI-agnostic — Claude, Gemini, and Codex all see identical context with no adapter changes.
|
|
112
109
|
|
|
110
|
+
<div align="center">
|
|
111
|
+
<img src="https://raw.githubusercontent.com/HyperAITeam/CLITrigger/main/docs/images/screenshot-wiki.png" alt="Wiki — Per-project knowledge graph" width="800">
|
|
112
|
+
<p><em>Graph view of the per-project wiki — entries clustered by tag (Concept · Decision · Feature · Pattern), typed edges visualize how ideas relate, and selective injection feeds only what's relevant into each prompt</em></p>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
113
115
|
### Planner
|
|
114
116
|
A lightweight task planner separate from TODOs — capture ideas, attach images, tag with colors, sort by any column. Convert any planner item into a TODO or a schedule in one click. Markdown export/import (status sections + GFM checkboxes + HTML-comment metadata) lets you move plans across machines or share via GitHub / Obsidian / any plain Markdown viewer. Drop a `.md` file onto the planner card to import.
|
|
115
117
|
|
|
@@ -124,6 +126,11 @@ Each TODO automatically gets its own git worktree. Claude / Gemini / Codex CLIs
|
|
|
124
126
|
### Interactive Sessions
|
|
125
127
|
Long-lived interactive CLI sessions as first-class entities — bring up a Claude / Gemini / Codex session in a floating draggable window. **VS Code-style window grouping and docking**: drag a tab onto another window for a 5-zone diamond (top/bottom/left/right/center) to either split into resizable panes or merge as tabs, plus **Aero-style edge snapping, sticky window-to-window snapping, and a minimize-to-dock-tray** flow — keeps multi-session screens tidy. **xterm.js rendering** shows ANSI colors, cursor control, and TUI box-drawing identically to a native terminal. PTY spawns at the exact viewport dimensions, with **per-session font size** (A−/A+ buttons or Ctrl/Cmd ±) for readability. Per-session wiki injection plus a **Send/Skip pre-flight banner** lets you review the auto-generated initial prompt before it hits the model. Inline edit button updates non-running sessions in place. iOS Safari mobile Hangul IME is composed via a client-side dubeolsik composer. Window geometry, group tree, and tab arrangement persist and survive tab navigation; works on desktop and mobile (fullscreen on small screens).
|
|
126
128
|
|
|
129
|
+
<div align="center">
|
|
130
|
+
<img src="https://raw.githubusercontent.com/HyperAITeam/CLITrigger/main/docs/images/screenshot-sessions.png" alt="Sessions — Multi-CLI floating windows with VS Code-style docking" width="800">
|
|
131
|
+
<p><em>Claude, Gemini, and Codex sessions docked side-by-side via VS Code-style window grouping — each running in its own worktree branch</em></p>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
127
134
|
### Multi-Agent Discussion
|
|
128
135
|
AI agents with different roles — architect, developer, reviewer — debate in rounds before implementation. The resulting design is far more robust than a single AI working in isolation. Agents flagged as **Implementers** (`can_implement`) can commit code during their regular turns, while a final implementation round stitches everything together. Auto-implement triggers the code-writing round automatically on consensus. Or hit **Send to Planner** on a finished discussion to have the transcript distilled into curated planner items via a one-shot LLM extraction — review and edit before persisting.
|
|
129
136
|
|
|
@@ -197,7 +204,7 @@ Download the installer for your platform from the [latest GitHub release](https:
|
|
|
197
204
|
- **macOS** — `CLITrigger-<version>.dmg` (Apple Silicon & Intel)
|
|
198
205
|
- **Linux** — `CLITrigger-<version>.AppImage`
|
|
199
206
|
|
|
200
|
-
The desktop app bundles Node.js and the native modules (`better-sqlite3`, `node-pty`, `cloudflared`), so no separate runtime install is needed. On first launch you'
|
|
207
|
+
The desktop app bundles Node.js and the native modules (`better-sqlite3`, `node-pty`, `cloudflared`), so no separate runtime install is needed. On first launch a setup screen appears in the embedded browser — pick a password there and you're in. External sharing (Cloudflare tunnel) stays paused until setup completes, so the first user is guaranteed to be you.
|
|
201
208
|
|
|
202
209
|
### Option B — npm (recommended for developers)
|
|
203
210
|
|
|
@@ -206,13 +213,12 @@ npm i -g clitrigger
|
|
|
206
213
|
clitrigger
|
|
207
214
|
```
|
|
208
215
|
|
|
209
|
-
On first run
|
|
210
|
-
Open `http://localhost:3000` → Register a project → Write TODOs → Click Start.
|
|
216
|
+
On first run the server starts immediately. Open `http://localhost:3000` → set a password on the welcome screen → register a project → write TODOs → click Start. Change the password later via Settings → Account in the web UI.
|
|
211
217
|
|
|
212
218
|
```bash
|
|
213
219
|
# Change settings
|
|
214
220
|
clitrigger config port 8080 # Change port
|
|
215
|
-
clitrigger config
|
|
221
|
+
clitrigger config tunnel on # Enable Cloudflare tunnel for external sharing
|
|
216
222
|
```
|
|
217
223
|
|
|
218
224
|
> **Prerequisites**: Node.js 20+, Git, at least one AI CLI (Claude / Gemini / Codex)
|
|
@@ -234,7 +240,8 @@ cd src/client && npm install && cd ../..
|
|
|
234
240
|
|
|
235
241
|
# 2. Configure environment
|
|
236
242
|
cp .env.example .env
|
|
237
|
-
#
|
|
243
|
+
# AUTH_PASSWORD is optional — leave it blank and the dev server will show the
|
|
244
|
+
# setup screen on first browser load. Set it only if you want to skip setup.
|
|
238
245
|
|
|
239
246
|
# 3. Run
|
|
240
247
|
npm run dev
|
|
@@ -304,6 +311,20 @@ The displayed URL becomes `https://app.your-domain.com` and reputation tracks yo
|
|
|
304
311
|
|
|
305
312
|
---
|
|
306
313
|
|
|
314
|
+
## Star & Join Us
|
|
315
|
+
|
|
316
|
+
If CLITrigger saves you time, please [**give us a star**](https://github.com/HyperAITeam/CLITrigger) — it genuinely helps the project reach more developers.
|
|
317
|
+
|
|
318
|
+
Want to help shape what comes next? We're actively looking for contributors:
|
|
319
|
+
|
|
320
|
+
- **File an issue** — bug reports, feature requests, and rough ideas all welcome at [Issues](https://github.com/HyperAITeam/CLITrigger/issues)
|
|
321
|
+
- **Open a PR** — start with [`good first issue`](https://github.com/HyperAITeam/CLITrigger/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) labels, or pick anything that itches you
|
|
322
|
+
- **Share what you built** — drop your worktree workflows, custom plugins, or productivity tips in [Discussions](https://github.com/HyperAITeam/CLITrigger/discussions)
|
|
323
|
+
|
|
324
|
+
Every star, issue, and PR moves this faster. Thank you 🙏
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
307
328
|
## Contributors
|
|
308
329
|
|
|
309
330
|
Thanks to everyone who has contributed to CLITrigger!
|
package/README_KR.md
CHANGED
|
@@ -104,12 +104,14 @@ CLITrigger의 모든 기능 — Planner, Scheduler, 워크트리 격리, 한도
|
|
|
104
104
|
|
|
105
105
|
## 주요 기능
|
|
106
106
|
|
|
107
|
-
### 플러그인 시스템 (Harness · Jira · GitHub · Notion · gstack)
|
|
108
|
-
**Harness** 패널에서는 Claude / Gemini / Codex의 사용자 설정(settings, 메모리 파일, MCP 서버)을 IDE를 열지 않고 브라우저에서 바로 편집한다 — atomic write + deep-merge로 손대지 않은 필드는 그대로 유지하고, 프로젝트가 trusted 목록에 없으면 Codex `trustLevelMissing` 경고가 노출된다. Jira, GitHub, Notion 연동과 gstack 스킬 주입도 동일하게 자가 완결형 플러그인으로 함께 제공된다. `external-service`(REST 프록시 + 패널 탭)와 `execution-hook`(오케스트레이터 사전 실행 훅) 두 카테고리를 지원한다. 새 통합을 추가하려면 매니페스트와 `registerPlugin()` 호출만 있으면 되고, 코어 코드를 건드릴 필요가 없다.
|
|
109
|
-
|
|
110
107
|
### 위키 (Karpathy LLM-Wiki 패턴)
|
|
111
108
|
프로젝트별로 한 번 정리해 두면 TODO와 토론 프롬프트에 골라 주입할 수 있는 노드+엣지 지식 그래프. 매번 같은 도메인 컨텍스트를 붙여넣을 필요가 없다. List / Graph 뷰 토글(`@xyflow/react` + dagre 자동 레이아웃, drag-to-connect 엣지, `precedes`/`refines` 관계는 cycle 차단), todo마다 `None` / `All` / `Selected` / **`Auto`** 모드 선택 — `Auto`는 매 실행 직전 한 번의 LLM 호출로 관련 항목만 자동으로 골라 토큰을 절약한다. 전송 전 `<long_term_memory>` 블록을 char/token 추정치와 함께 미리볼 수 있고, **DB → `.clitrigger/wiki/<entity>/<slug>.md` Markdown 익스포트** + Disk diff로 git/Obsidian과 함께 살릴 수 있다. Lint는 중복/orphan/stale 항목에 인라인 fix 액션(merge / delete / link)을 제공하고, Activity 서브탭이 ingest / lint / retrieve / merge 이벤트를 시간순/severity로 보여준다. CLI-agnostic — Claude / Gemini / Codex 모두 동일한 컨텍스트를 받으며 어댑터 변경이 필요 없다.
|
|
112
109
|
|
|
110
|
+
<div align="center">
|
|
111
|
+
<img src="https://raw.githubusercontent.com/HyperAITeam/CLITrigger/main/docs/images/screenshot-wiki.png" alt="Wiki — 프로젝트별 지식 그래프" width="800">
|
|
112
|
+
<p><em>위키 그래프 뷰 — 항목이 태그(Concept · Decision · Feature · Pattern)별로 그룹화되고, 타입드 엣지로 아이디어 간 관계를 시각화. 매 프롬프트에 관련 항목만 선택적으로 주입</em></p>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
113
115
|
### Planner (플래너)
|
|
114
116
|
TODO와는 별개인 경량 작업 플래너 — 아이디어를 빠르게 적고, 이미지를 첨부하고, 색상 태그로 분류하고, 열 단위로 정렬할 수 있다. 플래너 항목을 한 번의 클릭으로 TODO나 예약 스케줄로 변환할 수 있다. Markdown Export / Import (status 섹션 + GFM 체크박스 + HTML 주석 메타데이터)로 다른 머신에 옮기거나 GitHub / Obsidian / 어떤 Markdown 뷰어에서도 그대로 열어볼 수 있고, `.md` 파일을 카드에 드래그하면 바로 Import된다.
|
|
115
117
|
|
|
@@ -124,6 +126,11 @@ TODO를 작성하면 각 작업마다 격리된 git worktree가 자동 생성된
|
|
|
124
126
|
### 인터랙티브 세션 (Sessions)
|
|
125
127
|
긴 생애주기의 인터랙티브 CLI 세션을 1급 엔티티로 관리 — Claude / Gemini / Codex 세션을 드래그 가능한 floating window에 띄운다. **VS Code 스타일 그룹화/도킹** 지원: 탭을 다른 윈도우로 드래그하면 5-zone 다이아몬드(top/bottom/left/right/center)로 분할 pane이나 탭 합치기가 가능하고, **Aero 스타일 엣지 스냅 + 윈도우 간 sticky 스냅 + dock tray 최소화**까지 — 멀티 세션 화면을 깔끔하게 정리할 수 있다. **xterm.js 렌더링**으로 ANSI 컬러, 커서 제어, TUI 박스 그리기까지 네이티브 터미널과 동일하게 표시된다. PTY가 정확한 viewport 크기로 spawn되고, **per-session 폰트 크기**(A−/A+ 또는 Ctrl/Cmd ±)로 가독성도 조절 가능. 세션별 위키 주입 모드와 **Send/Skip pre-flight** 배너로 자동 생성된 초기 프롬프트를 검토 후 명시적으로 보낼 수 있고, 인라인 편집 버튼으로 running이 아닌 세션은 그 자리에서 제목/CLI/모델/위키 주입 변경. iOS Safari 모바일은 한글 IME가 두벌식 composer로 정상 조립된다. Window 위치/크기/그룹 트리는 영속되고 탭 전환 후에도 살아남는다.
|
|
126
128
|
|
|
129
|
+
<div align="center">
|
|
130
|
+
<img src="https://raw.githubusercontent.com/HyperAITeam/CLITrigger/main/docs/images/screenshot-sessions.png" alt="Sessions — VS Code 스타일로 도킹된 멀티 CLI floating windows" width="800">
|
|
131
|
+
<p><em>VS Code 스타일 그룹화로 도킹된 Claude · Gemini · Codex 세션 — 각각 독립된 worktree 브랜치에서 동시 실행</em></p>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
127
134
|
### 다중 AI 토론 (Discussion)
|
|
128
135
|
아키텍트, 개발자, 리뷰어 등 역할이 다른 AI 에이전트들이 라운드 방식으로 토론한 뒤, 합의된 내용을 바탕으로 자동 구현까지 이어진다. 단일 AI의 판단보다 훨씬 검증된 설계 결과물이 나온다. **구현자(Implementer, `can_implement`)** 로 표시된 에이전트는 일반 턴에서도 코드를 커밋할 수 있고, 마지막 구현 라운드가 남은 작업을 정리해 마무리한다. 자동 구현(Auto-implement) 옵션을 켜면 토론 완료 즉시 코드 작성 라운드가 자동 실행된다. 완료된 토론에서 **Send to Planner** 버튼을 누르면 트랜스크립트를 한방 LLM 호출로 추출해 액션 아이템을 Planner로 영속한다 — 저장 전 항목별 편집 가능.
|
|
129
136
|
|
|
@@ -197,7 +204,7 @@ Cloudflare Tunnel로 어디서든 폰·노트북으로 제어한다. 작업이
|
|
|
197
204
|
- **macOS** — `CLITrigger-<version>.dmg` (Apple Silicon · Intel)
|
|
198
205
|
- **Linux** — `CLITrigger-<version>.AppImage`
|
|
199
206
|
|
|
200
|
-
데스크톱 앱은 Node.js와 네이티브 모듈(`better-sqlite3`, `node-pty`, `cloudflared`)을 모두 번들하므로 별도 런타임 설치가 필요 없다. 첫 실행 시 비밀번호를
|
|
207
|
+
데스크톱 앱은 Node.js와 네이티브 모듈(`better-sqlite3`, `node-pty`, `cloudflared`)을 모두 번들하므로 별도 런타임 설치가 필요 없다. 첫 실행 시 내장 브라우저에 셋업 화면이 떠서 거기서 비밀번호를 정하면 끝. 외부 공유(Cloudflare 터널)는 셋업이 완료될 때까지 자동 시작이 잠겨 있어서 첫 사용자는 항상 본인.
|
|
201
208
|
|
|
202
209
|
### 옵션 B — npm (개발자 권장)
|
|
203
210
|
|
|
@@ -206,13 +213,12 @@ npm i -g clitrigger
|
|
|
206
213
|
clitrigger
|
|
207
214
|
```
|
|
208
215
|
|
|
209
|
-
첫 실행 시 비밀번호 설정
|
|
210
|
-
브라우저에서 `http://localhost:3000` 접속 → 프로젝트 등록 → TODO 작성 → Start.
|
|
216
|
+
첫 실행 시 서버가 바로 시작된다. 브라우저에서 `http://localhost:3000` 접속 → 셋업 화면에서 비밀번호 설정 → 프로젝트 등록 → TODO 작성 → Start. 비밀번호는 이후 웹 UI의 설정 → 계정 탭에서 변경 가능.
|
|
211
217
|
|
|
212
218
|
```bash
|
|
213
219
|
# 설정 변경
|
|
214
220
|
clitrigger config port 8080 # 포트 변경
|
|
215
|
-
clitrigger config
|
|
221
|
+
clitrigger config tunnel on # 외부 공유용 Cloudflare 터널 활성화
|
|
216
222
|
```
|
|
217
223
|
|
|
218
224
|
> **사전 요구사항**: Node.js 20+, Git, 사용할 AI CLI (Claude / Gemini / Codex 중 하나 이상)
|
|
@@ -234,7 +240,8 @@ cd src/client && npm install && cd ../..
|
|
|
234
240
|
|
|
235
241
|
# 2. 환경 설정
|
|
236
242
|
cp .env.example .env
|
|
237
|
-
#
|
|
243
|
+
# AUTH_PASSWORD는 이제 선택사항 — 비워두면 첫 브라우저 접속 시 셋업 화면이 뜬다.
|
|
244
|
+
# 셋업을 건너뛰고 싶을 때만 미리 값을 박아두면 된다.
|
|
238
245
|
|
|
239
246
|
# 3. 실행
|
|
240
247
|
npm run dev
|
|
@@ -304,6 +311,20 @@ cloudflared tunnel route dns <tunnel-name> app.your-domain.com # 한 번만
|
|
|
304
311
|
|
|
305
312
|
---
|
|
306
313
|
|
|
314
|
+
## Star & 함께 만들기
|
|
315
|
+
|
|
316
|
+
CLITrigger가 시간을 아껴 줬다면 [**Star 한 번 눌러주세요**](https://github.com/HyperAITeam/CLITrigger) — 더 많은 개발자에게 닿는 데 정말 큰 도움이 됩니다.
|
|
317
|
+
|
|
318
|
+
다음 모습을 함께 그려갈 분들을 기다리고 있어요:
|
|
319
|
+
|
|
320
|
+
- **이슈 등록** — 버그 제보, 기능 제안, 거친 아이디어 모두 환영합니다 → [Issues](https://github.com/HyperAITeam/CLITrigger/issues)
|
|
321
|
+
- **PR 보내기** — [`good first issue`](https://github.com/HyperAITeam/CLITrigger/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 라벨부터 시작하거나, 직접 거슬리는 부분을 고쳐도 좋아요
|
|
322
|
+
- **사용기 공유** — 워크트리 활용법, 커스텀 플러그인, 생산성 팁을 [Discussions](https://github.com/HyperAITeam/CLITrigger/discussions)에 풀어주세요
|
|
323
|
+
|
|
324
|
+
Star 하나, 이슈 하나, PR 하나가 프로젝트 속도를 바꿉니다. 감사합니다 🙏
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
307
328
|
## 기여자 (Contributors)
|
|
308
329
|
|
|
309
330
|
CLITrigger에 기여해 주신 모든 분들께 감사드립니다!
|
package/bin/clitrigger.js
CHANGED
|
@@ -7,6 +7,7 @@ import { createInterface } from 'readline/promises';
|
|
|
7
7
|
|
|
8
8
|
const CONFIG_DIR = path.join(os.homedir(), '.clitrigger');
|
|
9
9
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
10
|
+
const MIGRATED_FLAG = path.join(CONFIG_DIR, '.password-migrated');
|
|
10
11
|
|
|
11
12
|
const args = process.argv.slice(2);
|
|
12
13
|
|
|
@@ -22,44 +23,32 @@ if (args[0] === 'config') {
|
|
|
22
23
|
async function startServer() {
|
|
23
24
|
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
24
25
|
|
|
25
|
-
// 첫 실행:
|
|
26
|
+
// 첫 실행: 기본 config 생성 (비밀번호는 웹 첫 화면에서 설정)
|
|
26
27
|
if (!fs.existsSync(CONFIG_FILE)) {
|
|
27
|
-
|
|
28
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
29
|
-
|
|
30
|
-
let password = '';
|
|
31
|
-
while (!password) {
|
|
32
|
-
password = await rl.question('Set a password: ');
|
|
33
|
-
if (!password) console.log('Password is required.');
|
|
34
|
-
}
|
|
35
|
-
rl.close();
|
|
36
|
-
|
|
37
|
-
const config = { port: 3000, password, tunnel: true };
|
|
28
|
+
const config = { port: 3000, tunnel: true };
|
|
38
29
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
39
|
-
console.log(
|
|
30
|
+
console.log('Welcome to CLITrigger!');
|
|
31
|
+
console.log(`Config created at ${CONFIG_FILE}`);
|
|
32
|
+
console.log('Open the web UI to set your password on first launch.\n');
|
|
40
33
|
}
|
|
41
34
|
|
|
42
|
-
// config 읽고 env 설정
|
|
43
35
|
const config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
44
36
|
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let password = '';
|
|
50
|
-
while (!password) {
|
|
51
|
-
password = await rl.question('Set a password: ');
|
|
52
|
-
if (!password) console.log('Password is required.');
|
|
53
|
-
}
|
|
54
|
-
rl.close();
|
|
55
|
-
config.password = password;
|
|
37
|
+
// Legacy plaintext cleanup: server has migrated to hashed credential, drop the
|
|
38
|
+
// plaintext field from disk.
|
|
39
|
+
if (fs.existsSync(MIGRATED_FLAG) && config.password) {
|
|
40
|
+
delete config.password;
|
|
56
41
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
57
|
-
|
|
42
|
+
try { fs.unlinkSync(MIGRATED_FLAG); } catch { /* ignore */ }
|
|
58
43
|
}
|
|
59
44
|
|
|
60
45
|
process.env.PORT = String(config.port || 3000);
|
|
61
|
-
process.env.AUTH_PASSWORD = config.password;
|
|
62
46
|
process.env.DB_PATH = path.join(CONFIG_DIR, 'clitrigger.db');
|
|
47
|
+
// Pass legacy plaintext password through to the server one last time so it
|
|
48
|
+
// can migrate to a scrypt hash. Removed from disk on the next launch.
|
|
49
|
+
if (config.password) {
|
|
50
|
+
process.env.AUTH_PASSWORD = config.password;
|
|
51
|
+
}
|
|
63
52
|
// tunnel defaults to true (auto-enable for new and existing users)
|
|
64
53
|
if (config.tunnel !== false) {
|
|
65
54
|
process.env.TUNNEL_ENABLED = 'true';
|
|
@@ -116,16 +105,9 @@ async function handleConfig(args) {
|
|
|
116
105
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
117
106
|
console.log(`Port changed to ${port}.`);
|
|
118
107
|
} else if (args[0] === 'password') {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
password = await rl.question('New password: ');
|
|
123
|
-
if (!password) console.log('Password is required.');
|
|
124
|
-
}
|
|
125
|
-
rl.close();
|
|
126
|
-
config.password = password;
|
|
127
|
-
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
128
|
-
console.log('Password changed.');
|
|
108
|
+
console.log('Password is now managed in the web UI.');
|
|
109
|
+
console.log(' • First launch: open the browser and set a password on the setup screen.');
|
|
110
|
+
console.log(' • Change later: open Settings → Account in the web UI.');
|
|
129
111
|
} else if (args[0] === 'path') {
|
|
130
112
|
console.log(CONFIG_DIR);
|
|
131
113
|
} else if (args[0] === 'tunnel') {
|
|
@@ -177,7 +159,7 @@ async function handleConfig(args) {
|
|
|
177
159
|
} else {
|
|
178
160
|
console.log(`Config (${CONFIG_FILE}):`);
|
|
179
161
|
console.log(` Port: ${config.port || 3000}`);
|
|
180
|
-
console.log(` Password:
|
|
162
|
+
console.log(` Password: managed in web UI (Settings → Account)`);
|
|
181
163
|
console.log(` Tunnel: ${config.tunnel ? 'enabled' : 'disabled'}`);
|
|
182
164
|
if (config.tunnelName) console.log(` Tunnel name: ${config.tunnelName}`);
|
|
183
165
|
if (config.tunnelHostname) console.log(` Tunnel hostname: ${config.tunnelHostname}`);
|
|
@@ -226,10 +208,9 @@ function printHelp() {
|
|
|
226
208
|
CLITrigger - AI-powered task execution tool
|
|
227
209
|
|
|
228
210
|
Usage:
|
|
229
|
-
clitrigger Start the server
|
|
211
|
+
clitrigger Start the server (set password on first launch in browser)
|
|
230
212
|
clitrigger config Show current config
|
|
231
213
|
clitrigger config port <n> Change port
|
|
232
|
-
clitrigger config password Change password
|
|
233
214
|
clitrigger config tunnel on Enable Cloudflare tunnel
|
|
234
215
|
clitrigger config tunnel on <name> Enable named tunnel
|
|
235
216
|
clitrigger config tunnel off Disable tunnel
|
|
@@ -240,5 +221,7 @@ Usage:
|
|
|
240
221
|
clitrigger config path Print config directory path
|
|
241
222
|
clitrigger config clear Delete all config and data
|
|
242
223
|
clitrigger --help Show this help
|
|
224
|
+
|
|
225
|
+
Password is managed in the web UI (Settings → Account).
|
|
243
226
|
`.trim());
|
|
244
227
|
}
|