Skip to content

[wrangler] Fix wrangler complete printing AI skills prompt into shell completion output#14041

Merged
NuroDev merged 5 commits into
cloudflare:mainfrom
matingathani:fix/complete-skip-skills-prompt
Jun 2, 2026
Merged

[wrangler] Fix wrangler complete printing AI skills prompt into shell completion output#14041
NuroDev merged 5 commits into
cloudflare:mainfrom
matingathani:fix/complete-skip-skills-prompt

Conversation

@matingathani

@matingathani matingathani commented May 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #14033.

`eval "$(wrangler complete zsh)"` was broken by the skills installation prompt introduced in #13897. The `complete` command's stdout is captured by the shell to be sourced as commands — the interactive AI agent detection prompt appeared in that output, causing:

```
zsh: command not found: --install-skills
zsh: command not found: Cloudflare
```

Root cause

`maybeInstallCloudflareSkillsGlobally` is called unconditionally in `register-yargs-command.ts` for every command, including `complete`.

Fix

Added `skipSkillsPrompt?: boolean` to the shared `behaviour` type and set it to `true` on the `complete` command. The skills prompt is skipped when this flag is set.


  • Tests
    • Tests included/updated
  • Public documentation
    • Documentation not necessary because: bug fix with no user-facing API change; the correct behavior (no prompt during `complete`) is self-evident

Open in Devin Review

…ll completion output

Add `skipSkillsPrompt` behaviour flag and set it on the `complete` command so
`eval "$(wrangler complete zsh)"` no longer injects the interactive prompt into
the completion script, causing shell errors on eval.
Copilot AI review requested due to automatic review settings May 25, 2026 16:41
@changeset-bot

changeset-bot Bot commented May 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e7bf5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/wrangler-bundler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk May 25, 2026
@workers-devprod workers-devprod requested review from a team and NuroDev and removed request for a team May 25, 2026 16:41
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/fix-complete-skip-skills-prompt.md: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/register-yargs-command-skills.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/complete.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/core/register-yargs-command.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/core/types.ts: [@cloudflare/wrangler]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a command-level switch to suppress the AI skills installation prompt so wrangler complete output remains clean for shell evaluation.

Changes:

  • Introduces skipSkillsPrompt in command behaviour metadata.
  • Skips the skills installation flow when the flag is enabled (used by wrangler complete).
  • Adds a regression test and a changeset entry documenting the fix.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/wrangler/src/core/types.ts Adds skipSkillsPrompt to command behaviour typing/docs.
packages/wrangler/src/core/register-yargs-command.ts Conditionally bypasses skills install/prompt flow based on command behaviour.
packages/wrangler/src/complete.ts Enables skipSkillsPrompt for wrangler complete.
packages/wrangler/src/tests/register-yargs-command-skills.test.ts Adds regression test ensuring complete doesn’t invoke skills install flow.
.changeset/fix-complete-skip-skills-prompt.md Records patch change and rationale for release notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/wrangler/src/core/register-yargs-command.ts Outdated
Comment thread packages/wrangler/src/__tests__/register-yargs-command-skills.test.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented May 25, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14041

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14041

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14041

miniflare

npm i https://pkg.pr.new/miniflare@14041

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14041

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14041

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14041

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14041

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14041

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14041

wrangler

npm i https://pkg.pr.new/wrangler@14041

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/@cloudflare/wrangler-bundler@14041

commit: 9e7bf5d

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix @matingathani 🙏

The fix looks correct to me, however the two comments copilot made are both valid, could you have a look? 🙏

matingathani and others added 2 commits May 27, 2026 09:49
- Still call `maybeInstallCloudflareSkillsGlobally` when the user explicitly
  passes `--install-skills`, even on commands with `skipSkillsPrompt: true`.
  Only the unprompted/automatic detection is suppressed for `complete`.
- Remove `.catch(() => {})` swallowing all failures in the test; assert
  `runWrangler("complete zsh")` resolves cleanly.
- Add a test confirming `--install-skills` is honoured on `complete`.
@MattieTK

MattieTK commented May 27, 2026

Copy link
Copy Markdown
Member

@dario-piotrowicz do we need a test to prevent breaking this in the future? (I now see this contains a test...)

@workers-devprod

workers-devprod commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@NuroDev NuroDev merged commit 5565823 into cloudflare:main Jun 2, 2026
58 of 59 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Shell completions prompt Wrangler AI agent detection prompt

6 participants