@elyun/bylane 1.28.0 → 1.29.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/package.json +1 -1
- package/src/cli.js +43 -5
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { mkdirSync, symlinkSync, existsSync, readdirSync, copyFileSync, renameSync, readFileSync, writeFileSync } from 'fs'
|
|
2
|
+
import { mkdirSync, symlinkSync, existsSync, readdirSync, copyFileSync, renameSync, readFileSync, writeFileSync, rmSync } from 'fs'
|
|
3
3
|
import { join, dirname } from 'path'
|
|
4
4
|
import { fileURLToPath } from 'url'
|
|
5
5
|
import { homedir } from 'os'
|
|
@@ -33,10 +33,8 @@ function backupAndCopy(src, dest, file, label) {
|
|
|
33
33
|
console.log(` = ${label}: ${file} (변경 없음, 건너뜀)`)
|
|
34
34
|
return
|
|
35
35
|
}
|
|
36
|
-
const backupPath = `${destFile}.bak`
|
|
37
|
-
renameSync(destFile, backupPath)
|
|
38
36
|
copyFileSync(srcFile, destFile)
|
|
39
|
-
console.log(` ~ ${label}: ${file} (
|
|
37
|
+
console.log(` ~ ${label}: ${file} (업데이트됨)`)
|
|
40
38
|
} else {
|
|
41
39
|
copyFileSync(srcFile, destFile)
|
|
42
40
|
console.log(` + ${label}: ${file}`)
|
|
@@ -139,8 +137,48 @@ function install() {
|
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
|
|
140
|
+
function uninstall() {
|
|
141
|
+
console.log('\n byLane 제거 중...\n')
|
|
142
|
+
|
|
143
|
+
for (const { src, dest, label } of TARGETS) {
|
|
144
|
+
if (!existsSync(dest)) continue
|
|
145
|
+
const files = readdirSync(src)
|
|
146
|
+
for (const file of files) {
|
|
147
|
+
const destFile = join(dest, file)
|
|
148
|
+
if (existsSync(destFile)) {
|
|
149
|
+
rmSync(destFile)
|
|
150
|
+
console.log(` - ${label}: ${file}`)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// settings.json에서 bylane 훅 제거
|
|
156
|
+
const settingsPath = join(CLAUDE_DIR, 'settings.json')
|
|
157
|
+
if (existsSync(settingsPath)) {
|
|
158
|
+
try {
|
|
159
|
+
const settings = JSON.parse(readFileSync(settingsPath, 'utf8'))
|
|
160
|
+
const stripBylane = (arr) =>
|
|
161
|
+
(arr ?? []).filter(h => !h.hooks?.some(hh => hh.command?.includes('bylane-agent-tracker')))
|
|
162
|
+
settings.hooks = settings.hooks ?? {}
|
|
163
|
+
settings.hooks.PreToolUse = stripBylane(settings.hooks.PreToolUse)
|
|
164
|
+
settings.hooks.PostToolUse = stripBylane(settings.hooks.PostToolUse)
|
|
165
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2))
|
|
166
|
+
console.log(' - Hook: bylane-agent-tracker 제거')
|
|
167
|
+
} catch {}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
console.log(`
|
|
171
|
+
byLane 제거 완료.
|
|
172
|
+
|
|
173
|
+
사용자 설정(.bylane/bylane.json)은 유지됩니다.
|
|
174
|
+
Claude Code를 재시작하면 변경사항이 적용됩니다.
|
|
175
|
+
`)
|
|
176
|
+
}
|
|
177
|
+
|
|
142
178
|
if (command === 'install') {
|
|
143
179
|
install()
|
|
180
|
+
} else if (command === 'uninstall') {
|
|
181
|
+
uninstall()
|
|
144
182
|
} else if (command === 'preflight') {
|
|
145
183
|
const { runPreflight, formatPreflight } = await import('./preflight.js')
|
|
146
184
|
const result = runPreflight()
|
|
@@ -320,6 +358,6 @@ if (command === 'install') {
|
|
|
320
358
|
child.on('exit', code => process.exit(code ?? 0))
|
|
321
359
|
} else {
|
|
322
360
|
console.error(`알 수 없는 명령: ${command}`)
|
|
323
|
-
console.error('사용법: npx @elyun/bylane [install|loop|monitor|preflight|state|memory|cleanup] [--symlink]')
|
|
361
|
+
console.error('사용법: npx @elyun/bylane [install|uninstall|loop|monitor|preflight|state|memory|cleanup] [--symlink]')
|
|
324
362
|
process.exit(1)
|
|
325
363
|
}
|