@gh-symphony/cli 0.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/LICENSE +21 -0
- package/dist/commands/config-cmd.d.ts +3 -0
- package/dist/commands/config-cmd.js +106 -0
- package/dist/commands/help.d.ts +3 -0
- package/dist/commands/help.js +47 -0
- package/dist/commands/init.d.ts +26 -0
- package/dist/commands/init.js +508 -0
- package/dist/commands/logs.d.ts +3 -0
- package/dist/commands/logs.js +123 -0
- package/dist/commands/project.d.ts +3 -0
- package/dist/commands/project.js +101 -0
- package/dist/commands/recover.d.ts +3 -0
- package/dist/commands/recover.js +117 -0
- package/dist/commands/repo.d.ts +3 -0
- package/dist/commands/repo.js +103 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.js +69 -0
- package/dist/commands/start.d.ts +3 -0
- package/dist/commands/start.js +210 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +218 -0
- package/dist/commands/stop.d.ts +3 -0
- package/dist/commands/stop.js +46 -0
- package/dist/commands/version.d.ts +3 -0
- package/dist/commands/version.js +21 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.js +81 -0
- package/dist/github/client.d.ts +60 -0
- package/dist/github/client.js +300 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +88 -0
- package/dist/mapping/smart-defaults.d.ts +33 -0
- package/dist/mapping/smart-defaults.js +159 -0
- package/dist/orchestrator-runtime.d.ts +5 -0
- package/dist/orchestrator-runtime.js +26 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GitHub Symphony contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { loadGlobalConfig, saveGlobalConfig, configFilePath, } from "../config.js";
|
|
3
|
+
const handler = async (args, options) => {
|
|
4
|
+
const [subcommand, ...rest] = args;
|
|
5
|
+
switch (subcommand) {
|
|
6
|
+
case "show":
|
|
7
|
+
await configShow(options);
|
|
8
|
+
break;
|
|
9
|
+
case "set":
|
|
10
|
+
await configSet(rest, options);
|
|
11
|
+
break;
|
|
12
|
+
case "edit":
|
|
13
|
+
await configEdit(options);
|
|
14
|
+
break;
|
|
15
|
+
default:
|
|
16
|
+
process.stderr.write("Usage: gh-symphony config <show|set|edit>\n");
|
|
17
|
+
process.exitCode = 2;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export default handler;
|
|
21
|
+
// ── 7.1: config show ─────────────────────────────────────────────────────────
|
|
22
|
+
async function configShow(options) {
|
|
23
|
+
const config = await loadGlobalConfig(options.configDir);
|
|
24
|
+
if (!config) {
|
|
25
|
+
process.stderr.write("No configuration found. Run 'gh-symphony init'.\n");
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// Mask token for display
|
|
30
|
+
const display = {
|
|
31
|
+
...config,
|
|
32
|
+
token: config.token ? maskToken(config.token) : null,
|
|
33
|
+
};
|
|
34
|
+
if (options.json) {
|
|
35
|
+
process.stdout.write(JSON.stringify(display, null, 2) + "\n");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
process.stdout.write(`Config: ${configFilePath(options.configDir)}\n\n`);
|
|
39
|
+
process.stdout.write(`Active workspace: ${config.activeWorkspace ?? "none"}\n`);
|
|
40
|
+
process.stdout.write(`Token: ${display.token ?? "not set"}\n`);
|
|
41
|
+
process.stdout.write(`Workspaces: ${config.workspaces.join(", ") || "none"}\n`);
|
|
42
|
+
}
|
|
43
|
+
function maskToken(token) {
|
|
44
|
+
if (token.length <= 8)
|
|
45
|
+
return "****";
|
|
46
|
+
return token.slice(0, 4) + "..." + token.slice(-4);
|
|
47
|
+
}
|
|
48
|
+
// ── 7.2: config set ──────────────────────────────────────────────────────────
|
|
49
|
+
const VALID_KEYS = {
|
|
50
|
+
"active-workspace": { type: "string" },
|
|
51
|
+
token: { type: "string" },
|
|
52
|
+
};
|
|
53
|
+
async function configSet(args, options) {
|
|
54
|
+
const [key, value] = args;
|
|
55
|
+
if (!key || value === undefined) {
|
|
56
|
+
process.stderr.write("Usage: gh-symphony config set <key> <value>\n");
|
|
57
|
+
process.stderr.write(`Valid keys: ${Object.keys(VALID_KEYS).join(", ")}\n`);
|
|
58
|
+
process.exitCode = 2;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const keyDef = VALID_KEYS[key];
|
|
62
|
+
if (!keyDef) {
|
|
63
|
+
process.stderr.write(`Unknown config key: ${key}\nValid keys: ${Object.keys(VALID_KEYS).join(", ")}\n`);
|
|
64
|
+
process.exitCode = 2;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const config = (await loadGlobalConfig(options.configDir)) ??
|
|
68
|
+
{
|
|
69
|
+
activeWorkspace: null,
|
|
70
|
+
token: null,
|
|
71
|
+
workspaces: [],
|
|
72
|
+
};
|
|
73
|
+
switch (key) {
|
|
74
|
+
case "active-workspace":
|
|
75
|
+
if (!config.workspaces.includes(value)) {
|
|
76
|
+
process.stderr.write(`Workspace "${value}" not found. Available: ${config.workspaces.join(", ")}\n`);
|
|
77
|
+
process.exitCode = 1;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
config.activeWorkspace = value;
|
|
81
|
+
break;
|
|
82
|
+
case "token":
|
|
83
|
+
config.token = value;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
await saveGlobalConfig(options.configDir, config);
|
|
87
|
+
process.stdout.write(`Set ${key} = ${key === "token" ? maskToken(value) : value}\n`);
|
|
88
|
+
}
|
|
89
|
+
// ── 7.3: config edit ─────────────────────────────────────────────────────────
|
|
90
|
+
async function configEdit(options) {
|
|
91
|
+
const editor = process.env.EDITOR || process.env.VISUAL || "vi";
|
|
92
|
+
const path = configFilePath(options.configDir);
|
|
93
|
+
const child = spawn(editor, [path], {
|
|
94
|
+
stdio: "inherit",
|
|
95
|
+
});
|
|
96
|
+
await new Promise((resolve, reject) => {
|
|
97
|
+
child.on("close", (code) => {
|
|
98
|
+
if (code === 0) {
|
|
99
|
+
resolve();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
reject(new Error(`Editor exited with code ${code}`));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const HELP_TEXT = `
|
|
2
|
+
gh-symphony — AI Coding Agent Orchestrator
|
|
3
|
+
|
|
4
|
+
Usage: gh-symphony <command> [options]
|
|
5
|
+
|
|
6
|
+
Setup:
|
|
7
|
+
init Interactive workspace setup wizard
|
|
8
|
+
config show Show current configuration
|
|
9
|
+
config set Set a configuration value
|
|
10
|
+
config edit Open config in $EDITOR
|
|
11
|
+
|
|
12
|
+
Orchestration:
|
|
13
|
+
start Start the orchestrator (foreground)
|
|
14
|
+
start --daemon Start the orchestrator (background)
|
|
15
|
+
stop Stop the background orchestrator
|
|
16
|
+
status Show orchestrator status
|
|
17
|
+
run <issue> Dispatch a single issue
|
|
18
|
+
recover Recover stalled runs
|
|
19
|
+
logs View orchestrator logs
|
|
20
|
+
|
|
21
|
+
Workspace Management:
|
|
22
|
+
project list List all workspaces
|
|
23
|
+
project switch Switch active workspace
|
|
24
|
+
project status Show workspace details
|
|
25
|
+
repo list List configured repositories
|
|
26
|
+
repo add Add a repository
|
|
27
|
+
repo remove Remove a repository
|
|
28
|
+
|
|
29
|
+
Global Options:
|
|
30
|
+
--config <dir> Config directory (default: ~/.gh-symphony)
|
|
31
|
+
--verbose Enable verbose output
|
|
32
|
+
--json Output in JSON format
|
|
33
|
+
--no-color Disable color output
|
|
34
|
+
--help, -h Show this help message
|
|
35
|
+
--version, -V Show version
|
|
36
|
+
|
|
37
|
+
Examples:
|
|
38
|
+
gh-symphony init # Set up a new workspace
|
|
39
|
+
gh-symphony start # Start orchestrator
|
|
40
|
+
gh-symphony start --daemon # Start in background
|
|
41
|
+
gh-symphony run org/repo#123 # Dispatch a specific issue
|
|
42
|
+
gh-symphony status --watch # Watch status in real-time
|
|
43
|
+
`.trimStart();
|
|
44
|
+
const handler = async (_args, _options) => {
|
|
45
|
+
process.stdout.write(HELP_TEXT);
|
|
46
|
+
};
|
|
47
|
+
export default handler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GlobalOptions } from "../index.js";
|
|
2
|
+
import { type ProjectDetail, type LinkedRepository } from "../github/client.js";
|
|
3
|
+
import { type ColumnRole, type HumanReviewMode } from "../config.js";
|
|
4
|
+
declare const handler: (args: string[], options: GlobalOptions) => Promise<void>;
|
|
5
|
+
export default handler;
|
|
6
|
+
type WriteConfigInput = {
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
token: string;
|
|
9
|
+
project: ProjectDetail;
|
|
10
|
+
repos: LinkedRepository[];
|
|
11
|
+
statusField: {
|
|
12
|
+
name: string;
|
|
13
|
+
options: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
roles: Record<string, ColumnRole>;
|
|
18
|
+
humanReviewMode: HumanReviewMode;
|
|
19
|
+
runtime: string;
|
|
20
|
+
workerCommand?: string;
|
|
21
|
+
pollIntervalMs?: number;
|
|
22
|
+
concurrency?: number;
|
|
23
|
+
maxAttempts?: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function writeConfig(configDir: string, input: WriteConfigInput): Promise<void>;
|
|
26
|
+
export declare function generateWorkspaceId(projectTitle: string, uniqueKey: string): string;
|