@say8425/cc-statusline 2.0.0 → 2.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/package.json +3 -4
- package/src/index.ts +0 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@say8425/cc-statusline",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/say8425/cc-statusline.git"
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
"typescript": "^5.9.3"
|
|
12
12
|
},
|
|
13
13
|
"bin": {
|
|
14
|
-
"cc-statusline": "
|
|
14
|
+
"cc-statusline": "dist/index.js"
|
|
15
15
|
},
|
|
16
16
|
"description": "Custom statusline for Claude Code",
|
|
17
17
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
"src/lib.ts"
|
|
18
|
+
"dist/index.js"
|
|
20
19
|
],
|
|
21
20
|
"publishConfig": {
|
|
22
21
|
"registry": "https://registry.npmjs.org"
|
package/src/index.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { parseCliArgs } from "./cli.ts";
|
|
4
|
-
import {
|
|
5
|
-
getBranchCached,
|
|
6
|
-
getGitChangesCached,
|
|
7
|
-
getPrUrlCached,
|
|
8
|
-
} from "./git/index.ts";
|
|
9
|
-
import { renderStatusLine } from "./render.ts";
|
|
10
|
-
import { readStdin } from "./stdin.ts";
|
|
11
|
-
import type { ClaudeStatusInput } from "./types.ts";
|
|
12
|
-
import { getUsageCached } from "./usage/index.ts";
|
|
13
|
-
|
|
14
|
-
// 메인 함수
|
|
15
|
-
export async function main(cliArgs?: string[]): Promise<void> {
|
|
16
|
-
// CLI 인자 파싱
|
|
17
|
-
const args = cliArgs ?? process.argv.slice(2);
|
|
18
|
-
const { showUsage } = parseCliArgs(args);
|
|
19
|
-
|
|
20
|
-
// 1. stdin에서 Claude Code JSON 읽기 (empty stdin 처리)
|
|
21
|
-
const claudeJson: ClaudeStatusInput = JSON.parse((await readStdin()) || "{}");
|
|
22
|
-
|
|
23
|
-
// 2. Git 정보 + 사용량 (캐싱, 병렬 실행)
|
|
24
|
-
const [branch, gitChanges, prUrl, blockUsage] = await Promise.all([
|
|
25
|
-
getBranchCached(),
|
|
26
|
-
getGitChangesCached(),
|
|
27
|
-
getPrUrlCached(),
|
|
28
|
-
showUsage ? getUsageCached() : Promise.resolve(null),
|
|
29
|
-
]);
|
|
30
|
-
|
|
31
|
-
// 3. 렌더링 및 출력
|
|
32
|
-
const lines = renderStatusLine({
|
|
33
|
-
claudeJson,
|
|
34
|
-
branch,
|
|
35
|
-
gitChanges,
|
|
36
|
-
prUrl,
|
|
37
|
-
blockUsage,
|
|
38
|
-
showUsage,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
for (const line of lines) {
|
|
42
|
-
console.log(line);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (import.meta.main) {
|
|
47
|
-
main().catch(console.error);
|
|
48
|
-
}
|