Skip to content

feat(cli): add interactive setup wizard and modernize init command#247

Open
cameroncooke wants to merge 2 commits intomainfrom
feat/setup-wizard
Open

feat(cli): add interactive setup wizard and modernize init command#247
cameroncooke wants to merge 2 commits intomainfrom
feat/setup-wizard

Conversation

@cameroncooke
Copy link
Collaborator

Add xcodebuildmcp setup — an interactive terminal wizard that configures project defaults (project/workspace, scheme, simulator, workflows, debug mode, Sentry opt-out) and persists results to .xcodebuildmcp/config.yaml.

Previously users had to hand-edit YAML to configure their project. The setup wizard discovers available projects, schemes, and simulators, presents them in a polished terminal UI via @clack/prompts, and writes a complete config file with a summary of what changed.

Supporting changes:

  • Shared Prompter abstraction (src/cli/interactive/prompts.ts) — wraps @clack/prompts with a testable interface that auto-selects defaults in non-interactive mode
  • sentryDisabled promoted to first-class config key — previously env-var-only (XCODEBUILDMCP_SENTRY_DISABLED), now settable in config.yaml and resolved through the standard config layering. A new hydrateSentryDisabledEnvFromProjectConfig() bridges the config file to the env var before Sentry init in all three entrypoints (cli, daemon, mcp server)
  • MCP tool refactors — extracted reusable discoverProjects(), listSchemes(), and listSimulators() functions from the MCP *Logic wrappers so both the MCP layer and CLI can call them directly. No behavior change to MCP tool responses
  • init command modernized — switched from raw readline to @clack/prompts, added interactive skill type and client selection when no flags are provided, replaced Cursor/Codex targets with generic "Agents Skills" target, added ~ expansion for --dest
  • persistProjectConfigPatch() — new utility for atomic config file updates with support for mutually exclusive key cleanup (projectPath vs workspacePath)

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
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@247

commit: 090f7ec

Extract shared isInteractiveTTY() to prompts.ts and add try/catch to
withSpinner so the spinner is stopped if the task throws, preventing
garbled terminal output on error.
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

.filter((workflow) => !WORKFLOW_EXCLUDES.has(workflow.id))
.filter((workflow) => isWorkflowEnabledForRuntime(workflow, predicateContext))
.sort((left, right) => left.id.localeCompare(right.id));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup wizard uses uninitialized config store for workflows

Medium Severity

getWorkflowOptions calls getConfig() to build the predicate context for filtering visible workflows. However, the setup command exits early in cli.ts before bootstrapRuntime / initConfigStore runs, so getConfig() returns only defaults (e.g., experimentalWorkflowDiscovery: false). The existing project config loaded via loadProjectConfig earlier in the wizard is never fed into the workflow-visibility predicates. Workflows gated behind config-file settings (like experimental ones) won't appear in the setup prompt even when the user's existing config enables them.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant