Skip to content

[Bug] Click's Windows glob expansion causes CLI commands to fail when wildcards (e.g. "*") are passed as options #6248

Closed

Description

@Abdullah-k0de

🔴 Required Information

Describe the Bug:
On Windows, running adk CLI commands with wildcard characters like * in option arguments (such as --allow_origins "*") causes Click to expand the * wildcard into a list of filenames from the current working directory. The command then fails with Error: Got unexpected extra arguments before the command handler even runs.

Steps to Reproduce:

  1. On a Windows machine, create or navigate to a directory containing multiple files (e.g., Dockerfile, README.md, tests).
  2. Run any ADK command passing a wildcard argument, for example:
    adk web . --allow_origins "*"
    

Expected Behavior:
The command should treat * as a literal string argument (e.g., enabling CORS for all origins *) and start the web server.

Observed Behavior:
The command fails immediately before reaching the handler:

Usage: adk web [OPTIONS] [AGENTS_DIR]
Try 'adk web --help' for help.

Error: Got unexpected extra arguments (Dockerfile README.md tests)

Environment Details:

  • ADK Library Version (pip show google-adk): All versions on Windows
  • Desktop OS:** Windows
  • Python Version (python -V): 3.12.6

Model Information:

  • Are you using LiteLLM: N/A
  • Which model is being used: N/A

Screenshots / Video:
Shows the terminal of the error:

Image

Video shows the fix on the pr:

Video.of.pr.mp4

Additional Context:
This was originally observed through the downstream google/agents-cli playground, where agents-cli invokes adk web with --allow_origins "*".
While agents-cli implemented a workaround in release v0.5.1 (reported in google/agents-cli#38), the root bug is still present in adk-python whenever adk is called directly or by any other client on Windows using wildcards.
Disabling Click's glob expansion at the root CLI entry point (by passing windows_expand_args=False) resolves the issue.
I have opened a PR addressing this: #6166

How often has this issue occurred?:

  • Always (100%)

Activity

  1. added
    cli[Component] This issue is related to cli
    on Jun 30, 2026
  2. added theissue type on Jun 30, 2026
  3. adk-bot commented on Jul 8, 2026

    @adk-bot
    Collaborator

    Notification: The author has updated the issue description. Maintainers, please review.

  4. added a commit that references this issue on Aug 18, 2026
    2638155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

cli[Component] This issue is related to cli

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions