@maestroai/cli 0.1.1 → 0.1.2

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.
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createProgram
4
- } from "../chunk-5ZDNPLKN.js";
4
+ } from "../chunk-RWLHK222.js";
5
+ import "../chunk-A3PN4QCM.js";
5
6
 
6
7
  // bin/maestro.ts
7
8
  var program = createProgram();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/maestro.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createProgram } from '../src/index.js';\n\nconst program = createProgram();\nprogram.parse();\n"],"mappings":";;;;;;AAGA,IAAM,UAAU,cAAc;AAC9B,QAAQ,MAAM;","names":[]}
1
+ {"version":3,"sources":["../../bin/maestro.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createProgram } from '../src/index.js';\n\nconst program = createProgram();\nprogram.parse();\n"],"mappings":";;;;;;;AAGA,IAAM,UAAU,cAAc;AAC9B,QAAQ,MAAM;","names":[]}
@@ -0,0 +1,69 @@
1
+ // src/utils/claude-check.ts
2
+ import { existsSync } from "fs";
3
+ import { execSync } from "child_process";
4
+ import path from "path";
5
+ import os from "os";
6
+ function checkClaudeInstalled() {
7
+ try {
8
+ const claudePath = execSync("command -v claude", { encoding: "utf-8" }).trim();
9
+ if (!claudePath) {
10
+ const homeDir = os.homedir();
11
+ const commonPaths = [
12
+ path.join(homeDir, ".local", "bin", "claude"),
13
+ "/usr/local/bin/claude",
14
+ path.join(homeDir, "bin", "claude")
15
+ ];
16
+ for (const checkPath of commonPaths) {
17
+ if (existsSync(checkPath)) {
18
+ try {
19
+ const version2 = execSync("claude --version", { encoding: "utf-8" }).trim();
20
+ return { installed: true, path: checkPath, version: version2 };
21
+ } catch {
22
+ return { installed: true, path: checkPath };
23
+ }
24
+ }
25
+ }
26
+ return {
27
+ installed: false,
28
+ error: "Claude CLI not found in PATH or common installation directories"
29
+ };
30
+ }
31
+ let version;
32
+ try {
33
+ version = execSync("claude --version", { encoding: "utf-8" }).trim();
34
+ } catch {
35
+ }
36
+ return { installed: true, path: claudePath, version };
37
+ } catch (error) {
38
+ return {
39
+ installed: false,
40
+ error: error instanceof Error ? error.message : "Unknown error"
41
+ };
42
+ }
43
+ }
44
+ function getClaudeInstallInstructions() {
45
+ const platform = os.platform();
46
+ if (platform === "darwin") {
47
+ return `Install Claude CLI for macOS:
48
+ npm install -g @anthropic-ai/claude-code
49
+
50
+ Or using Homebrew:
51
+ brew install anthropic/claude/claude-code`;
52
+ }
53
+ if (platform === "linux") {
54
+ return `Install Claude CLI for Linux:
55
+ npm install -g @anthropic-ai/claude-code`;
56
+ }
57
+ if (platform === "win32") {
58
+ return `Install Claude CLI for Windows:
59
+ npm install -g @anthropic-ai/claude-code`;
60
+ }
61
+ return `Install Claude CLI:
62
+ npm install -g @anthropic-ai/claude-code`;
63
+ }
64
+
65
+ export {
66
+ checkClaudeInstalled,
67
+ getClaudeInstallInstructions
68
+ };
69
+ //# sourceMappingURL=chunk-A3PN4QCM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/claude-check.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport path from 'node:path';\nimport os from 'node:os';\n\n/**\n * Checks if the Claude CLI is installed and accessible\n */\nexport function checkClaudeInstalled(): {\n installed: boolean;\n path?: string;\n version?: string;\n error?: string;\n} {\n try {\n // Try to get claude command path\n const claudePath = execSync('command -v claude', { encoding: 'utf-8' }).trim();\n\n if (!claudePath) {\n // Also check common installation paths\n const homeDir = os.homedir();\n const commonPaths = [\n path.join(homeDir, '.local', 'bin', 'claude'),\n '/usr/local/bin/claude',\n path.join(homeDir, 'bin', 'claude'),\n ];\n\n for (const checkPath of commonPaths) {\n if (existsSync(checkPath)) {\n // Try to get version\n try {\n const version = execSync('claude --version', { encoding: 'utf-8' }).trim();\n return { installed: true, path: checkPath, version };\n } catch {\n return { installed: true, path: checkPath };\n }\n }\n }\n\n return {\n installed: false,\n error: 'Claude CLI not found in PATH or common installation directories',\n };\n }\n\n // Get version\n let version: string | undefined;\n try {\n version = execSync('claude --version', { encoding: 'utf-8' }).trim();\n } catch {\n // Version check failed, but command exists\n }\n\n return { installed: true, path: claudePath, version };\n } catch (error) {\n return {\n installed: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n}\n\n/**\n * Returns installation instructions for Claude CLI based on the detected OS\n */\nexport function getClaudeInstallInstructions(): string {\n const platform = os.platform();\n\n if (platform === 'darwin') {\n return `Install Claude CLI for macOS:\n npm install -g @anthropic-ai/claude-code\n\nOr using Homebrew:\n brew install anthropic/claude/claude-code`;\n }\n\n if (platform === 'linux') {\n return `Install Claude CLI for Linux:\n npm install -g @anthropic-ai/claude-code`;\n }\n\n if (platform === 'win32') {\n return `Install Claude CLI for Windows:\n npm install -g @anthropic-ai/claude-code`;\n }\n\n return `Install Claude CLI:\n npm install -g @anthropic-ai/claude-code`;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,QAAQ;AAKR,SAAS,uBAKd;AACA,MAAI;AAEF,UAAM,aAAa,SAAS,qBAAqB,EAAE,UAAU,QAAQ,CAAC,EAAE,KAAK;AAE7E,QAAI,CAAC,YAAY;AAEf,YAAM,UAAU,GAAG,QAAQ;AAC3B,YAAM,cAAc;AAAA,QAClB,KAAK,KAAK,SAAS,UAAU,OAAO,QAAQ;AAAA,QAC5C;AAAA,QACA,KAAK,KAAK,SAAS,OAAO,QAAQ;AAAA,MACpC;AAEA,iBAAW,aAAa,aAAa;AACnC,YAAI,WAAW,SAAS,GAAG;AAEzB,cAAI;AACF,kBAAMA,WAAU,SAAS,oBAAoB,EAAE,UAAU,QAAQ,CAAC,EAAE,KAAK;AACzE,mBAAO,EAAE,WAAW,MAAM,MAAM,WAAW,SAAAA,SAAQ;AAAA,UACrD,QAA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