@love-moon/conductor-cli 0.1.0 → 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.
- package/bin/conductor-daemon.js +4 -2
- package/bin/conductor-fire.js +4 -4
- package/bin/conductor.js +104 -0
- package/package.json +10 -7
- package/src/daemon.js +1 -1
package/bin/conductor-daemon.js
CHANGED
|
@@ -11,8 +11,10 @@ import { startDaemon } from "../src/daemon.js";
|
|
|
11
11
|
|
|
12
12
|
const argv = hideBin(process.argv);
|
|
13
13
|
|
|
14
|
+
const CLI_NAME = process.env.CONDUCTOR_CLI_NAME || "conductor-daemon";
|
|
15
|
+
|
|
14
16
|
const args = yargs(argv)
|
|
15
|
-
.scriptName(
|
|
17
|
+
.scriptName(CLI_NAME)
|
|
16
18
|
.usage("Usage: $0 [--name <daemon-name>] [--clean-all] [--config-file <path>] [--nohup]")
|
|
17
19
|
.option("name", {
|
|
18
20
|
alias: "n",
|
|
@@ -56,7 +58,7 @@ if (args.nohup) {
|
|
|
56
58
|
env: { ...process.env },
|
|
57
59
|
});
|
|
58
60
|
child.unref();
|
|
59
|
-
process.stdout.write(
|
|
61
|
+
process.stdout.write(`${CLI_NAME} running in background. Logs: ${logPath}\n`);
|
|
60
62
|
process.exit(0);
|
|
61
63
|
}
|
|
62
64
|
|
package/bin/conductor-fire.js
CHANGED
|
@@ -18,8 +18,8 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
18
18
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
19
19
|
import yargs from "yargs/yargs";
|
|
20
20
|
import { hideBin } from "yargs/helpers";
|
|
21
|
-
import { cli2sdk } from "@
|
|
22
|
-
import { loadConfig } from "@conductor
|
|
21
|
+
import { cli2sdk } from "@love-moon/cli2sdk";
|
|
22
|
+
import { loadConfig } from "@love-moon/conductor-sdk";
|
|
23
23
|
import {
|
|
24
24
|
loadHistoryFromSpec,
|
|
25
25
|
parseFromSpec,
|
|
@@ -33,12 +33,12 @@ const require = createRequire(import.meta.url);
|
|
|
33
33
|
const PKG_ROOT = path.join(__dirname, "..");
|
|
34
34
|
const CLI_PROJECT_PATH = process.cwd();
|
|
35
35
|
const REPO_ROOT_FALLBACK = path.resolve(__dirname, "..", "..");
|
|
36
|
-
const SDK_FALLBACK_PATH = path.join(REPO_ROOT_FALLBACK, "
|
|
36
|
+
const SDK_FALLBACK_PATH = path.join(REPO_ROOT_FALLBACK, "modules", "sdk");
|
|
37
37
|
const SDK_ROOT =
|
|
38
38
|
process.env.CONDUCTOR_SDK_PATH ||
|
|
39
39
|
(() => {
|
|
40
40
|
try {
|
|
41
|
-
return path.dirname(require.resolve("@conductor
|
|
41
|
+
return path.dirname(require.resolve("@love-moon/conductor-sdk/package.json"));
|
|
42
42
|
} catch {
|
|
43
43
|
return SDK_FALLBACK_PATH;
|
|
44
44
|
}
|
package/bin/conductor.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* conductor - Main CLI entry point with subcommand routing.
|
|
5
|
+
*
|
|
6
|
+
* Subcommands:
|
|
7
|
+
* fire - Run AI coding agents with Conductor integration
|
|
8
|
+
* daemon - Start long-running daemon for task orchestration
|
|
9
|
+
* config - Interactive configuration setup
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import yargs from "yargs/yargs";
|
|
17
|
+
import { hideBin } from "yargs/helpers";
|
|
18
|
+
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = path.dirname(__filename);
|
|
21
|
+
const require = createRequire(import.meta.url);
|
|
22
|
+
const PKG_ROOT = path.join(__dirname, "..");
|
|
23
|
+
|
|
24
|
+
const pkgJson = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, "package.json"), "utf-8"));
|
|
25
|
+
|
|
26
|
+
// Parse command line arguments
|
|
27
|
+
const argv = process.argv.slice(2);
|
|
28
|
+
|
|
29
|
+
// If no arguments or help flag, show help
|
|
30
|
+
if (argv.length === 0 || argv[0] === "--help" || argv[0] === "-h") {
|
|
31
|
+
showHelp();
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// If version flag, show version
|
|
36
|
+
if (argv[0] === "--version" || argv[0] === "-v") {
|
|
37
|
+
console.log(`conductor version ${pkgJson.version}`);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Get the subcommand
|
|
42
|
+
const subcommand = argv[0];
|
|
43
|
+
|
|
44
|
+
// Valid subcommands
|
|
45
|
+
const validSubcommands = ["fire", "daemon", "config"];
|
|
46
|
+
|
|
47
|
+
if (!validSubcommands.includes(subcommand)) {
|
|
48
|
+
console.error(`Error: Unknown subcommand '${subcommand}'`);
|
|
49
|
+
console.error(`Valid subcommands: ${validSubcommands.join(", ")}`);
|
|
50
|
+
console.error(`Run 'conductor --help' for usage information.`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Route to the appropriate subcommand
|
|
55
|
+
const subcommandArgs = argv.slice(1);
|
|
56
|
+
|
|
57
|
+
// Set environment variable to track the CLI name for logging
|
|
58
|
+
process.env.CONDUCTOR_CLI_NAME = `conductor ${subcommand}`;
|
|
59
|
+
|
|
60
|
+
// Import and execute the subcommand
|
|
61
|
+
const subcommandPath = path.join(__dirname, `conductor-${subcommand}.js`);
|
|
62
|
+
|
|
63
|
+
if (!fs.existsSync(subcommandPath)) {
|
|
64
|
+
console.error(`Error: Subcommand implementation not found: ${subcommandPath}`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Replace process.argv to pass the correct arguments to the subcommand
|
|
69
|
+
process.argv = [process.argv[0], subcommandPath, ...subcommandArgs];
|
|
70
|
+
|
|
71
|
+
// Dynamically import and execute the subcommand
|
|
72
|
+
import(subcommandPath).catch((error) => {
|
|
73
|
+
console.error(`Error loading subcommand '${subcommand}': ${error.message}`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
function showHelp() {
|
|
78
|
+
console.log(`conductor - Conductor CLI tool
|
|
79
|
+
|
|
80
|
+
Usage: conductor <subcommand> [options]
|
|
81
|
+
|
|
82
|
+
Subcommands:
|
|
83
|
+
fire Run AI coding agents with Conductor integration
|
|
84
|
+
daemon Start long-running daemon for task orchestration
|
|
85
|
+
config Interactive configuration setup
|
|
86
|
+
|
|
87
|
+
Options:
|
|
88
|
+
-h, --help Show this help message
|
|
89
|
+
-v, --version Show version information
|
|
90
|
+
|
|
91
|
+
Examples:
|
|
92
|
+
conductor fire -- "fix the bug"
|
|
93
|
+
conductor fire --backend claude -- "add feature"
|
|
94
|
+
conductor daemon --config-file ~/.conductor/config.yaml
|
|
95
|
+
conductor config
|
|
96
|
+
|
|
97
|
+
For subcommand-specific help:
|
|
98
|
+
conductor fire --help
|
|
99
|
+
conductor daemon --help
|
|
100
|
+
conductor config --help
|
|
101
|
+
|
|
102
|
+
Version: ${pkgJson.version}
|
|
103
|
+
`);
|
|
104
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@love-moon/conductor-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"conductor
|
|
7
|
-
"conductor-fire": "bin/conductor-fire.js",
|
|
8
|
-
"conductor-daemon": "bin/conductor-daemon.js",
|
|
9
|
-
"conductor-config": "bin/conductor-config.js"
|
|
6
|
+
"conductor": "bin/conductor.js"
|
|
10
7
|
},
|
|
11
8
|
"files": [
|
|
12
9
|
"bin",
|
|
@@ -19,8 +16,8 @@
|
|
|
19
16
|
"test": "node --test"
|
|
20
17
|
},
|
|
21
18
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@conductor
|
|
19
|
+
"@love-moon/cli2sdk": "0.1.0",
|
|
20
|
+
"@love-moon/conductor-sdk": "0.1.0",
|
|
24
21
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
25
22
|
"@openai/codex-sdk": "^0.58.0",
|
|
26
23
|
"dotenv": "^16.4.5",
|
|
@@ -30,5 +27,11 @@
|
|
|
30
27
|
"yargs": "^17.7.2",
|
|
31
28
|
"chrome-launcher": "^1.2.1",
|
|
32
29
|
"chrome-remote-interface": "^0.33.0"
|
|
30
|
+
},
|
|
31
|
+
"pnpm": {
|
|
32
|
+
"overrides": {
|
|
33
|
+
"@love-moon/cli2sdk": "file:../modules/cli2sdk",
|
|
34
|
+
"@love-moon/conductor-sdk": "file:../modules/sdk"
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
}
|
package/src/daemon.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import dotenv from "dotenv";
|
|
8
8
|
import yaml from "js-yaml";
|
|
9
9
|
|
|
10
|
-
import { ConductorWebSocketClient, ConductorConfig, loadConfig, ConfigFileNotFound } from "@conductor
|
|
10
|
+
import { ConductorWebSocketClient, ConductorConfig, loadConfig, ConfigFileNotFound } from "@love-moon/conductor-sdk";
|
|
11
11
|
|
|
12
12
|
dotenv.config();
|
|
13
13
|
|