commandmate 0.1.0 → 0.1.5
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 +5 -31
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +4 -1
- package/dist/cli/utils/daemon.d.ts.map +1 -1
- package/dist/cli/utils/daemon.js +4 -2
- package/dist/cli/utils/paths.d.ts +25 -0
- package/dist/cli/utils/paths.d.ts.map +1 -0
- package/dist/cli/utils/paths.js +35 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -51,37 +51,9 @@ Claude Code での開発経験があり、本業の傍らで個人開発を続
|
|
|
51
51
|
- Node.js v20+、npm、git、tmux、openssl
|
|
52
52
|
- Claude CLI(CLAUDE_HOOKS_STOP 対応)
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
> **Tip**: `./scripts/preflight-check.sh` で依存関係を確認できます。
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
# グローバルインストール
|
|
58
|
-
npm install -g commandmate
|
|
59
|
-
|
|
60
|
-
# 初期化(依存関係チェック、.env作成、DB初期化)
|
|
61
|
-
commandmate init
|
|
62
|
-
|
|
63
|
-
# サーバー起動
|
|
64
|
-
commandmate start
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
ブラウザで http://localhost:3000 にアクセスしてください。
|
|
68
|
-
|
|
69
|
-
#### CLIコマンド一覧
|
|
70
|
-
|
|
71
|
-
| コマンド | 説明 |
|
|
72
|
-
|---------|------|
|
|
73
|
-
| `commandmate --version` | バージョン表示 |
|
|
74
|
-
| `commandmate init` | 初期化(対話形式で設定) |
|
|
75
|
-
| `commandmate init --defaults` | デフォルト値で初期化(非対話) |
|
|
76
|
-
| `commandmate start` | サーバー起動(フォアグラウンド) |
|
|
77
|
-
| `commandmate start --dev` | 開発モードで起動 |
|
|
78
|
-
| `commandmate start --daemon` | バックグラウンドで起動 |
|
|
79
|
-
| `commandmate stop` | サーバー停止 |
|
|
80
|
-
| `commandmate status` | サーバー状態確認 |
|
|
81
|
-
|
|
82
|
-
### シェルスクリプトによるセットアップ(レガシー)
|
|
83
|
-
|
|
84
|
-
> **Note**: シェルスクリプトは非推奨です。CLIコマンドの使用を推奨します。
|
|
56
|
+
### セットアップ
|
|
85
57
|
|
|
86
58
|
```bash
|
|
87
59
|
git clone https://github.com/Kewton/CommandMate.git
|
|
@@ -89,6 +61,8 @@ cd CommandMate
|
|
|
89
61
|
./scripts/setup.sh # 依存チェック、環境設定、ビルド、起動まで自動実行
|
|
90
62
|
```
|
|
91
63
|
|
|
64
|
+
ブラウザで http://localhost:3000 にアクセスしてください。
|
|
65
|
+
|
|
92
66
|
### 手動セットアップ(カスタマイズしたい場合)
|
|
93
67
|
|
|
94
68
|
```bash
|
|
@@ -102,7 +76,7 @@ npm run build
|
|
|
102
76
|
npm start
|
|
103
77
|
```
|
|
104
78
|
|
|
105
|
-
スマホから利用する場合は
|
|
79
|
+
スマホから利用する場合は `./scripts/setup-env.sh` で外部アクセスを有効にすると、`CM_BIND=0.0.0.0` と `CM_AUTH_TOKEN` が自動設定されます。同一LAN内から `http://<PCのIP>:3000` にアクセスします。
|
|
106
80
|
|
|
107
81
|
> **Note**: 旧名称の環境変数(`MCBD_*`)も後方互換性のためサポートされていますが、新名称(`CM_*`)の使用を推奨します。
|
|
108
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,YAAY,EAAY,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,YAAY,EAAY,MAAM,UAAU,CAAC;AASlD;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuHvE"}
|
|
@@ -13,6 +13,7 @@ const types_1 = require("../types");
|
|
|
13
13
|
const logger_1 = require("../utils/logger");
|
|
14
14
|
const daemon_1 = require("../utils/daemon");
|
|
15
15
|
const security_logger_1 = require("../utils/security-logger");
|
|
16
|
+
const paths_1 = require("../utils/paths");
|
|
16
17
|
const logger = new logger_1.CLILogger();
|
|
17
18
|
const PID_FILE = (0, path_1.join)(process.cwd(), '.commandmate.pid');
|
|
18
19
|
/**
|
|
@@ -77,8 +78,10 @@ async function startCommand(options) {
|
|
|
77
78
|
if (options.port) {
|
|
78
79
|
env.CM_PORT = String(options.port);
|
|
79
80
|
}
|
|
81
|
+
// Use package installation directory, not current working directory
|
|
82
|
+
const packageRoot = (0, paths_1.getPackageRoot)();
|
|
80
83
|
const child = (0, child_process_1.spawn)('npm', ['run', npmScript], {
|
|
81
|
-
cwd:
|
|
84
|
+
cwd: packageRoot,
|
|
82
85
|
env,
|
|
83
86
|
stdio: 'inherit',
|
|
84
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/daemon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/daemon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAItD;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;gBAEnB,WAAW,EAAE,MAAM;IAI/B;;;;OAIG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IA8CnD;;;;OAIG;IACG,IAAI,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IA8BpD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA6B/C;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;OAEG;YACW,WAAW;CAiB1B"}
|
package/dist/cli/utils/daemon.js
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.DaemonManager = void 0;
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
10
|
const pid_manager_1 = require("./pid-manager");
|
|
11
|
+
const paths_1 = require("./paths");
|
|
11
12
|
/**
|
|
12
13
|
* Daemon manager for background server process
|
|
13
14
|
*/
|
|
@@ -29,7 +30,8 @@ class DaemonManager {
|
|
|
29
30
|
// Clean up stale PID file
|
|
30
31
|
this.pidManager.removePid();
|
|
31
32
|
const npmScript = options.dev ? 'dev' : 'start';
|
|
32
|
-
|
|
33
|
+
// Use package installation directory, not current working directory
|
|
34
|
+
const packageRoot = (0, paths_1.getPackageRoot)();
|
|
33
35
|
// Build environment
|
|
34
36
|
const env = { ...process.env };
|
|
35
37
|
if (options.port) {
|
|
@@ -37,7 +39,7 @@ class DaemonManager {
|
|
|
37
39
|
}
|
|
38
40
|
// Spawn detached process
|
|
39
41
|
const child = (0, child_process_1.spawn)('npm', ['run', npmScript], {
|
|
40
|
-
cwd,
|
|
42
|
+
cwd: packageRoot,
|
|
41
43
|
env,
|
|
42
44
|
detached: true,
|
|
43
45
|
stdio: 'ignore',
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path Utilities for CLI
|
|
3
|
+
* Issue #96: npm install CLI support
|
|
4
|
+
*
|
|
5
|
+
* Provides utilities to resolve package installation directory
|
|
6
|
+
* regardless of where the CLI is invoked from.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Get the root directory of the CommandMate package installation.
|
|
10
|
+
*
|
|
11
|
+
* When installed globally via npm, the CLI runs from:
|
|
12
|
+
* <global-modules>/commandmate/dist/cli/utils/paths.js
|
|
13
|
+
*
|
|
14
|
+
* This function returns the package root:
|
|
15
|
+
* <global-modules>/commandmate/
|
|
16
|
+
*
|
|
17
|
+
* @returns Absolute path to the package root directory
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPackageRoot(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Get the path to package.json
|
|
22
|
+
* @returns Absolute path to package.json
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPackageJsonPath(): string;
|
|
25
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Path Utilities for CLI
|
|
4
|
+
* Issue #96: npm install CLI support
|
|
5
|
+
*
|
|
6
|
+
* Provides utilities to resolve package installation directory
|
|
7
|
+
* regardless of where the CLI is invoked from.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getPackageRoot = getPackageRoot;
|
|
11
|
+
exports.getPackageJsonPath = getPackageJsonPath;
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
/**
|
|
14
|
+
* Get the root directory of the CommandMate package installation.
|
|
15
|
+
*
|
|
16
|
+
* When installed globally via npm, the CLI runs from:
|
|
17
|
+
* <global-modules>/commandmate/dist/cli/utils/paths.js
|
|
18
|
+
*
|
|
19
|
+
* This function returns the package root:
|
|
20
|
+
* <global-modules>/commandmate/
|
|
21
|
+
*
|
|
22
|
+
* @returns Absolute path to the package root directory
|
|
23
|
+
*/
|
|
24
|
+
function getPackageRoot() {
|
|
25
|
+
// __dirname points to dist/cli/utils when this file is compiled
|
|
26
|
+
// We need to go up 3 levels: utils → cli → dist → package root
|
|
27
|
+
return (0, path_1.join)(__dirname, '..', '..', '..');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the path to package.json
|
|
31
|
+
* @returns Absolute path to package.json
|
|
32
|
+
*/
|
|
33
|
+
function getPackageJsonPath() {
|
|
34
|
+
return (0, path_1.join)(getPackageRoot(), 'package.json');
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commandmate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Git worktree management with Claude CLI and tmux sessions",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Kewton/CommandMate.git"
|
|
8
|
+
},
|
|
5
9
|
"bin": {
|
|
6
10
|
"commandmate": "./bin/commandmate.js"
|
|
7
11
|
},
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
"isomorphic-dompurify": "^2.35.0",
|
|
40
44
|
"lucide-react": "^0.554.0",
|
|
41
45
|
"mermaid": "^11.12.2",
|
|
42
|
-
"next": "^14.2.
|
|
46
|
+
"next": "^14.2.35",
|
|
43
47
|
"postcss": "^8.5.6",
|
|
44
48
|
"react": "^18.3.0",
|
|
45
49
|
"react-dom": "^18.3.0",
|
|
@@ -69,7 +73,7 @@
|
|
|
69
73
|
"@vitest/coverage-v8": "^4.0.16",
|
|
70
74
|
"@vitest/ui": "^4.0.9",
|
|
71
75
|
"eslint": "^8.57.0",
|
|
72
|
-
"eslint-config-next": "^14.2.
|
|
76
|
+
"eslint-config-next": "^14.2.35",
|
|
73
77
|
"tailwindcss": "^3.4.18",
|
|
74
78
|
"tsx": "^4.20.6",
|
|
75
79
|
"typescript": "^5.5.0",
|