devworkspace 0.4.2 → 0.4.4

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +299 -27
  3. package/dist/cli/args.d.ts +9 -0
  4. package/dist/cli/args.js +3 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/help.js +8 -4
  7. package/dist/cli/help.js.map +1 -1
  8. package/dist/cli/render.js +53 -4
  9. package/dist/cli/render.js.map +1 -1
  10. package/dist/cli/run.js +42 -17
  11. package/dist/cli/run.js.map +1 -1
  12. package/dist/core/artifacts.d.ts +32 -0
  13. package/dist/core/artifacts.js +46 -0
  14. package/dist/core/artifacts.js.map +1 -0
  15. package/dist/core/version.js +3 -0
  16. package/dist/core/version.js.map +1 -1
  17. package/dist/core/workspace.js +1 -0
  18. package/dist/core/workspace.js.map +1 -1
  19. package/dist/integrations/adapters/graphify.js +2 -1
  20. package/dist/integrations/adapters/graphify.js.map +1 -1
  21. package/dist/mcp/setup.d.ts +97 -2
  22. package/dist/mcp/setup.js +280 -67
  23. package/dist/mcp/setup.js.map +1 -1
  24. package/dist/mcp/tools.d.ts +6 -0
  25. package/dist/mcp/tools.js +140 -18
  26. package/dist/mcp/tools.js.map +1 -1
  27. package/dist/mcp/verify.d.ts +41 -0
  28. package/dist/mcp/verify.js +229 -0
  29. package/dist/mcp/verify.js.map +1 -0
  30. package/dist/services/doctor.js +139 -0
  31. package/dist/services/doctor.js.map +1 -1
  32. package/dist/services/graph.d.ts +77 -3
  33. package/dist/services/graph.js +336 -185
  34. package/dist/services/graph.js.map +1 -1
  35. package/dist/services/init.js +5 -1
  36. package/dist/services/init.js.map +1 -1
  37. package/dist/services/setup.js +4 -0
  38. package/dist/services/setup.js.map +1 -1
  39. package/dist/services/taskContext.d.ts +24 -2
  40. package/dist/services/taskContext.js +72 -26
  41. package/dist/services/taskContext.js.map +1 -1
  42. package/dist/tasks/routing.js +4 -1
  43. package/dist/tasks/routing.js.map +1 -1
  44. package/docs/agents.md +18 -4
  45. package/docs/claude.md +13 -0
  46. package/docs/getting-started.md +40 -1
  47. package/docs/integrations.md +16 -1
  48. package/docs/mcp.md +46 -14
  49. package/docs/troubleshooting.md +5 -0
  50. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  All notable changes are documented here. This project follows [Semantic Versioning](https://semver.org/). Workspace schema changes are called out under **Breaking**.
4
4
 
5
+ ## [0.4.4] - 2026-11-04
6
+
7
+ ### Added
8
+ - `setup --agent <name|auto>` is now a one-command onboarding: initializes a missing workspace, merges MCP config, re-validates it, and starts the configured server to check `initialize`, `tools/list` and real tool calls (`--no-verify` to skip). The report separates what was verified from what only the agent can confirm (approval, reload).
9
+ - Launcher policy: a `devworkspace` on PATH is used only when its version matches the running CLI; Windows `npx` is written as `cmd /c npx`. The chosen launcher and reason are reported.
10
+ - Graph edges carry Graphify `confidence` (EXTRACTED / INFERRED / unknown); only extracted edges between verified endpoints are `verified`.
11
+ - Graphify location is resolved centrally (`src/core/artifacts.ts`): root `graphify-out/` (tool-owned) or `.devworkspace/graph/graphify/graphify-out/` (from `graphify extract --out`); doctor reports the layout and warns on duplicates. `.devworkspace/.gitignore` gains `graph/`.
12
+ - Extracted edges are checked against their own source line (`sourceCheck`); a line that no longer mentions the endpoints demotes the edge to unverified.
13
+ - The npx launcher pins published copies to their own version, rejects unsafe `--package-version` values, and ignores a PATH entry that is only the project's `node_modules/.bin`. `setup --agent` on a bare repository also analyzes it.
14
+ - `get_file_context` suggests confirmed package manifests when a root manifest is missing in a multi-package repo.
15
+
16
+ ### Security
17
+
18
+ - The live MCP check starts the server with an explicit environment allowlist instead of the full parent environment; unrelated credentials are no longer inherited (`DEVWORKSPACE_VERIFY_ENV` opts extra variables in).
19
+
20
+ ### Changed
21
+ - **Codex** now gets `.codex/config.toml` (`[mcp_servers.devworkspace]`, the documented project-scoped format) instead of a root `mcp.json` that Codex does not read. **Antigravity** MCP config is user-level, so setup writes no project files for it and prints the exact entry to add. `doctor` flags the old files; nothing is deleted.
22
+ - Live check now also calls `check_mcp_health`, runs with the environment an agent would provide (npm-injected variables such as `npm_config_package` are dropped), and, when the Claude Code CLI is installed, reports what it sees (`pending-approval` / `connected` / `failed`).
23
+ - `setup --agent` prints a plan (files and launcher) before writing; the report shows which CLI ran (version, path, how installed).
24
+
25
+ ### Fixed
26
+ - Live check cleanup: an early-exiting server no longer risks an unhandled EPIPE, and on POSIX the whole process group (npx and the server) is ended. Setup now reports when the started server's version differs from the CLI's, and warns that a Windows `cmd /c` launcher in a shared file is not portable.
27
+ - An installed `node_modules/devworkspace` copy was classified as a source checkout, so its launcher was never version-pinned.
28
+ - Graphify nodes using `source_file` / `label` / `source_location` now resolve to their source file and line (unsafe paths are rejected).
29
+ - `trace_symbol_dependencies` / `graph trace` enforce `maxNodes` during neighbour expansion and report truncation.
30
+ - Task-context graph matching uses deterministic token-based scoring instead of first-hit substring matching (no more `erp` -> `PageHeaderProps`); `get_task_context` graph nodes report `nodeType` separately from source `status`.
31
+
32
+ ## [0.4.3] - 2026-11-04
33
+
34
+ ### Added
35
+ - **Automatic MCP Configuration Generation & Launcher Strategy**:
36
+ - Implemented dynamic MCP launcher resolution (`resolveMcpServerDef`) supporting `auto`, `direct`, and `npx` execution modes.
37
+ - Automatically configures `npx -y devworkspace mcp serve` for users running via `npx` or lacking global CLI installations, eliminating manual edits to `.mcp.json`.
38
+ - Added `--launcher <auto|direct|npx>` and `--package-version <version>` CLI options to `setup`, `init`, and `mcp setup`.
39
+ - **Onboarding MCP Integration**:
40
+ - Added support for `--agent <name>` during `devworkspace init` (e.g. `npx devworkspace init --agent claude-code`) to configure MCP client settings during onboarding.
41
+ - Added clear onboarding guidance in `devworkspace init` and `setup` pointing users to connect AI coding agents via MCP.
42
+ - **Doctor MCP Launcher Diagnostics**:
43
+ - Added `checkMcpLauncher` in `devworkspace doctor` to detect unresolvable or missing MCP server commands across `.mcp.json`, `mcp.json`, and `.antigravity/mcp.json`, providing actionable remediation hints.
44
+ - **Task-Aware Path Retrieval Fallback**:
45
+ - Improved `get_task_context` so natural-language tasks retrieve relevant real repository files based on path segments even when `features.json`, Graphify output, and ADRs are absent.
46
+ - Suppressed non-path detector labels and prioritized domain file matches in candidate ranking.
47
+ - Added graceful handling and explicit reporting for missing or corrupted Graphify knowledge graphs.
48
+ - **Regression Test Suite**:
49
+ - Added 18 task-aware retrieval regression tests covering path candidate discovery, ranking, and Graphify notices.
50
+ - Added 12 MCP setup and launcher regression tests covering all 11 required scenarios: first-time generation, idempotency, server preservation, malformed JSON protection, global vs npx launchers, version pinning, cross-platform resolution, live MCP stdio handshake, and doctor diagnostics.
51
+
52
+ ### Fixed
53
+ - **MCP Client Connectivity for npx Users**:
54
+ - Fixed client failures where AI coding agents could not spawn `devworkspace mcp serve` when installed or invoked through `npx` without a global executable on system `PATH`.
55
+
5
56
  ## [0.4.2] - 2026-11-04
6
57
 
7
58
  ### Added
package/README.md CHANGED
@@ -4,10 +4,15 @@ DevWorkspace is a **local-first engineering memory and verification layer** for
4
4
 
5
5
  ```bash
6
6
  cd my-project
7
- npx devworkspace init
8
- npx devworkspace analyze
7
+ npx devworkspace setup --agent auto # detects your agent; or name it: claude-code | codex | antigravity | all
9
8
  ```
10
9
 
10
+ One command initializes and analyzes the workspace if needed, writes the agent's MCP configuration, starts the MCP server and calls its tools to prove it works, and tells you exactly what is left (usually: reload the agent and approve the server). Requires Node.js 20.11+; see [Quick Start](#quick-start) for details, optional integrations and recovery.
11
+
12
+ This is the same on Windows PowerShell, `cmd.exe`, macOS and Linux. It runs the **published** package; to try a local checkout instead, build it (`npm run build`) and run `node <checkout>/dist/cli/main.js setup --agent claude-code` inside the target project (an unpublished build is left unpinned in `.mcp.json`, so the agent will still start the latest *published* release unless you pass `--package-version`).
13
+
14
+ `setup --agent … --no-verify` is configuration-only (for CI/offline) and says plainly that the server was not started.
15
+
11
16
  ---
12
17
 
13
18
  ## What Problem Does It Solve?
@@ -44,39 +49,264 @@ flowchart LR
44
49
 
45
50
  ## Quick Start
46
51
 
47
- ### Prerequisites
48
- Node.js **20.11 or newer**. Works on Windows, macOS, and Linux. Git is strongly recommended.
52
+ Follow this end-to-end setup flow to initialize DevWorkspace, connect your AI coding agent, configure optional helper integrations, and verify your repository.
53
+
54
+ ### Step 1: Prerequisites
55
+
56
+ Before setting up DevWorkspace, verify the following system requirements:
57
+
58
+ - **Node.js**: Version **20.11 or newer** (`node --version`). Supported across Windows, macOS, and Linux.
59
+ - **Git**: Strongly recommended (`git --version`). DevWorkspace functions in non-Git folders, but Git is recommended for branch tracking, dirty file detection, and uncommitted change protection.
60
+ - **AI Coding Agent**: A supported coding agent, such as **Claude Code**, **Cursor**, **GitHub Copilot**, **OpenAI Codex**, or **Google Antigravity**.
61
+ - **Optional Integrations Prerequisites**: If you choose to install optional helper tools such as **Graphify**, you will need **Python 3.10+** (or `uv` / `pipx`). Python is **not** required for DevWorkspace core functionality, CLI commands, or MCP tools.
62
+
63
+ ### Step 2: Core Initialization & Repository Analysis
64
+
65
+ Navigate to your project root and run:
49
66
 
50
- ### Step 1: Initialize the Workspace
51
67
  ```bash
52
68
  cd my-project
53
69
  npx devworkspace init
70
+ npx devworkspace analyze
54
71
  ```
55
- Creates `.devworkspace/` with a nested `.gitignore` for machine-local state. It never modifies your source files and is safe to run multiple times.
56
72
 
57
- ### Step 2: Analyze Project Structure & Testing Contract
73
+ What these commands do:
74
+ - **`devworkspace init`**: Creates the `.devworkspace/` directory and writes a nested `.gitignore` for machine-local state (`.devworkspace/local/`). It never touches your application source files and is completely safe to re-run.
75
+ - **`devworkspace analyze`**: Scans package manifests, lockfiles, frameworks, entry points, and build scripts offline. It generates:
76
+ - `.devworkspace/context/commands.json`: Your project's deterministic verification contract (test, lint, and typecheck commands).
77
+ - `.devworkspace/context/facts.json`: Detected repository facts (ecosystems, package manager, frameworks).
78
+ - `.devworkspace/analysis/onboarding-prompt.md`: An optional onboarding prompt you can paste into Claude Code to review findings and record baseline knowledge.
79
+
80
+ ### Step 3: Configure Your Coding Agent (MCP and/or Instructions)
81
+
82
+ DevWorkspace provides two distinct ways to equip coding agents with repository context. You can use either or both:
83
+
84
+ 1. **Model Context Protocol (MCP)**: Exposes dynamic context retrieval tools over stdio to compatible agents (**Claude Code**, **OpenAI Codex**, **Google Antigravity**).
85
+ 2. **File-Based Agent Instructions**: Injects managed Markdown operating rules into persistent instruction files for **Cursor**, **GitHub Copilot**, **OpenAI Codex**, and **Claude Code**.
86
+
87
+ > [!NOTE]
88
+ > Installing file-based agent instructions and configuring MCP are separate operations. Both can be configured in the same repository and coexist seamlessly without conflict.
89
+
90
+ #### Option A: Configure MCP Server (Claude Code, Codex, Antigravity)
91
+
92
+ Generate the agent's MCP configuration and rule references. DevWorkspace automatically detects whether to use direct execution or `npx` without requiring manual JSON edits:
93
+
58
94
  ```bash
59
- npx devworkspace analyze
95
+ # For Claude Code (writes .mcp.json and managed section in CLAUDE.md)
96
+ npx devworkspace setup --agent claude-code
97
+
98
+ # For OpenAI Codex (writes .codex/config.toml and a managed section in AGENTS.md)
99
+ npx devworkspace setup --agent codex
100
+
101
+ # For Google Antigravity (writes nothing: its MCP config is user-level, so you get exact manual steps)
102
+ npx devworkspace setup --agent antigravity
103
+
104
+ # Or configure all supported MCP agents at once:
105
+ npx devworkspace setup --agent all
60
106
  ```
61
- Scans dependencies, frameworks, entry points, and scripts. Generates detected facts and your project's verification contract.
62
107
 
63
- ### Step 3: Connect Your Coding Agent
64
- Choose the integration method that fits your agent (both can coexist safely):
108
+ *(Pass `--check` to preview planned file edits without modifying disk: `npx devworkspace setup --agent claude-code --check`. Override launcher mode if desired with `--launcher auto|direct|npx`).*
109
+
110
+ #### Option B: Install File-Based Agent Instructions (Cursor, Copilot, Codex, Claude)
65
111
 
66
- - **Option A: Model Context Protocol (MCP)** — Recommended for Claude Code, Codex, and Antigravity:
67
- ```bash
68
- npx devworkspace setup --agent claude-code
69
- ```
70
- - **Option B: File-Based Instructions** — For Cursor, Copilot, Codex, and Claude:
71
- ```bash
72
- npx devworkspace agent install --agent all
73
- ```
112
+ Inject managed instruction blocks and workflow skills into your repository:
113
+
114
+ ```bash
115
+ # For Cursor (.cursor/rules/devworkspace.mdc)
116
+ npx devworkspace agent install --agent cursor
117
+
118
+ # For GitHub Copilot (.github/copilot-instructions.md)
119
+ npx devworkspace agent install --agent copilot
120
+
121
+ # For OpenAI Codex (AGENTS.md)
122
+ npx devworkspace agent install --agent codex
123
+
124
+ # For Claude Code (CLAUDE.md and .claude/skills/devworkspace/SKILL.md)
125
+ npx devworkspace agent install --agent claude
126
+
127
+ # Or install for all supported agents in one command:
128
+ npx devworkspace agent install --agent all
129
+ ```
130
+
131
+ *(Pass `--dry-run` to preview changes: `npx devworkspace agent install --agent all --dry-run`.)*
132
+
133
+ ### Step 4: Install Optional Helper Integrations (Optional)
134
+
135
+ DevWorkspace can orchestrate external developer tools to expand your agent's capabilities:
136
+ - **[Graphify](https://github.com/Graphify-Labs/graphify)**: Structural code knowledge graphs for call hierarchies, imports, and symbol dependencies.
137
+ - **[Agent Skills](https://github.com/addyosmani/agent-skills)**: Workflows for spec drafting, implementation plans, and shipping checklists.
138
+ - **[Ponytail](https://github.com/DietrichGebert/ponytail)**: Code quality review and complexity reduction.
139
+
140
+ > [!TIP]
141
+ > These integrations are **strictly optional**. DevWorkspace's core workspace, facts, verification contracts, and MCP tools function fully without them.
142
+
143
+ Preview and install optional integrations:
144
+
145
+ ```bash
146
+ # Preview what would be installed without making changes
147
+ npx devworkspace setup --integrations --dry-run
148
+
149
+ # Install and verify optional integrations (requires explicit consent with --yes)
150
+ npx devworkspace setup --integrations --yes
151
+ ```
152
+
153
+ *(You can limit installation to specific tools using `--only graphify` or `--only graphify,agent-skills`.)*
154
+
155
+ ### Step 5: Agent Reload & Restart Requirements
156
+
157
+ When DevWorkspace installs native plugins or skills for Claude Code (such as Graphify or Agent Skills), the agent's running process must load them into memory:
158
+
159
+ 1. **Check for `RESTART_REQUIRED`**: If diagnostic output reports `RESTART_REQUIRED`, the integration files exist on disk, but the coding agent has not yet loaded them.
160
+ 2. **Reload or Restart**:
161
+ - In **Claude Code**: Run `/reload-plugins` inside your interactive session, or exit and restart the `claude` CLI.
162
+ - In **VS Code / Cursor**: Restart the IDE window or reload the editor developer window (`Developer: Reload Window`).
163
+ 3. **Acknowledge Restart in DevWorkspace**: Once the agent has been restarted, clear the pending notice:
164
+ ```bash
165
+ npx devworkspace integrations status --restarted
166
+ ```
167
+
168
+ *Note: File-on-disk presence is not proof of in-memory agent loading. Acknowledging the restart updates DevWorkspace's tracking so diagnostics report accurate statuses.*
169
+
170
+ ### Step 6: Build the Graphify Project Graph (If Graphify is Installed)
171
+
172
+ Installing the Graphify CLI and its project skill does **not** automatically build the project knowledge graph. Generating the graph is an explicit, model-driven operation:
173
+
174
+ 1. **Open Claude Code**: Launch your interactive agent session in the repository:
175
+ ```bash
176
+ claude
177
+ ```
178
+ 2. **Execute Graph Generation**: Inside the Claude Code prompt, run:
179
+ ```text
180
+ /graphify .
181
+ ```
182
+ *Generating the graph uses the model to analyze ASTs, symbols, and relationships. It may take several minutes depending on repository size.*
183
+
184
+ > [!IMPORTANT]
185
+ > **If Claude Code reports `"/graphify" isn't installed in this session`:**
186
+ > Claude Code indexes skills (`.claude/skills/`) and slash commands only when the session starts.
187
+ > 1. **Ensure the project skill exists on disk:** If `npx devworkspace doctor` reports `X Claude skill: missing` or `DEGRADED (cli without project skill)`, run:
188
+ > ```bash
189
+ > npx devworkspace setup --integrations --yes
190
+ > ```
191
+ > *(This executes `graphify install --project` to generate `.claude/skills/graphify/SKILL.md` and configure hooks).*
192
+ > 2. **Reload the session:** If your Claude Code session was already open when the skill was installed, reload it so the agent detects the new skill:
193
+ > - In Claude Code, run: `/reload-plugins`
194
+ > - Or restart your Claude Code session / restart VS Code.
195
+ > 3. **Run `/graphify .` again** to generate the graph.
196
+
197
+ 3. **Verify the Graph**: Exit back to your terminal and check graph status:
198
+ ```bash
199
+ npx devworkspace graph status
200
+ ```
201
+ When generated, DevWorkspace will display the graph location (`graphify-out/graph.json`), total node counts, and edge relationships. You can trace symbols with:
202
+ ```bash
203
+ npx devworkspace graph trace --from src/index.ts --depth 2
204
+ ```
205
+
206
+ **Fallback Guidance When Graphify is Not Used:**
207
+ If Graphify is not installed or `graphify-out/graph.json` has not been built, DevWorkspace continues to operate normally. MCP tools like `trace_symbol_dependencies` gracefully detect the absence of the graph, notify the agent that the knowledge graph is unavailable, and provide direct file paths to inspect instead.
208
+
209
+ ### Step 7: Verify Health and MCP Connectivity
210
+
211
+ Run the comprehensive health check to verify your setup:
74
212
 
75
- ### Step 4: Verify Workspace Readiness
76
213
  ```bash
77
214
  npx devworkspace doctor
78
215
  ```
79
- Checks workspace health, instruction files, and testing contract consistency. When it reports `Core workspace: READY`, your project is ready for development.
216
+
217
+ And if you installed optional integrations:
218
+
219
+ ```bash
220
+ npx devworkspace integrations status
221
+ ```
222
+
223
+ **Verifying MCP Connectivity & Launcher Status:**
224
+ - When an MCP agent is configured, `devworkspace doctor` automatically inspects `.mcp.json`, `mcp.json`, or `.antigravity/mcp.json` and verifies that the configured launcher executable (`devworkspace` or `npx`) can be resolved in your current environment:
225
+ `✓ PASS Configured MCP launcher is resolvable (command)`
226
+ - Inside your interactive coding agent session, verify end-to-end tool connectivity by invoking the built-in diagnostic tool:
227
+ `check_mcp_health`
228
+ - Or prompt your agent to inspect project architecture using:
229
+ `"Use get_project_overview to inspect this project."`
230
+
231
+ **Understanding the Output Terminology:**
232
+ - **`Core workspace: READY`** (or `HEALTHY`): All core checks pass—`.devworkspace/` is valid, verification commands match manifests, agent instruction files are intact, and MCP launchers resolve.
233
+ - **Integrations Statuses (reported independently from core)**:
234
+ - **`VERIFIED`**: The tool was executed and all documented capabilities checked out.
235
+ - **`NOT_INSTALLED`**: Optional integration is absent. This is normal if you did not install it.
236
+ - **`RESTART_REQUIRED`**: Files installed; agent needs to be restarted or `/reload-plugins` executed.
237
+ - **`PREREQUISITES_MISSING`**: Python 3.10+ or required tool missing; output provides exact remediation.
238
+ - **`DEGRADED`**: Installed as portable fallback skills without native CLI hooks.
239
+ - **Independent Readiness**: A healthy core workspace (`Core workspace: READY`) safely coexists with optional integrations that are `NOT_INSTALLED`. Missing optional integrations do **not** fail `devworkspace doctor`.
240
+
241
+ ---
242
+
243
+ ## Windows PowerShell Setup Example
244
+
245
+ For Windows developers using PowerShell, here is the complete sequence of commands:
246
+
247
+ ```powershell
248
+ # 1. Navigate to your project folder (use your actual project path)
249
+ Set-Location "C:\Projects\sample-app"
250
+
251
+ # 2. Initialize and discover repository structure
252
+ npx devworkspace init
253
+ npx devworkspace analyze
254
+
255
+ # 3. Configure your agent (choose MCP, file-based instructions, or both)
256
+ # Option A: Configure MCP for Claude Code
257
+ npx devworkspace setup --agent claude-code
258
+
259
+ # Option B: Install instructions for Cursor, Copilot, Codex, or Claude
260
+ npx devworkspace agent install --agent all
261
+
262
+ # 4. Optional: Install Graphify, Agent Skills & Ponytail (requires Python 3.10+ / uv)
263
+ npx devworkspace setup --integrations --yes
264
+
265
+ # 5. Verify core health and integration status
266
+ npx devworkspace doctor
267
+ npx devworkspace integrations status
268
+
269
+ # 6. If Graphify was installed, build the knowledge graph inside Claude Code:
270
+ # NOTE: Run this inside an interactive Claude Code session, NOT in PowerShell!
271
+ # claude
272
+ # > /graphify .
273
+
274
+ # 7. Acknowledge agent restart after reloading Claude Code
275
+ npx devworkspace integrations status --restarted
276
+ ```
277
+
278
+ ### macOS & Linux Setup Example
279
+
280
+ ```bash
281
+ # 1. Navigate to your project folder
282
+ cd ~/projects/sample-app
283
+
284
+ # 2. Initialize and discover repository structure
285
+ npx devworkspace init && npx devworkspace analyze
286
+
287
+ # 3. Configure your agent (choose MCP, file-based instructions, or both)
288
+ # Option A: Configure MCP for Claude Code
289
+ npx devworkspace setup --agent claude-code
290
+
291
+ # Option B: Install instructions for Cursor, Copilot, Codex, or Claude
292
+ npx devworkspace agent install --agent all
293
+
294
+ # 4. Optional: Install Graphify, Agent Skills & Ponytail (requires Python 3.10+ / uv)
295
+ npx devworkspace setup --integrations --yes
296
+
297
+ # 5. Verify core health, MCP launcher, and integration status
298
+ npx devworkspace doctor
299
+ npx devworkspace integrations status
300
+
301
+ # 6. If Graphify was installed, build the knowledge graph inside Claude Code:
302
+ # NOTE: Run this inside an interactive Claude Code session, not your terminal!
303
+ # (If Claude Code was already open, run /reload-plugins first)
304
+ # claude
305
+ # > /graphify .
306
+
307
+ # 7. Acknowledge agent restart after reloading Claude Code
308
+ npx devworkspace integrations status --restarted
309
+ ```
80
310
 
81
311
  ---
82
312
 
@@ -111,10 +341,10 @@ DevWorkspace includes a local-first Model Context Protocol (MCP 2024-11-05) serv
111
341
  # Configure Claude Code (.mcp.json and CLAUDE.md)
112
342
  npx devworkspace setup --agent claude-code
113
343
 
114
- # Configure OpenAI Codex (mcp.json and AGENTS.md)
344
+ # Configure OpenAI Codex (.codex/config.toml and AGENTS.md)
115
345
  npx devworkspace setup --agent codex
116
346
 
117
- # Configure Google Antigravity (.antigravity/mcp.json and .antigravity/rules)
347
+ # Antigravity: prints the user-level mcp_config.json entry to add; writes no project files
118
348
  npx devworkspace setup --agent antigravity
119
349
 
120
350
  # Configure all supported MCP agents at once
@@ -127,6 +357,29 @@ npx devworkspace setup --agent claude-code --check
127
357
  devworkspace mcp serve
128
358
  ```
129
359
 
360
+ ### What `setup --agent` does, and what it cannot verify
361
+
362
+ `npx devworkspace setup --agent <claude-code|codex|antigravity|all|auto>` runs, in order: workspace initialization (only if missing) → launcher selection → config merge (other MCP servers and your own instructions are preserved; re-running is a no-op) → re-validation of the written JSON → a live start of the configured server (`initialize`, `tools/list`, `get_project_overview`, `get_task_context`). Each stage is reported separately. Use `--check` to preview without writing and `--no-verify` to skip the live start.
363
+
364
+ That live check exercises the server **on its own**. Registration, approval and connection **inside your agent** cannot be verified from outside: Claude Code asks you to approve project-scoped servers (check with `/mcp`), and Codex/Antigravity need a restart to reload their configuration. If a stage fails, the report names it (launch, initialize, tools list, tool call, context) with the fix; setup is safe to re-run.
365
+
366
+ ### Automatic Launcher Selection & CLI Flags
367
+
368
+ When you configure an MCP agent via `npx devworkspace setup --agent <name>` (or `devworkspace mcp setup --agent <name>`), DevWorkspace automatically inspects your environment and selects the appropriate launcher strategy:
369
+
370
+ - **Direct Global Binary (`command: "devworkspace"`, `args: ["mcp", "serve"]`):** Used when `devworkspace` is on `PATH`, is not running from a temporary npx cache, **and** reports the same version as the CLI you are running. A different installed version is not trusted; setup falls back to `npx`.
371
+ - **npx Launcher (`command: "npx"`, `args: ["-y", "devworkspace", "mcp", "serve"]`):** Used when no matching executable is found. On Windows the entry is written as `cmd /c npx ...`, because clients cannot spawn `npx.cmd` directly.
372
+ - The chosen launcher and the reason are printed by setup. No source-checkout paths are ever written to config.
373
+
374
+ Supported CLI options for MCP configuration:
375
+ - `--launcher auto`: Default automatic environment detection.
376
+ - `--launcher direct`: Force direct executable launcher (`"command": "devworkspace"`).
377
+ - `--launcher npx`: Force `npx` launcher (`"command": "npx"`).
378
+ - `--package-version <version>`: Explicitly pin an npm package version in npx mode (e.g. `--package-version 0.4.3` produces `devworkspace@0.4.3`).
379
+ - `--agent auto`: Configure agents detected from project files (`.claude/`, `CLAUDE.md`, `.mcp.json` → Claude Code; `.codex/`, `AGENTS.md` → Codex; `.antigravity/` → Antigravity guidance); defaults to Claude Code when nothing is detected.
380
+ - `--no-verify`: Skip the live server start/handshake check.
381
+ - `--check` (or `--dry-run`): Preview planned file changes without modifying disk.
382
+
130
383
  ### Available MCP Tools
131
384
 
132
385
  Once configured, the following tools are available to the agent:
@@ -140,11 +393,16 @@ Once configured, the following tools are available to the agent:
140
393
 
141
394
  ### Important Notes on MCP Usage
142
395
 
143
- - **Tool Invocation Depends on the Agent:** Registering the MCP server makes tools *available* to your coding agent. Whether and when the agent invokes a tool depends on the user's prompt, the agent's internal system prompt, and the model's decision-making. You can prompt the agent directly: *"Use get_project_overview to inspect this project"* or *"Call get_task_context for this bug fix"*.
144
- - **Automated Tests vs. Live Agent Sessions:** DevWorkspace's MCP server and stdio transport are verified with automated subprocess integration and protocol test suites. However, interactive tool calling in proprietary desktop or terminal sessions (such as closed GUI builds of Claude Code, Codex, or Antigravity) has not been tested in live interactive client sessions and depends on each client's specific implementation.
145
- - **PATH Requirement:** Generated configurations specify `"command": "devworkspace"`. Ensure `devworkspace` is in your environment `PATH` (e.g. `npm install -g devworkspace`). If running locally without global binaries, change the command in `.mcp.json` / `mcp.json` / `.antigravity/mcp.json` to `"npx"` with arguments `["-y", "devworkspace", "mcp", "serve"]`.
396
+ - **Automatic Configuration:** Run `npx devworkspace setup --agent claude-code` to generate the Claude Code MCP configuration. DevWorkspace selects the appropriate launcher based on the available installation and runtime environment. Users should not need to edit `.mcp.json` manually for a standard supported setup.
397
+ - **Verify Connectivity:** After configuration, restart or reload the coding agent if required. Confirm that the DevWorkspace MCP tools are available and call `check_mcp_health` to verify the connection.
398
+ - **Tool Invocation:** Registering an MCP server makes its tools available; it does not guarantee that the AI agent will invoke them for every request. Ask the agent to use `get_project_overview` or `get_task_context` when you want to verify context retrieval.
399
+ - **Client Compatibility:** Automated tests verify the MCP server and stdio protocol, but live tool invocation depends on the specific coding agent and its environment.
400
+
401
+ For launcher troubleshooting and supported options, see [docs/mcp.md](docs/mcp.md).
402
+
403
+ ### Where files are written
146
404
 
147
- Full MCP technical manual and debugging options: [docs/mcp.md](docs/mcp.md).
405
+ DevWorkspace's own data lives in `.devworkspace/`. Agent files (`.mcp.json`, `CLAUDE.md`, `AGENTS.md`, `.claude/`) stay where agents look for them, and Graphify's `graphify-out/` stays at the project root because Graphify's own commands require it. Existing workspaces need no migration. Details: [docs/integrations.md](docs/integrations.md#where-generated-files-live).
148
406
 
149
407
  ---
150
408
 
@@ -240,6 +498,20 @@ Details on scopes, prerequisites, and integration health checks: [docs/integrati
240
498
 
241
499
  ---
242
500
 
501
+ ## Troubleshooting & Common Setup Issues
502
+
503
+ | Symptom | Documented Resolution | Relevant Guide |
504
+ | --- | --- | --- |
505
+ | **Agent instructions missing** | Run `npx devworkspace agent install --agent <name>` (or `--agent all`) to generate managed instruction blocks (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`, or Copilot rules). | [Agent Integrations](docs/agents.md) |
506
+ | **MCP server or configuration missing** | Run `npx devworkspace setup --agent <name>` (or `npx devworkspace mcp setup --agent <name>`) to configure `.mcp.json`, `mcp.json`, or `.antigravity/mcp.json`. DevWorkspace automatically selects the direct binary or npx launcher without manual configuration. | [MCP Guide](docs/mcp.md) |
507
+ | **`RESTART_REQUIRED` status** | Newly installed Claude Code plugins or skills must be loaded into memory. In Claude Code, run `/reload-plugins` or restart your CLI session. In IDEs, reload the window. Then acknowledge the restart with `npx devworkspace integrations status --restarted`. | [Integrations](docs/integrations.md) |
508
+ | **Graphify CLI missing** | Install Python 3.10+ (or `uv` / `pipx`), then run `npx devworkspace setup --integrations --yes`. Alternatively, install Graphify directly via `uv tool install graphifyy` or `pipx install graphifyy`. | [Integrations](docs/integrations.md) |
509
+ | **Graphify skill missing / `"/graphify" isn't installed in this session`** | If `doctor` reports `Claude skill: missing` or `DEGRADED (cli without project skill)`, run `npx devworkspace setup --integrations --yes` (or `npx devworkspace integrations repair --yes`) to install `.claude/skills/graphify/SKILL.md`. If Claude Code was already open, run `/reload-plugins` in Claude Code or restart the session before running `/graphify .`. | [Integrations](docs/integrations.md) |
510
+ | **No graph built yet** | Installing the Graphify CLI and skill does not build the graph automatically. Launch Claude Code (`claude`) and run `/graphify .` in the session. Verify the generated graph with `npx devworkspace graph status`. | [Integrations](docs/integrations.md) |
511
+ | **Core workspace healthy but integrations incomplete** | Core workspace health (`Core workspace: READY`) and optional integration readiness are independent. Missing optional integrations (status `NOT_INSTALLED`) do not affect core DevWorkspace context, testing contracts, or MCP tools. | [Troubleshooting](docs/troubleshooting.md) |
512
+
513
+ ---
514
+
243
515
  ## Portability
244
516
 
245
517
  Commit `.devworkspace/` to your version control system (machine-local files in `.devworkspace/local/` are ignored automatically). On another workstation, clone the repository and run `npx devworkspace doctor`. Project identity is managed via a UUID in `project.json` rather than hardcoded file paths, so repository paths can change without breaking project state. Full guide: [docs/portability.md](docs/portability.md).
@@ -83,6 +83,15 @@ export declare const OPTIONS: {
83
83
  readonly agent: {
84
84
  readonly type: "string";
85
85
  };
86
+ readonly launcher: {
87
+ readonly type: "string";
88
+ };
89
+ readonly 'package-version': {
90
+ readonly type: "string";
91
+ };
92
+ readonly 'no-verify': {
93
+ readonly type: "boolean";
94
+ };
86
95
  readonly type: {
87
96
  readonly type: "string";
88
97
  };
package/dist/cli/args.js CHANGED
@@ -28,6 +28,9 @@ export const OPTIONS = {
28
28
  full: { type: 'boolean' },
29
29
  all: { type: 'boolean' },
30
30
  agent: { type: 'string' },
31
+ launcher: { type: 'string' },
32
+ 'package-version': { type: 'string' },
33
+ 'no-verify': { type: 'boolean' },
31
34
  type: { type: 'string' },
32
35
  title: { type: 'string' },
33
36
  key: { type: 'string' },
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,qGAAqG;AACrG,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,SAAS,EAA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C,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC1G,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { parseArgs } from 'node:util';\nimport { DevWorkspaceError } from '../errors/index.js';\n\ntype OptionSpec = { type: 'boolean' | 'string'; short?: string; multiple?: boolean };\n\n/** Every flag the CLI understands. Unknown flags are rejected so typos never silently do nothing. */\nexport const OPTIONS = {\n help: { type: 'boolean', short: 'h' },\n version: { type: 'boolean', short: 'v' },\n json: { type: 'boolean' },\n debug: { type: 'boolean' },\n 'no-color': { type: 'boolean' },\n ascii: { type: 'boolean' },\n 'dry-run': { type: 'boolean' },\n yes: { type: 'boolean', short: 'y' },\n 'include-agent-files': { type: 'boolean' },\n integrations: { type: 'boolean' },\n 'with-integrations': { type: 'boolean' },\n only: { type: 'string', multiple: true },\n scope: { type: 'string' },\n restarted: { type: 'boolean' },\n quick: { type: 'boolean' },\n cwd: { type: 'string' },\n root: { type: 'string' },\n fix: { type: 'boolean' },\n strict: { type: 'boolean' },\n out: { type: 'string', short: 'o' },\n overwrite: { type: 'boolean' },\n 'allow-different-project': { type: 'boolean' },\n topic: { type: 'string' },\n full: { type: 'boolean' },\n all: { type: 'boolean' },\n agent: { type: 'string' },\n type: { type: 'string' },\n title: { type: 'string' },\n key: { type: 'string' },\n value: { type: 'string' },\n source: { type: 'string' },\n 'source-type': { type: 'string' },\n file: { type: 'string', multiple: true },\n confidence: { type: 'string' },\n status: { type: 'string' },\n reason: { type: 'string' },\n detail: { type: 'string' },\n note: { type: 'string' },\n phase: { type: 'string' },\n passed: { type: 'string' },\n failed: { type: 'string' },\n criteria: { type: 'string', multiple: true },\n plan: { type: 'string', multiple: true },\n area: { type: 'string', multiple: true },\n 'decision-note': { type: 'string', multiple: true },\n summary: { type: 'string' },\n blocker: { type: 'string', multiple: true },\n 'clear-blockers': { type: 'boolean' },\n require: { type: 'string', multiple: true },\n 'user-work-intact': { type: 'boolean' },\n 'knowledge-reviewed': { type: 'boolean' },\n 'final-state-inspected': { type: 'boolean' },\n context: { type: 'string' },\n for: { type: 'string' },\n role: { type: 'string' },\n decision: { type: 'string' },\n consequences: { type: 'string' },\n supersedes: { type: 'string' },\n goal: { type: 'string' },\n done: { type: 'string', multiple: true },\n 'tests-run': { type: 'string', multiple: true },\n remaining: { type: 'string', multiple: true },\n next: { type: 'string' },\n task: { type: 'string' },\n limit: { type: 'string' },\n package: { type: 'string' },\n check: { type: 'string', multiple: true },\n target: { type: 'string' },\n timeout: { type: 'string' },\n deep: { type: 'boolean' },\n id: { type: 'string' },\n name: { type: 'string' },\n description: { type: 'string' },\n symbol: { type: 'string' },\n entry: { type: 'string', multiple: true },\n route: { type: 'string', multiple: true },\n service: { type: 'string', multiple: true },\n model: { type: 'string', multiple: true },\n test: { type: 'string', multiple: true },\n tag: { type: 'string', multiple: true },\n from: { type: 'string' },\n depth: { type: 'string' },\n} as const satisfies Record<string, OptionSpec>;\n\nexport interface ParsedArgs {\n positionals: string[];\n values: Record<string, string | boolean | string[] | undefined>;\n}\n\nexport function parseCli(argv: string[]): ParsedArgs {\n try {\n const normalizedArgv = argv.map((arg, idx) => {\n if (arg === '--check') {\n const next = argv[idx + 1];\n if (!next || next.startsWith('-')) {\n return '--check=true';\n }\n }\n return arg;\n });\n const { values, positionals } = parseArgs({ args: normalizedArgv, options: OPTIONS, allowPositionals: true, strict: true });\n return { positionals, values: values as ParsedArgs['values'] };\n } catch (e) {\n throw new DevWorkspaceError('USAGE', (e as Error).message.replace(/^Unknown option/, 'Unknown option'), {\n hint: 'Run \"devworkspace --help\" or \"devworkspace <command> --help\".',\n });\n }\n}\n\nexport function str(v: ParsedArgs['values'], k: string): string | undefined {\n const x = v[k];\n return typeof x === 'string' ? x : undefined;\n}\n\nexport function bool(v: ParsedArgs['values'], k: string): boolean {\n return v[k] === true;\n}\n\nexport function isCheckOrDryRun(v: ParsedArgs['values']): boolean {\n if (bool(v, 'dry-run')) return true;\n const checks = list(v, 'check');\n return checks.includes('true');\n}\n\nexport function list(v: ParsedArgs['values'], k: string): string[] {\n const x = v[k];\n return Array.isArray(x) ? x : [];\n}\n\nexport function int(v: ParsedArgs['values'], k: string): number | undefined {\n const s = str(v, k);\n if (s === undefined) return undefined;\n const n = Number(s);\n if (!Number.isInteger(n)) throw new DevWorkspaceError('USAGE', `--${k} must be an integer (got \"${s}\").`);\n return n;\n}\n"]}
1
+ {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,qGAAqG;AACrG,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC9B,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACpC,qBAAqB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1C,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACjC,mBAAmB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,E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O,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { parseArgs } from 'node:util';\nimport { DevWorkspaceError } from '../errors/index.js';\n\ntype OptionSpec = { type: 'boolean' | 'string'; short?: string; multiple?: boolean };\n\n/** Every flag the CLI understands. Unknown flags are rejected so typos never silently do nothing. */\nexport const OPTIONS = {\n help: { type: 'boolean', short: 'h' },\n version: { type: 'boolean', short: 'v' },\n json: { type: 'boolean' },\n debug: { type: 'boolean' },\n 'no-color': { type: 'boolean' },\n ascii: { type: 'boolean' },\n 'dry-run': { type: 'boolean' },\n yes: { type: 'boolean', short: 'y' },\n 'include-agent-files': { type: 'boolean' },\n integrations: { type: 'boolean' },\n 'with-integrations': { type: 'boolean' },\n only: { type: 'string', multiple: true },\n scope: { type: 'string' },\n restarted: { type: 'boolean' },\n quick: { type: 'boolean' },\n cwd: { type: 'string' },\n root: { type: 'string' },\n fix: { type: 'boolean' },\n strict: { type: 'boolean' },\n out: { type: 'string', short: 'o' },\n overwrite: { type: 'boolean' },\n 'allow-different-project': { type: 'boolean' },\n topic: { type: 'string' },\n full: { type: 'boolean' },\n all: { type: 'boolean' },\n agent: { type: 'string' },\n launcher: { type: 'string' },\n 'package-version': { type: 'string' },\n 'no-verify': { type: 'boolean' },\n type: { type: 'string' },\n title: { type: 'string' },\n key: { type: 'string' },\n value: { type: 'string' },\n source: { type: 'string' },\n 'source-type': { type: 'string' },\n file: { type: 'string', multiple: true },\n confidence: { type: 'string' },\n status: { type: 'string' },\n reason: { type: 'string' },\n detail: { type: 'string' },\n note: { type: 'string' },\n phase: { type: 'string' },\n passed: { type: 'string' },\n failed: { type: 'string' },\n criteria: { type: 'string', multiple: true },\n plan: { type: 'string', multiple: true },\n area: { type: 'string', multiple: true },\n 'decision-note': { type: 'string', multiple: true },\n summary: { type: 'string' },\n blocker: { type: 'string', multiple: true },\n 'clear-blockers': { type: 'boolean' },\n require: { type: 'string', multiple: true },\n 'user-work-intact': { type: 'boolean' },\n 'knowledge-reviewed': { type: 'boolean' },\n 'final-state-inspected': { type: 'boolean' },\n context: { type: 'string' },\n for: { type: 'string' },\n role: { type: 'string' },\n decision: { type: 'string' },\n consequences: { type: 'string' },\n supersedes: { type: 'string' },\n goal: { type: 'string' },\n done: { type: 'string', multiple: true },\n 'tests-run': { type: 'string', multiple: true },\n remaining: { type: 'string', multiple: true },\n next: { type: 'string' },\n task: { type: 'string' },\n limit: { type: 'string' },\n package: { type: 'string' },\n check: { type: 'string', multiple: true },\n target: { type: 'string' },\n timeout: { type: 'string' },\n deep: { type: 'boolean' },\n id: { type: 'string' },\n name: { type: 'string' },\n description: { type: 'string' },\n symbol: { type: 'string' },\n entry: { type: 'string', multiple: true },\n route: { type: 'string', multiple: true },\n service: { type: 'string', multiple: true },\n model: { type: 'string', multiple: true },\n test: { type: 'string', multiple: true },\n tag: { type: 'string', multiple: true },\n from: { type: 'string' },\n depth: { type: 'string' },\n} as const satisfies Record<string, OptionSpec>;\n\nexport interface ParsedArgs {\n positionals: string[];\n values: Record<string, string | boolean | string[] | undefined>;\n}\n\nexport function parseCli(argv: string[]): ParsedArgs {\n try {\n const normalizedArgv = argv.map((arg, idx) => {\n if (arg === '--check') {\n const next = argv[idx + 1];\n if (!next || next.startsWith('-')) {\n return '--check=true';\n }\n }\n return arg;\n });\n const { values, positionals } = parseArgs({ args: normalizedArgv, options: OPTIONS, allowPositionals: true, strict: true });\n return { positionals, values: values as ParsedArgs['values'] };\n } catch (e) {\n throw new DevWorkspaceError('USAGE', (e as Error).message.replace(/^Unknown option/, 'Unknown option'), {\n hint: 'Run \"devworkspace --help\" or \"devworkspace <command> --help\".',\n });\n }\n}\n\nexport function str(v: ParsedArgs['values'], k: string): string | undefined {\n const x = v[k];\n return typeof x === 'string' ? x : undefined;\n}\n\nexport function bool(v: ParsedArgs['values'], k: string): boolean {\n return v[k] === true;\n}\n\nexport function isCheckOrDryRun(v: ParsedArgs['values']): boolean {\n if (bool(v, 'dry-run')) return true;\n const checks = list(v, 'check');\n return checks.includes('true');\n}\n\nexport function list(v: ParsedArgs['values'], k: string): string[] {\n const x = v[k];\n return Array.isArray(x) ? x : [];\n}\n\nexport function int(v: ParsedArgs['values'], k: string): number | undefined {\n const s = str(v, k);\n if (s === undefined) return undefined;\n const n = Number(s);\n if (!Number.isInteger(n)) throw new DevWorkspaceError('USAGE', `--${k} must be an integer (got \"${s}\").`);\n return n;\n}\n"]}
package/dist/cli/help.js CHANGED
@@ -22,12 +22,15 @@ export const COMMANDS = [
22
22
  summary: 'Single-command repository setup (inspect, initialize, discover contract & validate)',
23
23
  usage: [
24
24
  'devworkspace setup',
25
- 'devworkspace setup --agent claude-code|codex|antigravity|all [--check]',
25
+ 'devworkspace setup --agent claude-code|codex|antigravity|all|auto [--check] [--no-verify] [--launcher auto|direct|npx] [--package-version <v>]',
26
26
  'devworkspace setup --integrations [--yes] [--dry-run] [--scope project|user] [--only graphify,agent-skills,ponytail]',
27
27
  ],
28
28
  options: [
29
- ['--agent <name>', 'configure MCP integration for agent (claude-code, codex, antigravity, all)'],
29
+ ['--agent <name>', 'initialize if needed, configure MCP for agent (claude-code, codex, antigravity, all, auto = detect) and verify the server starts'],
30
30
  ['--check', 'with --agent: validate and plan without writing files'],
31
+ ['--no-verify', 'with --agent: skip starting the MCP server to verify it'],
32
+ ['--launcher auto|direct|npx', 'how agents start the server (default auto: PATH binary if version-matched, else npx)'],
33
+ ['--package-version <v>', 'pin the npx launcher to devworkspace@<v>'],
31
34
  ['--integrations', 'set up external integrations (Graphify, Agent Skills, Ponytail)'],
32
35
  ['--dry-run', 'show exactly what would run; changes nothing'],
33
36
  ['--yes', 'with --integrations: approve machine-level and third-party installs'],
@@ -278,11 +281,12 @@ export const COMMANDS = [
278
281
  summary: 'Local-first Model Context Protocol (MCP) server and agent configuration',
279
282
  usage: [
280
283
  'devworkspace mcp serve [--debug]',
281
- 'devworkspace mcp setup [--agent claude-code|codex|antigravity|all] [--check]',
284
+ 'devworkspace mcp setup [--agent claude-code|codex|antigravity|all|auto] [--check] [--no-verify]',
282
285
  ],
283
286
  options: [
284
- ['--agent <name>', 'agent to configure (claude-code, codex, antigravity, all)'],
287
+ ['--agent <name>', 'agent to configure (claude-code, codex, antigravity, all, auto)'],
285
288
  ['--check', 'validate and plan configuration without modifying files'],
289
+ ['--no-verify', 'skip the live server start/handshake check'],
286
290
  ...COMMON,
287
291
  ],
288
292
  examples: [