quickclaude 1.0.0 → 1.0.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/README.md +42 -0
- package/bin/quickclaude.js +4 -4
- package/package.json +2 -2
- package/src/index.js +0 -109
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# quickclaude
|
|
2
|
+
|
|
3
|
+
Quickly launch Claude Code in your project directories.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ quickclaude
|
|
7
|
+
|
|
8
|
+
┌ quickclaude
|
|
9
|
+
│
|
|
10
|
+
◆ 프로젝트를 선택하세요
|
|
11
|
+
│ ● ~/Documents/projects/autogeek
|
|
12
|
+
│ ○ ~/Documents/projects/my-app
|
|
13
|
+
│ ○ ~/Documents/projects/website
|
|
14
|
+
└
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g quickclaude
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or run without installing:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx quickclaude
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How it works
|
|
30
|
+
|
|
31
|
+
1. Scans `~/.claude/projects/` for Claude Code project directories
|
|
32
|
+
2. Shows an interactive list to pick from
|
|
33
|
+
3. Launches `claude` in the selected directory
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
|
|
38
|
+
- Node.js 18+
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/bin/quickclaude.js
CHANGED
|
@@ -75,12 +75,12 @@ async function main() {
|
|
|
75
75
|
const projects = getProjects();
|
|
76
76
|
|
|
77
77
|
if (projects.length === 0) {
|
|
78
|
-
p.cancel("Claude
|
|
78
|
+
p.cancel("No Claude projects found.");
|
|
79
79
|
process.exit(1);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const selected = await p.select({
|
|
83
|
-
message: "
|
|
83
|
+
message: "Select a project",
|
|
84
84
|
options: projects.map((proj) => ({
|
|
85
85
|
value: proj.path,
|
|
86
86
|
label: getProjectLabel(proj.path),
|
|
@@ -88,11 +88,11 @@ async function main() {
|
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
if (p.isCancel(selected)) {
|
|
91
|
-
p.cancel("
|
|
91
|
+
p.cancel("Cancelled");
|
|
92
92
|
process.exit(0);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
p.outro(
|
|
95
|
+
p.outro(`Launching Claude in ${selected}`);
|
|
96
96
|
|
|
97
97
|
// claude 실행 (현재 터미널에서 interactive하게)
|
|
98
98
|
const child = spawn("claude", [], {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickclaude",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Quickly launch Claude Code in your project directories",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"quickclaude": "bin/quickclaude.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "node
|
|
10
|
+
"start": "node bin/quickclaude.js"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"claude",
|
package/src/index.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import * as p from "@clack/prompts";
|
|
4
|
-
import { readdirSync, existsSync } from "fs";
|
|
5
|
-
import { join, sep } from "path";
|
|
6
|
-
import { homedir } from "os";
|
|
7
|
-
import { execSync, spawn } from "child_process";
|
|
8
|
-
|
|
9
|
-
const CLAUDE_PROJECTS_DIR = join(homedir(), ".claude", "projects");
|
|
10
|
-
|
|
11
|
-
// 인코딩된 디렉토리명에서 실제 경로를 복원
|
|
12
|
-
// "-Users-seunghyunhong-Documents-projects-mcp-overwatch" 같은 경우
|
|
13
|
-
// -를 /로 바꾸면 mcp/overwatch가 되어 틀려짐
|
|
14
|
-
// → 파일시스템을 실제로 탐색하며 매칭
|
|
15
|
-
function resolvePath(encoded) {
|
|
16
|
-
const parts = encoded.replace(/^-/, "").split("-");
|
|
17
|
-
let current = sep;
|
|
18
|
-
|
|
19
|
-
let i = 0;
|
|
20
|
-
while (i < parts.length) {
|
|
21
|
-
let matched = false;
|
|
22
|
-
// 긴 조합부터 시도 (mcp-overwatch, Unreal Projects 등)
|
|
23
|
-
for (let len = parts.length - i; len >= 1; len--) {
|
|
24
|
-
const segment = parts.slice(i, i + len);
|
|
25
|
-
// "-"와 " " 두 가지 구분자 조합을 모두 시도
|
|
26
|
-
const separators = ["-", " "];
|
|
27
|
-
for (const joiner of separators) {
|
|
28
|
-
const candidate = segment.join(joiner);
|
|
29
|
-
const fullPath = join(current, candidate);
|
|
30
|
-
if (existsSync(fullPath)) {
|
|
31
|
-
current = fullPath;
|
|
32
|
-
i += len;
|
|
33
|
-
matched = true;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (matched) break;
|
|
38
|
-
}
|
|
39
|
-
if (!matched) return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return current;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function getProjects() {
|
|
46
|
-
if (!existsSync(CLAUDE_PROJECTS_DIR)) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const entries = readdirSync(CLAUDE_PROJECTS_DIR, { withFileTypes: true });
|
|
51
|
-
|
|
52
|
-
return entries
|
|
53
|
-
.filter((e) => e.isDirectory())
|
|
54
|
-
.map((e) => {
|
|
55
|
-
const path = resolvePath(e.name);
|
|
56
|
-
return { dirName: e.name, path };
|
|
57
|
-
})
|
|
58
|
-
.filter((p) => {
|
|
59
|
-
if (!p.path) return false;
|
|
60
|
-
if (p.path.includes(`claude${sep}worktrees`)) return false;
|
|
61
|
-
return existsSync(p.path);
|
|
62
|
-
})
|
|
63
|
-
.sort((a, b) => a.path.localeCompare(b.path));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getProjectLabel(path) {
|
|
67
|
-
const home = homedir();
|
|
68
|
-
const display = path.startsWith(home) ? "~" + path.slice(home.length) : path;
|
|
69
|
-
return display;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function main() {
|
|
73
|
-
p.intro("quickclaude");
|
|
74
|
-
|
|
75
|
-
const projects = getProjects();
|
|
76
|
-
|
|
77
|
-
if (projects.length === 0) {
|
|
78
|
-
p.cancel("Claude 프로젝트를 찾을 수 없습니다.");
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const selected = await p.select({
|
|
83
|
-
message: "프로젝트를 선택하세요",
|
|
84
|
-
options: projects.map((proj) => ({
|
|
85
|
-
value: proj.path,
|
|
86
|
-
label: getProjectLabel(proj.path),
|
|
87
|
-
})),
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
if (p.isCancel(selected)) {
|
|
91
|
-
p.cancel("취소됨");
|
|
92
|
-
process.exit(0);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
p.outro(`${selected} 에서 Claude 시작...`);
|
|
96
|
-
|
|
97
|
-
// claude 실행 (현재 터미널에서 interactive하게)
|
|
98
|
-
const child = spawn("claude", [], {
|
|
99
|
-
cwd: selected,
|
|
100
|
-
stdio: "inherit",
|
|
101
|
-
shell: true,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
child.on("exit", (code) => {
|
|
105
|
-
process.exit(code ?? 0);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
main();
|