@work-graph/cli 0.2.1 → 0.2.3
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @work-graph/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install [Work Graph](https://github.com/work-graph/work-graph) in any project via npm — no engine clone, no manual `engineRoot`.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
@@ -16,16 +16,25 @@ npm run workgraph:ui
|
|
|
16
16
|
|
|
17
17
|
| Command | Description |
|
|
18
18
|
|---------|-------------|
|
|
19
|
-
| `init [path]` |
|
|
20
|
-
| `ui [path]` |
|
|
21
|
-
| `doctor [path]` |
|
|
22
|
-
| `register [path]` |
|
|
19
|
+
| `init [path]` | Scaffold `intent/`, add devDependencies, MCP config, Cursor rule |
|
|
20
|
+
| `ui [path]` | Start backlog UI for the project |
|
|
21
|
+
| `doctor [path]` | Verify installation |
|
|
22
|
+
| `register [path]` | Optional: multiproject registry (power users) |
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Flags (`init`)
|
|
25
|
+
|
|
26
|
+
| Flag | Purpose |
|
|
27
|
+
|------|---------|
|
|
28
|
+
| `--label`, `--id` | Display name and project id |
|
|
29
|
+
| `--no-mcp` | Do not update `.cursor/mcp.json` |
|
|
30
|
+
| `--no-package` | Do not update `package.json` |
|
|
31
|
+
| `--legacy-engine-config` | Dev only: write deprecated `engineRoot` to config |
|
|
32
|
+
|
|
33
|
+
## Contributors (monorepo dev)
|
|
25
34
|
|
|
26
35
|
```bash
|
|
27
36
|
git clone …/work-graph && cd work-graph && npm install
|
|
28
37
|
WORKGRAPH_ENGINE_ROOT=. npx work-graph ui /path/to/project
|
|
29
38
|
```
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
See [CONTRIBUTING.md](https://github.com/work-graph/work-graph/blob/main/CONTRIBUTING.md) in the Work Graph repository.
|
package/bin/work-graph.mjs
CHANGED
|
@@ -28,22 +28,21 @@ function resolveRuntimeModule(relativePath) {
|
|
|
28
28
|
throw new Error(`Work Graph runtime module not found: ${relativePath}`);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
|
|
31
|
+
async function loadProjectInit() {
|
|
32
|
+
return import(resolveRuntimeModule('src/workGraphProjectInit.mjs'));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function loadWorkspaceRegistry() {
|
|
36
|
+
return import(resolveRuntimeModule('src/workspaceRegistry.mjs'));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function loadEngineRoot() {
|
|
40
|
+
return import(resolveRuntimeModule('src/workGraphEngineRoot.mjs'));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function loadBacklogUi() {
|
|
44
|
+
return import(resolveRuntimeModule('src/workGraphBacklogUiServer.mjs'));
|
|
45
|
+
}
|
|
47
46
|
|
|
48
47
|
function usage() {
|
|
49
48
|
console.log(`Work Graph CLI
|
|
@@ -126,6 +125,8 @@ function parseArgs(argv) {
|
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
async function cmdInit(targetPath, flags) {
|
|
128
|
+
const { defaultEngineRootFromCliModule, initWorkGraphProject } = await loadProjectInit();
|
|
129
|
+
const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
|
|
129
130
|
const root = resolve(targetPath ?? process.cwd());
|
|
130
131
|
const useLegacyEngine = Boolean(flags.engine || flags.legacyEngineConfig);
|
|
131
132
|
const result = await initWorkGraphProject({
|
|
@@ -142,6 +143,7 @@ async function cmdInit(targetPath, flags) {
|
|
|
142
143
|
});
|
|
143
144
|
|
|
144
145
|
if (flags.registerHost) {
|
|
146
|
+
const { registerWorkspace, setActiveWorkspace } = await loadWorkspaceRegistry();
|
|
145
147
|
const registry = await registerWorkspace({
|
|
146
148
|
id: result.projectId,
|
|
147
149
|
root: result.projectRoot,
|
|
@@ -158,6 +160,7 @@ async function cmdInit(targetPath, flags) {
|
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
async function cmdRegister(targetPath, flags) {
|
|
163
|
+
const { registerWorkspace } = await loadWorkspaceRegistry();
|
|
161
164
|
const root = resolve(targetPath ?? process.cwd());
|
|
162
165
|
const registry = await registerWorkspace({
|
|
163
166
|
id: flags.id,
|
|
@@ -175,6 +178,7 @@ async function cmdRegister(targetPath, flags) {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
async function cmdDoctor(targetPath) {
|
|
181
|
+
const { runWorkGraphDoctor } = await loadProjectInit();
|
|
178
182
|
const cwd = resolve(targetPath ?? process.cwd());
|
|
179
183
|
const report = await runWorkGraphDoctor({ cwd, cliModuleUrl });
|
|
180
184
|
console.log(JSON.stringify(report, null, 2));
|
|
@@ -184,6 +188,8 @@ async function cmdDoctor(targetPath) {
|
|
|
184
188
|
}
|
|
185
189
|
|
|
186
190
|
async function cmdUi(targetPath, flags) {
|
|
191
|
+
const { defaultEngineRootFromCliModule, startProjectUiFromCwd } = await loadProjectInit();
|
|
192
|
+
const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
|
|
187
193
|
const cwd = resolve(targetPath ?? process.cwd());
|
|
188
194
|
|
|
189
195
|
try {
|
|
@@ -194,6 +200,8 @@ async function cmdUi(targetPath, flags) {
|
|
|
194
200
|
// fallback: запуск из репозитория движка (разработка WG)
|
|
195
201
|
}
|
|
196
202
|
|
|
203
|
+
const { resolveEngineRoot } = await loadEngineRoot();
|
|
204
|
+
const { startBacklogUiServer } = await loadBacklogUi();
|
|
197
205
|
const engineRoot = resolveEngineRoot({ cliModuleUrl }) ?? devEngineRoot;
|
|
198
206
|
const { host, port } = await startBacklogUiServer({
|
|
199
207
|
hostRoot: engineRoot,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@work-graph/cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Work Graph CLI —
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Work Graph CLI — npm-first project setup, doctor, backlog UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"work-graph": "bin/work-graph.mjs"
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"cli"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@dagrejs/dagre": "^3.0.0",
|
|
33
34
|
"mermaid": "^11.15.0"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @work-graph/mcp
|
|
2
2
|
|
|
3
|
-
MCP server for Work Graph — list
|
|
3
|
+
[MCP](https://modelcontextprotocol.io) server for Work Graph — list, create, and update work items in `intent/**/*.work.bvc`.
|
|
4
4
|
|
|
5
5
|
## Cursor
|
|
6
6
|
|
|
@@ -21,8 +21,12 @@ After `npx @work-graph/cli init .`, `.cursor/mcp.json` includes:
|
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
Reload MCP in Cursor after init.
|
|
25
|
+
|
|
24
26
|
## Standalone
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
29
|
WORKGRAPH_ROOT=/path/to/project npx @work-graph/mcp
|
|
28
30
|
```
|
|
31
|
+
|
|
32
|
+
Requires a project with `.work-graph/config.json` (run `npx @work-graph/cli init` first).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@work-graph/mcp",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "MCP server for Work Graph
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "MCP server for Work Graph — work items in intent/**/*.work.bvc",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"workgraph-mcp": "bin/workgraph-mcp.mjs"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@work-graph/cli": "^0.2.
|
|
19
|
+
"@work-graph/cli": "^0.2.3",
|
|
20
20
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
21
21
|
"zod": "^3.25.76"
|
|
22
22
|
},
|
|
@@ -20,8 +20,8 @@ export {
|
|
|
20
20
|
|
|
21
21
|
const CONFIG_SCHEMA_V1 = 'workgraph.project.config.v1';
|
|
22
22
|
const CONFIG_SCHEMA_V2 = 'workgraph.project.config.v2';
|
|
23
|
-
const DEFAULT_CLI_VERSION = '0.2.
|
|
24
|
-
const DEFAULT_MCP_VERSION = '0.2.
|
|
23
|
+
const DEFAULT_CLI_VERSION = '0.2.3';
|
|
24
|
+
const DEFAULT_MCP_VERSION = '0.2.3';
|
|
25
25
|
|
|
26
26
|
const INDEX_STUB = `#Index<[
|
|
27
27
|
WorkItems:
|