Skip to content

Commit b0204d7

Browse files
committed
feat(cli): add interactive setup wizard and modernize init command
Add `xcodebuildmcp setup` — an interactive terminal wizard that walks users through configuring project defaults (project/workspace, scheme, simulator, workflows, debug mode, Sentry opt-out) and persists the result to .xcodebuildmcp/config.yaml. Key changes: - New setup command with clack-based interactive prompts - Shared Prompter abstraction for testable TTY/non-interactive prompts - Promote sentryDisabled from env-var-only to first-class config key - Extract reusable functions from discover_projs, list_schemes, list_sims so both MCP tools and CLI can call them directly - Modernize init command to use clack prompts and interactive selection - Replace Cursor/Codex client targets with generic Agents Skills target - Add persistProjectConfigPatch for atomic config file updates
1 parent 1bcc988 commit b0204d7

33 files changed

Lines changed: 1703 additions & 227 deletions

config.example.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ enabledWorkflows: ['simulator', 'ui-automation', 'debugging']
33
experimentalWorkflowDiscovery: false
44
disableSessionDefaults: false
55
incrementalBuildsEnabled: false
6+
debug: false
7+
sentryDisabled: false
68
sessionDefaults:
79
projectPath: './MyApp.xcodeproj' # xor workspacePath
810
workspacePath: './MyApp.xcworkspace' # xor projectPath

docs/CLI.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ xcodebuildmcp --help
2525

2626
# View tool help
2727
xcodebuildmcp <workflow> <tool> --help
28+
29+
# Run interactive setup for .xcodebuildmcp/config.yaml
30+
xcodebuildmcp setup
2831
```
2932

3033
## Tool Options
@@ -116,6 +119,8 @@ enabledWorkflows:
116119
117120
See [CONFIGURATION.md](CONFIGURATION.md) for the full schema.
118121
122+
To create/update config interactively, run `xcodebuildmcp setup`.
123+
119124
## Environment Variables
120125

121126
| Variable | Description |

docs/CONFIGURATION.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Create a config file at your workspace root:
2525
<workspace-root>/.xcodebuildmcp/config.yaml
2626
```
2727

28+
Or run the interactive setup wizard:
29+
30+
```bash
31+
xcodebuildmcp setup
32+
```
33+
2834
Minimal example:
2935

3036
```yaml
@@ -61,6 +67,7 @@ incrementalBuildsEnabled: false
6167

6268
# Debugging
6369
debug: false
70+
sentryDisabled: false
6471
debuggerBackend: "dap"
6572
dapRequestTimeoutMs: 30000
6673
dapLogEvents: false
@@ -262,8 +269,13 @@ Default templates:
262269
By default, only internal XcodeBuildMCP runtime failures are sent to Sentry. User-domain errors (such as project build/test/config failures) are not sent. To disable telemetry entirely:
263270

264271
```yaml
265-
# Environment variable only (no config.yaml option)
266-
# XCODEBUILDMCP_SENTRY_DISABLED=true
272+
sentryDisabled: true
273+
```
274+
275+
You can also disable telemetry via environment variable:
276+
277+
```bash
278+
XCODEBUILDMCP_SENTRY_DISABLED=true
267279
```
268280

269281
See [PRIVACY.md](PRIVACY.md) for more information.
@@ -286,6 +298,7 @@ Notes:
286298
| `sessionDefaults` | object | `{}` |
287299
| `incrementalBuildsEnabled` | boolean | `false` |
288300
| `debug` | boolean | `false` |
301+
| `sentryDisabled` | boolean | `false` |
289302
| `debuggerBackend` | string | `"dap"` |
290303
| `dapRequestTimeoutMs` | number | `30000` |
291304
| `dapLogEvents` | boolean | `false` |
@@ -310,6 +323,7 @@ Environment variables are supported for backwards compatibility but the config f
310323
| `disableSessionDefaults` | `XCODEBUILDMCP_DISABLE_SESSION_DEFAULTS` |
311324
| `incrementalBuildsEnabled` | `INCREMENTAL_BUILDS_ENABLED` |
312325
| `debug` | `XCODEBUILDMCP_DEBUG` |
326+
| `sentryDisabled` | `XCODEBUILDMCP_SENTRY_DISABLED` |
313327
| `debuggerBackend` | `XCODEBUILDMCP_DEBUGGER_BACKEND` |
314328
| `dapRequestTimeoutMs` | `XCODEBUILDMCP_DAP_REQUEST_TIMEOUT_MS` |
315329
| `dapLogEvents` | `XCODEBUILDMCP_DAP_LOG_EVENTS` |
@@ -320,7 +334,6 @@ Environment variables are supported for backwards compatibility but the config f
320334
| `iosTemplateVersion` | `XCODEBUILD_MCP_IOS_TEMPLATE_VERSION` |
321335
| `macosTemplatePath` | `XCODEBUILDMCP_MACOS_TEMPLATE_PATH` |
322336
| `macosTemplateVersion` | `XCODEBUILD_MCP_MACOS_TEMPLATE_VERSION` |
323-
| (no config option) | `XCODEBUILDMCP_SENTRY_DISABLED` |
324337

325338
Config file takes precedence over environment variables when both are set.
326339

docs/GETTING_STARTED.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ For deterministic session defaults and runtime configuration, add a config file
6969
<workspace-root>/.xcodebuildmcp/config.yaml
7070
```
7171

72+
Use the setup wizard to create or update this file interactively:
73+
74+
```bash
75+
xcodebuildmcp setup
76+
```
77+
7278
See [CONFIGURATION.md](CONFIGURATION.md) for the full schema and examples.
7379

7480
## Client-specific configuration

docs/TOOLS-CLI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
189189

190190
---
191191

192-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-22T18:16:55.247Z UTC*
192+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-27T19:40:32.655Z UTC*

docs/TOOLS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,4 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
205205

206206
---
207207

208-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-22T18:16:55.247Z UTC*
208+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-27T19:40:32.655Z UTC*

example_projects/iOS_Calculator/.xcodebuildmcp/config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
schemaVersion: 1
22
enabledWorkflows:
3+
- debugging
34
- simulator
45
- ui-automation
5-
- debugging
66
- xcode-ide
77
sessionDefaults:
8-
workspacePath: ./CalculatorApp.xcworkspace
8+
workspacePath: CalculatorApp.xcworkspace
99
scheme: CalculatorApp
1010
configuration: Debug
1111
simulatorName: iPhone 17 Pro
@@ -17,3 +17,5 @@ sessionDefaults:
1717
derivedDataPath: ./iOS_Calculator/.derivedData
1818
preferXcodebuild: true
1919
bundleId: io.sentry.calculatorapp
20+
debug: false
21+
sentryDisabled: false

package-lock.json

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"url": "https://github.com/getsentry/XcodeBuildMCP/issues"
7171
},
7272
"dependencies": {
73+
"@clack/prompts": "^1.0.1",
7374
"@modelcontextprotocol/sdk": "^1.25.1",
7475
"@sentry/cli": "^3.1.0",
7576
"@sentry/node": "^10.38.0",

scripts/check-docs-cli-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function extractCommandCandidates(content) {
125125
}
126126

127127
function findInvalidCommands(files, validPairs, validWorkflows) {
128-
const validTopLevel = new Set(['mcp', 'tools', 'daemon', 'init']);
128+
const validTopLevel = new Set(['mcp', 'tools', 'daemon', 'init', 'setup']);
129129
const validDaemonActions = new Set(['status', 'start', 'stop', 'restart', 'list']);
130130
const findings = [];
131131

0 commit comments

Comments
 (0)